-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
121 lines (96 loc) · 3.62 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
#####################################################################
## TAPSsc ##
## ##
## TAPS slowcontrol software ##
## ##
## ##
## (C) 2013-2014 by ##
## Dominik Werthmueller <[email protected]> ##
## Thomas Strub <[email protected]> ##
## ##
#####################################################################
# --------------------------- System and ROOT variables ---------------------------
S = src
I = include
O = obj
L = lib
B = bin
SRC = $(wildcard $(S)/TT*.cxx) $(S)/G__TAPSsc.cxx
INCD = $(wildcard $(I)/TT*.h)
INC = $(notdir $(INCD))
OBJD = $(patsubst $(S)/%.cxx, $(O)/%.o, $(SRC))
OBJ = $(notdir $(OBJD))
ROOTLIBS = $(shell root-config --libs)
ROOTCFLAGS = $(shell root-config --cflags)
ROOTLDFLAGS = $(shell root-config --ldflags)
ROOTLIB = $(shell root-config --libdir)
ROOTLIBA = $(ROOTLIB)/libRoot.a -lXpm -lXext -lX11 -lm -ldl -pthread \
-rdynamic $(ROOTLIB)/libpcre.a -lfreetype -lz -lXft -lz $(ROOTLIB)/liblzma.a
DEP_LIB = libRMySQL.so
LIB_TAPSsc = $(L)/libTAPSsc.so
vpath %.cxx $(S)
vpath %.h $(I)
vpath %.o $(O)
# -------------------------------- Compile options --------------------------------
CCCOMP = g++
CXXFLAGS = -g -O3 -Wall -fPIC $(ROOTCFLAGS) -I./$(I)
CXXAFLAGS = -g -O3 -s -ffunction-sections -fdata-sections -Wl,--no-undefined -Wl,--as-needed $(ROOTCFLAGS) -I./$(I)
LDFLAGS = -g -O3 -s -ffunction-sections -fdata-sections $(ROOTLDFLAGS)
# ------------------------------------ targets ------------------------------------
all: begin $(LIB_TAPSsc) $(L)/libTAPSsc.rootmap $(B)/TAPSServer $(B)/HVTalk end
begin:
@echo
@echo "-> Building TAPSsc"
@echo
end:
@echo
@echo "-> Finished!"
@echo
$(B)/TAPSServer: $(LIB_TAPSsc) $(S)/MainTAPSServer.cxx
@echo "Building the TAPSServer application"
@mkdir -p $(B)
@$(CCCOMP) $(CXXFLAGS) $(ROOTLIBS) -L $(CURDIR)/$(L) -lTAPSsc -o $(B)/TAPSServer $(S)/MainTAPSServer.cxx
$(B)/HVTalk: $(LIB_TAPSsc) $(S)/MainHVTalk.cxx
@echo "Building the HVTalk application"
@mkdir -p $(B)
@$(CCCOMP) $(CXXFLAGS) $(ROOTLIBS) -L $(CURDIR)/$(L) -lTAPSsc -o $(B)/HVTalk $(S)/MainHVTalk.cxx
$(LIB_TAPSsc): $(OBJ)
@echo
@echo "Building $(LIB_TAPSsc)"
@mkdir -p $(L)
@$(CCCOMP) $(LDFLAGS) -shared $(OBJD) -o $(LIB_TAPSsc)
$(L)/libTAPSsc.rootmap: $(LIB_TAPSsc)
@echo
@echo "Creating ROOT map"
@rlibmap -o $(L)/libTAPSsc.rootmap -l $(LIB_TAPSsc) -d $(DEP_LIB) -c $(I)/LinkDef.h
$(S)/G__TAPSsc.cxx: $(INC) $(I)/LinkDef.h
@echo
@echo "Creating TAPSsc dictionary"
@rootcint -v -f $@ -c -I./$(I) -p $(INC) $(I)/LinkDef.h
%.o: %.cxx
@echo "Compiling $(notdir $<)"
@mkdir -p $(O)
@$(CCCOMP) $(CXXFLAGS) -o $(O)/$@ -c $<
docs: htmldoc docu
@echo "Creating HTML documentation"
@rm -r -f htmldoc
root -b -n -q $(S)/htmldoc.C
@echo "Done."
htmldoc: $(LIB_TAPSsc)
@echo "Creating HTML documentation"
@rm -r -f htmldoc
root -b -n -q $(S)/htmldoc.C
@echo "Done."
docu:
@echo "Creating documentation"
@make -s -C doc
@echo "Done."
clean:
@echo "Cleaning TAPSsc distribution"
rm -f $(S)/G__*
rm -r -f $(L)
rm -f -r $(O)
rm -r -f $(B)
rm -r -f htmldoc
@make -s -C doc clean
@echo "Done."