CC=gcc CFLAGS= -Wall -Werror -g LDFLAGS= -lm COMPILE=$(CC) $(CFLAGS) $(LDFLAGS) # There is probably a better way to do this with make; however, I am lazy PROJECT_HFILES= map.h routing.h PROJECT_CFILES= path_main.c map.c routing.c PROJECT_EXECFILES= $(PROJECT_HFILES) $(PROJECT_CFILES) REPORT_FILE= REPORT.txt PROJECT_ALLFILES= $(PROJECT_HFILES) $(PROJECT_CFILES) $(REPORT_FILE) proj3 : $(PROJECT_EXECFILES) $(COMPILE) $(PROJECT_CFILES) -o proj3 # Target to build the output archive archive : $(PROJECT_ALLFILES) ./finalize $(PROJECT_ALLFILES) # Target to build the project and spit out a tar.bz2 release : tests archive $(PROJECT_ALLFILES) echo File list: $(PROJECT_ALLFILES) test_samp: $(PROJECT_EXECFILES) test_samp.c $(COMPILE) map.c routing.c test_samp.c -o test_samp # Target to run any automated tests we might have tests : proj3 test_map_input test_query_input test_path_correct echo "Automated tests complete" # Program to read in a map file and then spit it out again debug_mapin : debug_mapin.c $(PROJECT_EXECFILES) $(COMPILE) debug_mapin.c map.c -o debug_mapin # Checks to make sure that the input is being read properly TEST_MAP_IN_FILE=sample_inputs/maps/usa.txt test_map_input : debug_mapin echo '************* Verifying map input functions...' ./debug_mapin $(TEST_MAP_IN_FILE) > test_map_input.txt ./fieldiff.py $(TEST_MAP_IN_FILE) test_map_input.txt rm test_map_input.txt # Program to read in a query file and then spit it out again debug_queryin : debug_queryin.c $(PROJECT_EXECFILES) $(COMPILE) debug_queryin.c map.c -o debug_queryin # Checks to make sure that the input is being read properly TEST_QUERY_IN_FILE=sample_inputs/queries/query5x5.txt test_query_input : debug_queryin echo '************* Verifying query input functions...' ./debug_queryin $(TEST_QUERY_IN_FILE) > test_query_input.txt ./fieldiff.py $(TEST_QUERY_IN_FILE) test_query_input.txt rm test_query_input.txt # Checks that the 10-query USA path is correct TEST_PC_MAP=sample_inputs/maps/usa.txt TEST_PC_QUERY=sample_inputs/queries/usa10.txt test_path_correct: echo '************* Testing path correctness (this could take a while)' # This is a hack echo $(TEST_PC_MAP) > tmp echo $(TEST_PC_QUERY) >> tmp time ./proj3 < tmp > test_pc_log 2>/dev/null ./validate.py $(TEST_PC_MAP) test_pc_log rm tmp test_pc_log