diff options
author | Antony Woods <acron1@gmail.com> | 2014-10-02 17:35:05 +0100 |
---|---|---|
committer | Antony Woods <acron1@gmail.com> | 2014-10-02 17:35:05 +0100 |
commit | a8f6c5a92fea5439b4a0372ccc3b367e3c3bed3b (patch) | |
tree | 9a84a88649ae635b413b853cd0694382c1fa814a /amalgamate/merge_all.py | |
parent | 6890436742c89a01d00f26f796becb5e81c26e0b (diff) | |
parent | d496f0f4b5a4f154ffdb89896d8de155a002c393 (diff) | |
download | crow-a8f6c5a92fea5439b4a0372ccc3b367e3c3bed3b.tar.gz crow-a8f6c5a92fea5439b4a0372ccc3b367e3c3bed3b.zip |
Merge branch 'master' of github.com:acron0/crow into url-params-in-req
Diffstat (limited to 'amalgamate/merge_all.py')
-rw-r--r-- | amalgamate/merge_all.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/amalgamate/merge_all.py b/amalgamate/merge_all.py index 7935ead..fe7b50f 100644 --- a/amalgamate/merge_all.py +++ b/amalgamate/merge_all.py @@ -1,13 +1,20 @@ import glob +import os import re from collections import defaultdict +import sys + +header_path = "../include" +if len(sys.argv) > 1: + header_path = sys.argv[1] + OUTPUT = 'crow_all.h' re_depends = re.compile('^#include "(.*)"', re.MULTILINE) -headers = [x.rsplit('/',1)[-1] for x in glob.glob('../include/*.h')] +headers = [x.rsplit('/',1)[-1] for x in glob.glob(os.path.join(header_path,'*.h'))] print headers edges = defaultdict(list) for header in headers: - d = open("../include/" + header).read().decode('utf8') + d = open(os.path.join(header_path, header)).read().decode('utf8') match = re_depends.findall(d) for m in match: # m should included before header @@ -36,7 +43,7 @@ for x in edges: print order build = [] for header in order: - d = open("../include/" + header).read().decode('utf8') + d = open(os.path.join(header_path, header)).read().decode('utf8') build.append(re_depends.sub(lambda x:'\n', d)) build.append('\n') |