-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakefile
More file actions
39 lines (29 loc) · 1.03 KB
/
Copy pathmakefile
File metadata and controls
39 lines (29 loc) · 1.03 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
vpath %.cc = $(wildcard */src)
LIB_PATH = lib/
MLIB_PATH = mlib/
TEST_PATH = test/
OBJSRCS = $(wildcard */src/*.cc)
OBJS = $(addprefix $(LIB_PATH),$(notdir $(OBJSRCS:.cc=.o)))
MAINEXES = $(basename $(notdir $(wildcard */test/*.cc)))
TESTTARGETS = $(addsuffix .test,$(MAINEXES))
INCDIRS = -I.
CC = g++
#DEBUG = -g -O0
DEBUG = -g -O3 -fno-omit-frame-pointer -DNDEBUG
CFLAGS = -std=c++11 -Wall $(DEBUG) `root-config --cflags`
LFLAGS = -std=c++11 -Wall $(DEBUG) `root-config --glibs`
.PRECIOUS:$(LIB_PATH)%.o
all: $(MAINEXES)
%: $(MLIB_PATH)%.o $(OBJS)
$(CC) $(LFLAGS) $(OBJS) $(ROOTSYS)/lib/libGeom.so $(ROOTSYS)/lib/libEve.so $(ROOTSYS)/lib/libRGL.so $< -o $@
-include $(LIB_PATH)*.d
$(LIB_PATH)%.o: %.cc
$(CC) $(CFLAGS) -MMD -c $(INCDIRS) $< -o $@
$(MLIB_PATH)%.o: */test/%.cc
$(CC) $(CFLAGS) -MMD -c $(INCDIRS) $< -o $@
test: $(TESTTARGETS)
%.test:
./$*
diff -qs $(TEST_PATH)log_$* testlog_$*
clean:
\rm *~ */*~ */*/*~ $(LIB_PATH)/*.o $(LIB_PATH)/*.d $(MLIB_PATH)/*.o $(MLIB_PATH)/*.d dataGen dataRead hitReco trackReco testlog*