forked from pwittich/mictest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (50 loc) · 1.44 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
include Makefile.config
TGTS := main
EXES := ${TGTS}
ifeq (${CXX},icc)
EXES += $(addsuffix -mic, ${TGTS})
endif
.PHONY: all clean distclean
all: ${EXES}
cd mkFit && ${MAKE}
SRCS := $(wildcard *.cc)
OBJS := $(SRCS:.cc=.o)
DEPS := $(SRCS:.cc=.d)
AUTO_TGTS :=
ifdef USE_MATRIPLEX
auto-matriplex:
${MAKE} -C Matriplex auto && touch $@
AUTO_TGTS += auto-matriplex
${DEPS}: auto-matriplex
endif
ifeq ($(filter clean-local clean distclean, ${MAKECMDGOALS}),)
include ${DEPS}
endif
clean-local:
-rm -f ${EXES} *.d *.o *.om
-rm -rf USolids-{host,mic}
clean: clean-local
cd mkFit && ${MAKE} clean
distclean: clean-local
-rm -f ${AUTO_TGTS}
-rm -f *.optrpt
cd Matriplex && ${MAKE} distclean
cd mkFit && ${MAKE} distclean
main: ${AUTO_TGTS} ${OBJS} ${LIBUSOLIDS}
${CXX} ${CXXFLAGS} ${VEC_HOST} -o $@ ${OBJS} ${LIBUSOLIDS} ${LDFLAGS}
${OBJS}: %.o: %.cc %.d
${CXX} ${CPPFLAGS} ${CXXFLAGS} ${VEC_HOST} -c -o $@ $<
${LIBUSOLIDS} : USolids/CMakeLists.txt
-mkdir USolids-host
cd USolids-host && cmake ${CMAKEFLAGS} ../USolids && make
ifeq ($(CXX),icc)
OBJS_MIC := $(OBJS:.o=.om)
main-mic: ${AUTO_TGTS} ${OBJS_MIC} ${LIBUSOLIDS_MIC}
${CXX} ${CXXFLAGS} ${VEC_MIC} ${LDFLAGS_NO_ROOT} -o $@ ${OBJS_MIC} ${LIBUSOLIDS_MIC}
scp $@ mic0:
${LIBUSOLIDS_MIC} : USolids/CMakeLists.txt
-mkdir USolids-mic
cd USolids-mic && cmake ${CMAKEFLAGS_MIC} ../USolids && make
${OBJS_MIC}: %.om: %.cc
${CXX} ${CPPFLAGS_NO_ROOT} ${CXXFLAGS} ${VEC_MIC} -c -o $@ $<
endif