-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·44 lines (28 loc) · 967 Bytes
/
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
OBJS_LIB = $(shell ls src/*.cpp | sed 's/\.cpp/.o/')
PROGS = $(shell ls src/*.C | sed 's/\.C//' | sed 's/src\///')
INCLUDES = -I./include -I$(shell root-config --incdir) -I${DK2NU}/include
DEPLIBS = $(shell root-config --libs) -lEG
CC = g++
COPTS = -fPIC -DLINUX -O0 -g $(shell root-config --cflags)
FLAGS = -g
all: lib programs
lib: libtgtexit.so
libtgtexit.so: $(OBJS_LIB)
if [ ! -d lib ]; then mkdir -p lib; fi
$(CC) -shared -o lib/$@ $^ -L${DK2NU_LIB} -ldk2nuTree
programs: $(PROGS)
echo making $(PROGS)
$(PROGS): % : src/%.o $(OBJS_LIB) libtgtexit.so
if [ ! -d bin ]; then mkdir -p bin; fi
$(CC) -Wall -o bin/$@ $< $(DEPLIBS) -L$(WORKDIR)/lib -ltgtexit -L${DK2NU_LIB} -ldk2nuTree
%.o: %.cpp
$(CC) $(COPTS) $(INCLUDES) -c -o $@ $<
%.o: %.C
$(CC) $(COPTS) $(INCLUDES) -c -o $@ $<
clean: delobj dellib delbin
delobj:
-rm src/*.o
dellib:
if [ -d lib ]; then rm -rf lib; fi
delbin:
if [ -d bin ]; then rm -rf bin; fi