diff --git a/compile_all.py b/compile_all.py index 2db7c82..798bcf5 100755 --- a/compile_all.py +++ b/compile_all.py @@ -18,9 +18,12 @@ def build(algo_dir, template_dir, build_dir): shutil.copytree(algo_dir, build_dir) # remove the test vectors generator if it is there - c = os.path.join(build_dir, "genkat_aead.c") - if os.path.exists(c): - os.remove(c) + for r, d, f in os.walk(build_dir): + for file in f: + with open(os.path.join(r, file), 'r') as o: + is_generator = 'generate_test_vectors' in o.read() + if is_generator: + os.remove(os.path.join(r, file)) # find all c and h files, since they will be added to the makefile hfiles = [] diff --git a/templates/f7/configure b/templates/f7/configure index c27a276..d19e1a2 100755 --- a/templates/f7/configure +++ b/templates/f7/configure @@ -1,7 +1,8 @@ #!/bin/bash mv -n *.dat *.inc *.h Inc/ -sed -i src/encrypt.c -e "s/\(\s\)init(/\1_init(/g" +[ -f ./build ] && rm ./build +[ -f src/encrypt.c ] && sed -i src/encrypt.c -e "s/\(\s\)init(/\1_init(/g" mkdir -p /tmp/f7/Drivers ln -s /tmp/f7/Drivers Drivers exit 0