]> git.uio.no Git - u/mrichter/AliRoot.git/blob - build/module.tpl
Misleading printout removed
[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           @echo "***** Copying file @MODULE@/$(notdir $@) to $@ *****"
119           @[ -d $(dir $@) ] || mkdir $(dir $@)
120           cp @MODULE@/$(notdir $@) $@   
121 endif
122
123 $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
124           @echo "***** Linking library $@ *****"
125           $(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS)  -o $@ $(@PACKAGE@O) $(@PACKAGE@DO) $(SHLIB)
126  
127 $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
128           @echo "***** Makeing executable $@ *****"
129           $(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(LIBS) $(@PACKAGE@ELIBS) $(EXEFLAGS) -o $@ 
130
131 $(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH)
132          @echo "***** Creating $@ *****";       
133          @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
134          rootcint -f $@ -c $(CINTFLAGS) $(@PACKAGE@INC) $^
135
136 $(@PACKAGE@DO): $(@PACKAGE@DS)
137                 @echo "***** (Re)compiling $< *****";
138                 $(CXX) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@CXXFLAGS)
139
140 #Different targets for the module
141
142 all-@PACKAGE@: $(@PACKAGE@LIB)
143
144
145 depend-@PACKAGE@: $(@PACKAGE@DEP)
146
147 # determination of object files
148 $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d 
149         @echo "***** (Re)compiling $< *****";
150         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
151         $(CXX) -c $(@PACKAGE@INC)   $< -o $@ $(@PACKAGE@CXXFLAGS)
152
153 $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d 
154         @echo "***** (Re)compiling $< *****";
155         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
156         $(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
157
158 $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d 
159         @echo "***** (Re)compiling $< *****";
160         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
161         $(F77) -c $(@PACKAGE@INC)  $< -o $@ $(@PACKAGE@FFLAGS)
162
163 $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d 
164         @echo "***** (Re)compiling $< *****";
165         @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
166         $(CC) -c  $(@PACKAGE@INC)  $< -o $@   $(@PACKAGE@CFLAGS)
167
168 $(@PACKAGE@DDEP): $(@PACKAGE@DS)
169                 @echo "***** Making dependencies for $< *****";
170                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
171                 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
172
173 $(MODDIRO)/%.d: $(MODDIRS)/%.cxx $(EXPORTFILES)
174                 @echo "***** Making dependencies for $< *****";
175                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
176                 share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
177 $(MODDIRO)/%.d: $(MODDIRS)/%.f $(EXPORTFILES)
178                 @echo "***** Making dependencies for $< *****";
179                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
180                 share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
181 $(MODDIRO)/%.d: $(MODDIRS)/%.F  $(EXPORTFILES)
182                 @echo "***** Making dependencies for $< *****";
183                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
184                 share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC)  $<" > $@
185 $(MODDIRO)/%.d: $(MODDIRS)/%.c $(EXPORTFILES)
186                 @echo "***** Making dependencies for $< *****";
187                 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
188                 share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
189
190
191 #Directory creation
192
193 #$(MODDIRO):
194 #       @echo "***** Making $@ *****"
195 #       mkdir -p $@
196    
197
198
199
200
201
202
203
204
205
206