forked from duaneloh/Dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (43 loc) · 1.35 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
.PHONY: mkdir env
MPICC = mpicc
CC = gcc
CFLAGS = $(shell gsl-config --cflags) -Wno-unused-result -O3 -Wall -fopenmp
LIBS = $(shell gsl-config --libs) -fopenmp
OMPI_CC = $(CC)
EMC_HEADER = $(wildcard src/*.h)
EMC_SRC = $(wildcard src/*.c)
EMC_OBJ = $(patsubst src/%.c, bin/%.o, $(EMC_SRC))
UTILS_SRC = $(wildcard utils/src/*.c)
UTILS = $(patsubst utils/src/%.c, utils/%, $(UTILS_SRC))
DIRECTORIES = data bin images
all: mkdir emc $(UTILS)
mkdir: $(DIRECTORIES)
$(DIRECTORIES):
mkdir -p $(DIRECTORIES)
emc: $(EMC_OBJ)
ifeq ($(OMPI_CC), gcc)
$(MPICC) -o $@ $^ $(LIBS)
else
`export OMPI_CC=$(OMPI_CC); $(MPICC) -o $@ $^ $(LIBS)`
endif
bin/recon_emc.o bin/setup_emc.o bin/max_emc.o: $(EMC_HEADER)
bin/detector.o: src/detector.h
bin/dataset.o: src/dataset.h src/detector.h
bin/interp.o: src/interp.h src/detector.h
bin/quat.o: src/quat.h
bin/iterate.o: src/iterate.h src/dataset.h src/detector.h
$(EMC_OBJ): bin/%.o: src/%.c
ifeq ($(OMPI_CC), gcc)
$(MPICC) -c $< -o $@ $(CFLAGS)
else
`export OMPI_CC=$(OMPI_CC); $(MPICC) -c $< -o $@ $(CFLAGS)`
endif
utils/compare: bin/quat.o bin/interp.o
utils/make_quaternion: bin/quat.o
utils/make_data: bin/detector.o bin/interp.o
utils/merge: bin/detector.o bin/dataset.o bin/interp.o
utils/fiberize: bin/detector.o bin/interp.o
$(UTILS): utils/%: utils/src/%.c
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
clean:
rm -f emc $(UTILS) $(EMC_OBJ)