]> git.uio.no Git - u/mrichter/AliRoot.git/blob - build/module.tpl
Change to TRDdigitizer
[u/mrichter/AliRoot.git] / build / module.tpl
1
2
3 ifndef PACKFFLAGS
4 @PACKAGE@FFLAGS:=$(FFLAGS)
5 else
6 @PACKAGE@FFLAGS:=$(PACKFFLAGS)
7 endif
8
9 ifndef PACKCFLAGS
10 @PACKAGE@CFLAGS:=$(CFLAGS)
11 else
12 @PACKAGE@CFLAGS:=$(PACKCFLAGS)
13 endif
14
15 ifndef PACKCXXFLAGS
16 @PACKAGE@CXXFLAGS:=$(CXXFLAGS)
17 else
18 @PACKAGE@CXXFLAGS:=$(PACKCXXFLAGS)
19 endif
20
21
22 ifdef DHDR
23 WITHDICT=YES
24 else
25 WITHDICT=
26 endif
27
28 # Headerfiles exported to common place:
29 @PACKAGE@EXPORT:=$(EXPORT)
30 @PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT))
31
32
33 #Extra include,libs etc.
34 #@PACKAGE@INC:=$(patsubst %,-I@MODULE@/%,$(EINCLUDE)) -I@MODULE@
35
36 @PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@
37
38 @PACKAGE@ELIBS:=$(patsubst %,-l%,$(ELIBS))
39 @PACKAGE@ELIBSDIR:=$(patsubst %,-L%,$(ELIBSDIR))
40
41 #c sources and headers
42
43 @PACKAGE@CS:=$(patsubst %,$(MODDIR)/%,$(CSRCS))
44 @PACKAGE@CH:=$(patsubst %,$(MODDIR)/%,$(CHDRS))
45
46 #Fortran sources 
47 @PACKAGE@FS:=$(patsubst %,$(MODDIR)/%,$(FSRCS))
48
49 #c++ sources and header
50 @PACKAGE@S:=$(patsubst %,$(MODDIR)/%,$(SRCS))
51 @PACKAGE@H:=$(patsubst %,$(MODDIR)/%,$(HDRS)) $(EHDRS)
52
53 #############################################################################
54 #
55 #            If special rootcint headerfiles is specified use them
56 #                         else use all headers
57
58 ifndef CINTHDRS
59 @PACKAGE@CINTHDRS:=$(@PACKAGE@H) 
60 else
61 @PACKAGE@CINTHDRS:=$(CINTHDRS)
62 endif
63 #############################################################################
64
65 # Package Dictionary 
66
67 @PACKAGE@DH:=$(MODDIR)/$(DHDR)
68
69
70 #All objects
71 @PACKAGE@CO:=$(patsubst %,$(MODDIRO)/%, $(CSRCS:.c=.o))
72 TEMP:=$(FSRCS:.F=.o)
73 @PACKAGE@FO:=$(patsubst %,$(MODDIRO)/%, $(TEMP:.f=.o))
74 @PACKAGE@O:= $(patsubst %,$(MODDIRO)/%, $(SRCS:.cxx=.o)) $(@PACKAGE@FO) $(@PACKAGE@CO)
75
76 ifdef WITHDICT
77   @PACKAGE@DS:=$(MODDIRO)/G__@PACKAGE@.cxx
78   @PACKAGE@DO:=$(MODDIRO)/G__@PACKAGE@.o
79   @PACKAGE@DDEP:=$(@PACKAGE@DO:.o=.d)
80   @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) $(@PACKAGE@DDEP)
81 else
82   @PACKAGE@DS:=
83   @PACKAGE@DO:=
84   @PACKAGE@DDEP:=
85   @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d)
86 endif
87
88
89 #The actual library file
90
91 @PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT)
92
93 #The actual binary file
94
95 @PACKAGE@BIN:=$(BINPATH)/@PACKAGE@
96
97
98 # Use in the main Makefile
99
100 ifeq ($(TYPE),lib)
101 ALLLIBS += $(@PACKAGE@LIB)
102 BINLIBS += -l@PACKAGE@
103 else
104 ALLEXECS += $(@PACKAGE@BIN)
105 endif
106
107 # include all dependency files
108 INCLUDEFILES +=$(@PACKAGE@DEP)
109
110 EXPORTFILES += $(@PACKAGE@EXPORTDEST)
111
112 #local rules
113
114 #The exportfiles only include if any!!
115
116 ifdef @PACKAGE@EXPORT
117 #$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT))
118
119 $(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h
120           @echo "***** Copying file @MODULE@/$(notdir $@) to $@ *****"
121           @[ -d $(dir $@) ] || mkdir $(dir $@)
122           @cp @MODULE@/$(notdir $@) $@  
123 endif
124
125 $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
126           @echo "***** Linking library $@ *****"
127           $(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS)  -o $@ $(@PACKAGE@O) $(@PACKAGE@DO) $(SHLIB)
128  
129 $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
130           @echo "***** Makeing executable $@ *****"
131           $(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(LIBS) $(@PACKAGE@ELIBS) $(EXEFLAGS) -o $@ 
132
133 $(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH)
134          @echo "***** Creating $@ *****";       
135          @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
136          rootcint -f $@ -c $(CINTFLAGS) $(@PACKAGE@INC) $^
137
138 $(@PACKAGE@DO): $(@PACKAGE@DS)
139                 @echo "***** (Re)compiling $< *****";
140                 $(CXX) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@CXXFLAGS)
141
142 #Different targets for the module
143
144 all-@PACKAGE@: $(@PACKAGE@LIB)
145
146 depend-@PACKAGE@: $(@PACKAGE@DEP)
147
148 # determination of object files
149 $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d 
150         @echo "***** (Re)compiling $< *****";
151         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
152         $(CXX) -c $(@PACKAGE@INC)   $< -o $@ $(@PACKAGE@CXXFLAGS)
153
154 $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d 
155         @echo "***** (Re)compiling $< *****";
156         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
157         $(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
158
159 $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d 
160         @echo "***** (Re)compiling $< *****";
161         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
162         $(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
163
164 $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d 
165         @echo "***** (Re)compiling $< *****";
166         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
167         $(CC) -c  $(@PACKAGE@INC)  $< -o $@   $(@PACKAGE@CFLAGS)
168
169 $(@PACKAGE@DDEP): $(@PACKAGE@DS)
170                 @echo "***** Making dependencies for $< *****";
171                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
172                 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
173
174 $(MODDIRO)/%.d: $(MODDIRS)/%.cxx 
175                 @echo "***** Making dependencies for $< *****";
176                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
177                 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
178 $(MODDIRO)/%.d: $(MODDIRS)/%.f
179                 @echo "***** Making dependencies for $< *****";
180                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
181                 @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
182 $(MODDIRO)/%.d: $(MODDIRS)/%.F
183                 @echo "***** Making dependencies for $< *****";
184                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
185                 share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
186 $(MODDIRO)/%.d: $(MODDIRS)/%.c
187                 @echo "***** Making dependencies for $< *****";
188                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
189                 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
190
191
192 #Directory creation
193
194 #$(MODDIRO):
195 #       @echo "***** Making $@ *****"
196 #       mkdir -p $@
197    
198
199
200
201
202
203
204
205
206
207