-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
135 lines (103 loc) · 4.88 KB
/
Makefile
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
SOURCE_FILES=src/median.c src/caspian.c src/result_set.c src/rawfile_coordinate_reader.c\
src/kd_tree.c src/data_handling.c src/reduction_functions.c src/grid.c src/gridding.c\
src/proj_projector.c src/io_helper.c
OBJECTS=build/median.o build/caspian.o build/result_set.o build/rawfile_coordinate_reader.o\
build/kd_tree.o build/data_handling.o build/reduction_functions.o build/grid.o\
build/gridding.o build/proj_projector.o build/io_helper.o
CC=gcc
LDFLAGS=-lm -lproj
CFLAGS=-fopenmp -std=c99 -Wall -Werror
OPT_FLAGS=-O3 -march=native
DEBUG_FLAGS=-DDEBUG -ggdb
OPT_CC=$(CC) $(CFLAGS) $(OPT_FLAGS) -c
CHECK_CC=$(CC) -lcheck -std=c99 -fopenmp -lm
minimal: caspian quickview
all: caspian projcalc debug docs quickview check
caspian: bin/caspian
projcalc: bin/projcalc
debug: bin/caspian-debug
docs: doc/caspian.pdf doc/html/index.html
quickview: bin/quickview
check: build_testcases run_testcases
bin/projcalc: src/projection_calculator.c
$(CC) $(CFLAGS) $(LDFLAGS) $? -o bin/projcalc
build/median.o: src/median.c src/median.h
$(OPT_CC) src/median.c -o build/median.o
build/caspian.o: src/caspian.c src/coordinate_reader.h src/data_handling.h\
src/gridding.h src/grid.h src/io_helper.h src/kd_tree.h src/proj_projector.h\
src/projector.h src/rawfile_coordinate_reader.h src/reduction_functions.h src/spatial_index.h
$(OPT_CC) src/caspian.c -o build/caspian.o
build/result_set.o: src/result_set.c src/result_set.h
$(OPT_CC) src/result_set.c -o build/result_set.o
build/rawfile_coordinate_reader.o: src/rawfile_coordinate_reader.c\
src/rawfile_coordinate_reader.h src/coordinate_reader.h
$(OPT_CC) src/rawfile_coordinate_reader.c -o build/rawfile_coordinate_reader.o
build/kd_tree.o: src/kd_tree.c src/kd_tree.h src/coordinate_reader.h src/data_handling.h\
src/spatial_index.h src/proj_projector.h src/projector.h src/result_set.h
$(OPT_CC) src/kd_tree.c -o build/kd_tree.o
build/data_handling.o: src/data_handling.c src/data_handling.h
$(OPT_CC) src/data_handling.c -o build/data_handling.o
build/reduction_functions.o: src/reduction_functions.c src/reduction_functions.h\
src/median.h src/result_set.h
$(OPT_CC) src/reduction_functions.c -o build/reduction_functions.o
build/grid.o: src/grid.c src/grid.h src/projector.h
$(OPT_CC) src/grid.c -o build/grid.o
build/gridding.o: src/gridding.c src/gridding.h src/io_spec.h src/reduction_functions.h\
src/result_set.h
$(OPT_CC) src/gridding.c -o build/gridding.o
build/proj_projector.o: src/proj_projector.c src/proj_projector.h src/projector.h
$(OPT_CC) src/proj_projector.c -o build/proj_projector.o
build/io_helper.o: src/io_helper.c src/io_helper.h
$(OPT_CC) src/io_helper.c -o build/io_helper.o
bin/caspian: $(OBJECTS)
$(CC) $(CFLAGS) $(OPTFLAGS) $(LDFLAGS) $(OBJECTS) -o bin/caspian
bin/caspian-debug: $(SOURCE_FILES)
gcc $(CFLAGS) $(LDFLAGS) $(SOURCE_FILES) $(DEBUG_FLAGS) -o bin/caspian-debug
doc/caspian.pdf: src/doc/caspian.tex
latexmk -cd $? -pdfdvi
cp -f src/doc/caspian.pdf doc/caspian.pdf
doc/html/index.html: src/*
doxygen src/Doxyfile
bin/quickview: src/quickview
cp src/quickview bin/quickview
build_testcases: caspian test/check_data_handling.test\
test/check_rawfile_coordinate_reader.test test/check_grid.test test/check_io_helper.test\
test/check_median.test test/check_result_set.test test/check_proj_projector.test\
test/check_kd_tree.test test/check_reduction_functions.test
test/check_data_handling.test: build/data_handling.o test/check_data_handling.c
$(CHECK_CC) $^ -o $@
test/check_rawfile_coordinate_reader.test: build/rawfile_coordinate_reader.o\
build/proj_projector.o test/check_rawfile_coordinate_reader.c
$(CHECK_CC) $^ -lproj -o $@
test/check_grid.test: build/grid.o build/proj_projector.o test/check_grid.c
$(CHECK_CC) $^ -lproj -o $@
test/check_io_helper.test: build/io_helper.o test/check_io_helper.c
$(CHECK_CC) $^ -o $@
test/check_median.test: build/median.o test/check_median.c
$(CHECK_CC) $^ -o $@
test/check_result_set.test: build/result_set.o test/check_result_set.c
$(CHECK_CC) $^ -o $@
test/check_proj_projector.test: build/proj_projector.o test/check_proj_projector.c
$(CHECK_CC) $^ -lproj -o $@
test/check_kd_tree.test: build/kd_tree.o build/proj_projector.o\
build/rawfile_coordinate_reader.o build/result_set.o test/check_kd_tree.c
$(CHECK_CC) $^ -lproj -o $@
test/check_reduction_functions.test: build/reduction_functions.o build/result_set.o\
build/data_handling.o build/median.o test/check_reduction_functions.c
$(CHECK_CC) $^ -o $@
run_testcases: build_testcases
./test/check_data_handling.test
./test/check_grid.test
./test/check_io_helper.test
./test/check_kd_tree.test
./test/check_median.test
./test/check_proj_projector.test
./test/check_rawfile_coordinate_reader.test
./test/check_reduction_functions.test
./test/check_result_set.test
.PHONY: clean release
clean:
rm -rf bin/* doc/* build/* test/*.test
latexmk src/doc/caspian.tex -C -cd
release: clean docs
tar --directory=.. --exclude-vcs -czvf ../caspian.tar.gz caspian