[A] Added check for amalgamation script has been run

This commit is contained in:
seleznevae 2018-11-18 00:04:46 +03:00
parent a1ffd31ae3
commit a933b13d25
2 changed files with 12 additions and 1 deletions

View File

@ -87,6 +87,11 @@ matrix:
script:
# Check library file was generated
- python amalgamate.py -o dummy.c
- diff dummy.c lib/fort.c
- rm dummy.c
# make sure CC is correctly set
- if [[ "${FORT_C_COMPILER}" != "" ]];
then
@ -186,3 +191,5 @@ script:

View File

@ -1,5 +1,6 @@
import os
import sys
def comment_line(line):
return "/* {} */ /* Commented by amalgamation script */".format(line)
@ -84,7 +85,10 @@ def is_c_source_file(file):
def main():
config = {}
config["output_file"] = "./lib/fort.c"
if len(sys.argv) >= 3 and sys.argv[1] == "-o":
config["output_file"] = sys.argv[2]
else:
config["output_file"] = "./lib/fort.c"
config["src_dir"] = "./src"
all_files = os.listdir(config["src_dir"])
config["src_files"] = filter(is_c_source_file, all_files)