Skip to content

Commit

Permalink
refs #27: Code clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Jan 20, 2016
1 parent 00904da commit a7f142e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ rule test:

for case in _test_cases:
includes = [f for f in compilelib.get_includes(fmt('tests/test_{case}.cc'), 'include')]
print(case, compilelib.get_requires(fmt('tests/test_{case}.cc'), 'src'))
requires = [joinpath(OBJ_DIR, f) for f in compilelib.get_requires(fmt('tests/test_{case}.cc'), 'src')]
rule:
input: fmt('tests/test_{case}.cc'), includes, requires
Expand Down
8 changes: 4 additions & 4 deletions compilelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def _find_deps_with_regex(srcfile, base_dir, regexs, visited=None):
pass
return results

_rx_included_local_header = re.compile(r'^#include "(.+\.(h|hh))"')
_rx_included_nba_header = re.compile(r'#include <(nba/.+\.(h|hh))>')
_rx_included_local_header = re.compile(r'^#include\s*"(.+\.(h|hh))"')
_rx_included_nba_header = re.compile(r'^#include\s*<(nba/.+\.(h|hh))>')
def get_includes(srcfile, nba_include_dir):
'''
Gets a list of included local header files from the given source file.
Expand All @@ -95,8 +95,8 @@ def get_includes(srcfile, nba_include_dir):
)
return _find_deps_with_regex(srcfile, nba_include_dir, regexs)

_rx_required_obj_sig = re.compile(r'#require <(.+\.o)>')
def get_requires(srcfile, nba_src_dir, visited=None):
_rx_required_obj_sig = re.compile(r'^#require\s*<(.+\.o)>')
def get_requires(srcfile, nba_src_dir):
'''
Gets a list of dependent object files from the given source file.
(e.g., #require <lib/xxx.o>)
Expand Down

0 comments on commit a7f142e

Please sign in to comment.