-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
92 lines (66 loc) · 3.73 KB
/
makefile
File metadata and controls
92 lines (66 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
CC=gcc
CFLAGS=
ifeq ($(DEBUG),1)
CFLAGS=-DDEBUG_ENABLED
endif
#Creates bin, build, and output folders required to compile and execute the program.
bin_folder := $(shell mkdir -p bin)
build_folder := $(shell mkdir -p build)
output_folder := $(shell mkdir -p output)
#Default command
all: app test
#Production application command
app: main.o parse_config.o common_functions.o calc_shortest_path.o parse_airports.o gen_locations.o find_closest.o export.o
$(CC) -g -o bin/StratAirliftInit build/common_functions.o build/main.o build/parse_config.o build/calc_shortest_path.o build/parse_airports.o build/gen_locations.o build/find_closest.o build/export.o -lm
#Commands to compile all parts of the program
main.o: src/main.c
$(CC) -g -c $(CFLAGS) src/main.c -o build/main.o
parse_config.o: src/parse_config.c
$(CC) -g -c $(CFLAGS) src/parse_config.c -o build/parse_config.o
common_functions.o: src/common_functions.c
$(CC) -g -c $(CFLAGS) src/common_functions.c -o build/common_functions.o
calc_shortest_path.o: src/calc_shortest_path.c
$(CC) -g -c $(CFLAGS) src/calc_shortest_path.c -o build/calc_shortest_path.o
parse_airports.o: src/parse_airports.c
$(CC) -g -c $(CFLAGS) src/parse_airports.c -o build/parse_airports.o
gen_locations.o: src/gen_locations.c
$(CC) -g -c $(CFLAGS) src/gen_locations.c -o build/gen_locations.o
find_closest.o: src/find_closest.c
$(CC) -g -c $(CFLAGS) src/find_closest.c -o build/find_closest.o
export.o: src/export.c
$(CC) -g -c $(CFLAGS) src/export.c -o build/export.o
#Test application command
test: test_main.o parse_config.o common_functions.o calc_shortest_path.o calc_shortest_path_test.o parse_airports.o parse_airports_test.o gen_locations.o gen_locations_test.o find_closest.o find_closest_test.o parse_config_test.o integrated.o export.o export_test.o common_test_functions.o
$(CC) -g -o bin/StratAirliftInit_Test build/common_functions.o build/test_main.o build/parse_config.o build/calc_shortest_path.o build/calc_shortest_path_test.o build/parse_airports.o build/parse_airports_test.o build/gen_locations.o build/gen_locations_test.o build/find_closest.o build/find_closest_test.o build/parse_config_test.o build/integrated.o build/export.o build/export_test.o build/common_test_functions.o -lm
#Commands to compile all parts of the test
test_main.o: test/src/test_main.c
$(CC) -g -c $(CFLAGS) test/src/test_main.c -o build/test_main.o
calc_shortest_path_test.o: test/src/calc_shortest_path_test.c
$(CC) -g -c $(CFLAGS) test/src/calc_shortest_path_test.c -o build/calc_shortest_path_test.o
parse_airports_test.o: test/src/parse_airports_test.c
$(CC) -g -c $(CFLAGS) test/src/parse_airports_test.c -o build/parse_airports_test.o
gen_locations_test.o: test/src/gen_locations_test.c
$(CC) -g -c $(CFLAGS) test/src/gen_locations_test.c -o build/gen_locations_test.o
find_closest_test.o: test/src/find_closest_test.c
$(CC) -g -c $(CFLAGS) test/src/find_closest_test.c -o build/find_closest_test.o
parse_config_test.o: test/src/parse_config_test.c
$(CC) -g -c $(CFLAGS) test/src/parse_config_test.c -o build/parse_config_test.o
integrated.o: test/src/integrated.c
$(CC) -g -c $(CFLAGS) test/src/integrated.c -o build/integrated.o
export_test.o: test/src/export_test.c
$(CC) -g -c $(CFLAGS) test/src/export_test.c -o build/export_test.o
common_test_functions.o: test/src/common_test_functions.c
$(CC) -g -c $(CFLAGS) test/src/common_test_functions.c -o build/common_test_functions.o
#This command executes the program
run:
bin/StratAirliftInit
#This command executes the test program
run_test:
bin/StratAirliftInit_Test
#This command generates the doxygen files
doxygen:
rm -f -r ./doc/detailed
doxygen ./doc/doxygen_config.cfg
#This command resets the build to the default state
clean:
rm -f -r bin/* build/* output/* test/output/*