/[PAMELA software]/gpamela/Makefile
ViewVC logotype

Diff of /gpamela/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3.7 by pamela, Thu Jul 21 13:23:43 2005 UTC revision 3.25 by pamela, Tue Jan 29 18:24:56 2008 UTC
# Line 1  Line 1 
1  #  #
2  # Steering Makefile to create gpamelaX11 and gpamela executable  # Steering Makefile to create gpamelaX11 and gpamela executable
3  # First of all define the src files. One for each subdirectory  # First of all define the src files. One for each subdirectory
4  #  #
5  # some addition  GPAMELASRCS= gpamela/ffuser.F gpamela/gdraws.F gpamela/gpadigi.F \
6  GPAMELASRCS= gpamela/ffuser.F gpamela/gdraws.F gpamela/gpadigi.F \          gpamela/gpal.F gpamela/gpdat.F \
7          gpamela/gpal.F gpamela/gpdat.F \          gpamela/gpffr.F gpamela/gpfil.F gpamela/gpgaus.F \
8          gpamela/gpffr.F gpamela/gpfil.F gpamela/gpgaus.F \          gpamela/gpgeo.F gpamela/gphbk.F \
9          gpamela/gpgeo.F gpamela/gphbk.F \          gpamela/gphit.F gpamela/gplook.F \
10          gpamela/gphit.F gpamela/gplook.F \          gpamela/gpmapa.F gpamela/gpmat.F gpamela/gpmed.F \
11          gpamela/gpmapa.F gpamela/gpmat.F gpamela/gpmed.F \          gpamela/gpn2g.F gpamela/gpnhit.F gpamela/gppama.F \
12          gpamela/gpn2g.F gpamela/gpnhit.F gpamela/gppama.F \          gpamela/gprhit.F gpamela/gprsht.F \
13          gpamela/gprhit.F gpamela/gprsht.F \          gpamela/gpsed.F gpamela/gpsptm.F \
14          gpamela/gpsed.F gpamela/gpsptm.F \          gpamela/gpudat.F gpamela/gpudig.F gpamela/gpuffr.F  \
15          gpamela/gpudat.F gpamela/gpudig.F gpamela/gpuffr.F  \          gpamela/gpufil.F gpamela/gpugeo.F gpamela/gpuhbk.F \
16          gpamela/gpufil.F gpamela/gpugeo.F gpamela/gpuhbk.F \          gpamela/gpuhit.F gpamela/gpuini.F \
17          gpamela/gpuhit.F gpamela/gpuini.F \          gpamela/gpukin.F gpamela/gpulas.F \
18          gpamela/gpukin.F gpamela/gpulas.F \          gpamela/gpumat.F gpamela/gpumed.F gpamela/gpuout.F \
19          gpamela/gpumat.F gpamela/gpumed.F gpamela/gpuout.F \          gpamela/gpused.F gpamela/gpustep.F gpamela/gputra.F \
20          gpamela/gpused.F gpamela/gpustep.F gpamela/gputra.F \          gpamela/gputre.F gpamela/gudigi.F \
21          gpamela/gputre.F gpamela/gudigi.F \          gpamela/guhadr.F gpamela/gukine.F gpamela/guout.F \
22          gpamela/guhadr.F gpamela/gukine.F gpamela/guout.F \          gpamela/guphad.F gpamela/gustep.F \
23          gpamela/guphad.F gpamela/gustep.F \          gpamela/gutrak.F gpamela/gutrev.F \
24          gpamela/gutrak.F gpamela/gutrev.F \          gpamela/gviewyz.F gpamela/n2g.F \
25          gpamela/gviewyz.F gpamela/n2g.F \          gpamela/uginit.F gpamela/uglast.F \
26          gpamela/uginit.F gpamela/uglast.F          gpamela/gprnhran.F gpamela/ghesig.F \
27  GPCALSRCS = gpcal/gpcalv.F gpcal/gpce.F gpcal/gpdcal.F \          gpamela/gptav.F gpamela/nizlnw.F gpamela/gpnyl6.F \
28          gpcal/gpg10c.F gpcal/gpg10.F gpcal/gpsica.F \          gpamela/gpamg6m.F gpamela/gpiron.F
29          gpcal/gpucal.F gpcal/gpw2.F gpcal/gpw.F  GPCALSRCS = gpcal/gpcalv.F gpcal/gpce.F gpcal/gpdcal.F \
30  GPCASSRCS = gpcas/gpcasv.F gpcas/gpdcas.F gpcas/gpucas.F          gpcal/gpg10c.F gpcal/gpg10.F gpcal/gpsica.F \
31  GPCATSRCS = gpcat/gpcatv.F gpcat/gpdcat.F gpcat/gpucat.F          gpcal/gpucal.F gpcal/gpw2.F gpcal/gpw.F
32  GPFIELDSRCS = gpfield/flin3.F gpfield/gufld.F  GPCASSRCS = gpcas/gpcasv.F gpcas/gpdcas.F gpcas/gpucas.F
33  GPGARSRCS = gpgar/gpgacl.F  gpgar/gpgapart.F gpgar/gpgarin.F \  GPCATSRCS = gpcat/gpcatv.F gpcat/gpdcat.F gpcat/gpucat.F
34          gpgar/gpgarsel.F gpgar/gptogar.F gpgar/grinit.F  GPCARDSRCS = gpcard/gpcardv.F gpcard/gpdcard.F gpcard/gpucard.F
35  GPHYSSRCSRCS = gphys/gfluct.F  GPFIELDSRCS = gpfield/flin3.F gpfield/gufld.F gpfield/gprbi.F \
36  GPMAINSRCS = gpmain/gpmain.F          gpfield/inter_B.F gpfield/inter_B_inner.F gpfield/inter_B_outer.F
37  GPSPESRCS  = gpspe/gpcp.F gpspe/gpdspe.F gpspe/gpfe.F \  GPGARSRCS = gpgar/gpgacl.F  gpgar/gpgapart.F gpgar/gpgarin.F \
38          gpspe/gpkap.F gpspe/gpmaspe.F gpspe/gproa.F \          gpgar/gpgarsel.F gpgar/gptogar.F gpgar/grinit.F
39          gpspe/gpsitr.F gpspe/gpspema.F gpspe/gpspev.F gpspe/gpuspe.F  GPHYSSRCSRCS = gphys/gfluct.F
40  GPTOFSRCS = gptof/gpdtof.F gptof/gpscin.F gptof/gpscint.F \  GPMAINSRCS = gpmain/gpmain.F
41          gptof/gptofv.F gptof/gputof.F  GPSPESRCS  = gpspe/gpcp.F gpspe/gpdspe.F gpspe/gpfe.F \
42  GPTRDSRCS = gptrd/gpdtrd.F gptrd/gptrad.F gptrd/gptrdv.F \          gpspe/gpkap.F gpspe/gpmaspe.F gpspe/gproa.F \
43          gptrd/gputrd.F gptrd/gpxe.F gptrd/gpxtr.F \          gpspe/gpsitr.F gpspe/gpspema.F gpspe/gpspev.F gpspe/gpuspe.F \
44          gptrd/npoiss.F gptrd/xescape.F gptrd/xtrinteg.F \          gpspe/gprspe.F gpspe/gpudiffusion.F gpspe/gpucollection.F
45          gptrd/xtrinter.F gptrd/xtryield.F  GPTOFSRCS = gptof/gpdtof.F gptof/gpscin.F gptof/gpscint.F \
46  GPXINTSRCS = gpxint/gxint.F gpxint/qnext.F          gptof/gptofv.F gptof/gputof.F gptof/gpmyl.F gptof/gppol.F
47  #  GPTRDSRCS = gptrd/gpdtrd.F gptrd/gptrad.F gptrd/gptrdv.F \
48  GPSRCS = $(GPAMELASRCS) $(GPCALSRCS) $(GPCASSRCS) $(GPCATSRCS) $(GPFIELDSRCS)  $(GPGARSRCS) $(GPHYSSRCS) \          gptrd/gputrd.F gptrd/gpxe.F gptrd/gpxtr.F \
49          $(GPSPESRCS) $(GPTOFSRCS) $(GPTRDSRCS)          gptrd/npoiss.F gptrd/xescape.F gptrd/xtrinteg.F \
50  GPOBJS =$(addsuffix .o,$(basename ${GPSRCS}) )          gptrd/xtrinter.F gptrd/xtryield.F
51  GPDEPENDS =$(GPOBJS:.o=.d)  GPXINTSRCS = gpxint/gxint.F gpxint/qnext.F
52  GPMAINOBJS =$(addsuffix .o,$(basename ${GPMAINSRCS}) )  GPNDSRCS = gpnd/gpndv.F gpnd/gpgigp.F gpnd/gpund.F gpnd/gpdnd.F gpnd/gpgig.F \
53  GPMAINDEPENDS =$(GPMAINOBJS:.o=.d)          gpnd/gpgrsigma.F gpnd/gpgres.F gpnd/gpcad.F \
54  GPXINTOBJS =$(addsuffix .o,$(basename ${GPXINTSRCS}) )          gpnd/gpch2.F gpnd/gphe3.F
55  GPXINTDEPENDS =$(GPXINTOBJS:.o=.d)  GPCALORSRC = gpcalor/gpcalor.F
56  #  #
57  GEANTINC = gcdes  GPSRCS = $(GPAMELASRCS) $(GPCALSRCS) $(GPCASSRCS) $(GPCATSRCS) $(GPCARDSRCS) \
58  GPINC = gpcdes          $(GPFIELDSRCS)  $(GPGARSRCS) $(GPHYSSRCS) \
59  CERNLIB = `cernlib geant,genlib,pawlib,graflib/X11,packlib,mathlib`          $(GPSPESRCS) $(GPTOFSRCS) $(GPNDSRCS) $(GPTRDSRCS)  $(GPCALORSRC)
60  GPLIBDIR = ./lib  GPOBJS =$(addsuffix .o,$(basename ${GPSRCS}) )
61  GPLIB = ${GPLIBDIR}/libgarfield-7.a  GPDEPENDS =$(GPOBJS:.o=.d)
62  #  GPMAINOBJS =$(addsuffix .o,$(basename ${GPMAINSRCS}) )
63  BIN = ./bin  GPMAINDEPENDS =$(GPMAINOBJS:.o=.d)
64  AUX = ./aux  GPXINTOBJS =$(addsuffix .o,$(basename ${GPXINTSRCS}) )
65  AUXFILES = ${AUX}/gpfield.rz ${AUX}/GPAMELA.FFR ${AUX}/TRD_ATT.DAT ${AUX}/GARFIELD.GAR \  GPXINTDEPENDS =$(GPXINTOBJS:.o=.d)
66  $(AUX)/xe_80_co2_20.gas  #
67  GARFIELDSRC = ./garfield/src  GEANTINC = gcdes
68  #  GPINC = gpcdes
69  INTERFLAGS = -DGPAMELA_UNIX -DGPAMELA_TYPE -DGPAMELA_X11 -DGPAMELA_INTER -DGPAMELA_HIGZ \  GPCALORINC = gpcalordes
70          -DGPAMELA_GARFIELD  -DGPAMELA_MANYWIRE  -DGPAMELA_LONGLIST  -DGPAMELA_BIGMAP  CERNLIB = `cernlib geant,genlib,pawlib,graflib/X11,packlib,mathlib`
71  BATCHFLAGS = -DGPAMELA_UNIX -DGPAMELA_TYPE -DGPAMELA_GARFIELD  -DGPAMELA_MANYWIRE  -DGPAMELA_LONGLIST  -DGPAMELA_BIGMAP  GPLIBDIR = ./lib
72  #  GPLIB = ${GPLIBDIR}/libgarfield-7.a
73  CC = gcc  #
74  FC = g77  BIN = ./bin
75  DEBFLAGS =  -g -fdebug-kludge  AUX = ./aux
76  FFLAGS = -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GEANTINC} ${BATCHFLAGS}  AUXFILES = ${AUX}/gpfield.rz ${AUX}/GPAMELA.FFR ${AUX}/TRD_ATT.DAT \
77  LDFLAGS= ${GPLIB} ${CERNLIB}          ${AUX}/GARFIELD.GAR ${AUX}/xe_80_co2_20.gas \
78            ${AUX}/measure_n3_290302.rz ${AUX}/measure_n4_110402_corrected.rz \
79            ${AUX}/resxy_new.rz ${AUX}/INPUTSEED.DAT ${AUX}/readseeds.f \
80  gpamelax11.exe: FFLAGS =  -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GEANTINC} ${INTERFLAGS}          ${AUX}/writeseeds.f ${AUX}/chetc.dat.gz ${AUX}/xsneut.dat.gz \
81  gpamelax11.exe: createdir  ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS}  ${GPXINTSRCS} ${GPXINTOBJS} ${GPXINTDEPENDS}          ${AUX}/external_top_map_n4_150402.rz \
82          @echo Creating $@ .....          ${AUX}/Neut1.dat ${AUX}/Neut2.dat ${AUX}/Neut3.dat
83          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPXINTOBJS} ${LDFLAGS}  
84          @echo Removing object files .....  GARFIELDSRC = ./garfield/src
85          @rm -f ${GPOBJS} ${GPXINTOBJS}  #
86    INTERFLAGS = -DGPAMELA_UNIX -DGPAMELA_TYPE -DGPAMELA_X11 -DGPAMELA_INTER \
87  gpamela.exe:  FFLAGS =  -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GEANTINC} ${BATCHFLAGS}          -DGPAMELA_HIGZ \
88  gpamela.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS}  ${GPDEPENDS} ${GPMAINSRCS} ${GPMAINOBJS} ${GPMAINDEPENDS}          -DGPAMELA_GARFIELD  -DGPAMELA_MANYWIRE  -DGPAMELA_LONGLIST  \
89          @echo Creating $@ .....          -DGPAMELA_BIGMAP
90          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPMAINOBJS} ${LDFLAGS}  BATCHFLAGS = -DGPAMELA_UNIX -DGPAMELA_TYPE -DGPAMELA_GARFIELD  \
91          @echo Removing object files .....          -DGPAMELA_MANYWIRE  -DGPAMELA_LONGLIST  -DGPAMELA_BIGMAP
92          @rm -f ${GPOBJS} ${GPMAINOBJS}  #
93    CC = gcc
94  gpamelax11_deb.exe: FFLAGS =  -fvxt -fno-automatic -Wno-globals ${DEBFLAGS} -I${GPINC} -I${GEANTINC} ${INTERFLAGS}  #FC = g77 -ffortran-bounds-check
95  gpamelax11_deb.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS}  ${GPXINTSRCS} ${GPXINTOBJS} ${GPXINTDEPENDS}  FC = g77
96          @echo Creating $@ .....  DEBFLAGS =  -g # -fdebug-kludge
97          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPXINTOBJS} ${LDFLAGS}  FFLAGS = -fvxt -fno-automatic -Wno-globals -I${GPINC} -I$(GPCALORINC) \
98          @echo Removing object files .....          -I${GEANTINC} ${BATCHFLAGS}
99          @rm -f ${GPOBJS) ${GPXINTOBJS}  LDFLAGS= ${GPLIB} ${CERNLIB} -Xlinker -Map -Xlinker $@.map
100    
101  gpamela_deb.exe: FFLAGS =  -fvxt -fno-automatic -Wno-globals  ${DEBFLAGS} -I${GPINC} -I${GEANTINC} ${BATCHFLAGS}  
102  gpamela_deb.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS}  ${GPMAINSRCS} ${GPMAINOBJS} ${GPMAINDEPENDS}  gpamelax11.exe: FFLAGS =  -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GPCALORINC} -I${GEANTINC} ${INTERFLAGS}
103          @echo Creating $@ .....  gpamelax11.exe: createdir  ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS}  ${GPXINTSRCS} ${GPXINTOBJS} ${GPXINTDEPENDS}
104          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPMAINOBJS} ${LDFLAGS}          @echo Creating $@ .....
105          @echo Removing object files .....          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPXINTOBJS} ${LDFLAGS}
106          @rm -f ${GPOBJS) ${GPMAINOBJS}          @echo Removing object files .....
107            @rm -f ${GPOBJS} ${GPXINTOBJS}
108  depend: ${GPXINTDEPENDS} ${GPMAINDEPENDS} ${GPDEPENDS}  
109    gpamela.exe:  FFLAGS =  -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GPCALORINC} -I${GEANTINC} ${BATCHFLAGS}
110  %.d: %.F  gpamela.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS}  ${GPDEPENDS} ${GPMAINSRCS} ${GPMAINOBJS} ${GPMAINDEPENDS}
111          @echo Creating $@ from $< ;          @echo Creating $@ .....
112          @$(SHELL) -ec '$(FC) -M $(FFLAGS) $< \          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPMAINOBJS} ${LDFLAGS}
113                  | sed '\''s/\($(*F)\)\.o[ :]*/ $(*D)\/\1.o $(*D)\/$(*F)\.d : /g'\'' > $@; \          @echo Removing object files .....
114                  [ -s $@ ] || rm -f $@'          @rm -f ${GPOBJS} ${GPMAINOBJS}
115    
116  .PHONY: distclean clean createdir install  gpamelax11_deb.exe: FFLAGS =  -fvxt -fno-automatic -Wno-globals ${DEBFLAGS} -I${GPINC} -I${GPCALORINC} -I${GEANTINC} ${INTERFLAGS}
117  # Move binaries from the local repository to the official repositories  gpamelax11_deb.exe: LDFLAGS= ${GPLIB} ${CERNLIB} ${DEBFLAGS}
118  install :  gpamelax11_deb.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS}  ${GPXINTSRCS} ${GPXINTOBJS} ${GPXINTDEPENDS}
119          @test -d "$(GPAMELA_BIN)" && \          @echo Creating $@ .....
120          (echo "Now moving executable and auxiliary files to $(GPAMELA_BIN)"; \          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPXINTOBJS} ${LDFLAGS}
121           mv -f $(BIN)/*.exe $(GPAMELA_BIN)/. ; cp -f ${AUXFILES} $(GPAMELA_BIN)/. )          @echo Removing object files .....
122            @rm -f ${GPOBJS) ${GPXINTOBJS}
123  ${GPLIBDIR}/libgarfield-7.a:    
124          @echo Creating  libgarfield-7.a it will take few minutes .....  gpamela_deb.exe: FFLAGS =  -fvxt -fno-automatic -Wno-globals  ${DEBFLAGS} -I${GPINC} -I${GPCALORINC} -I${GEANTINC} ${BATCHFLAGS}
125          @cd  ${GARFIELDSRC}; make -f makefile_linux libgarfield-7.a  gpamelax_deb.exe: LDFLAGS= ${GPLIB} ${CERNLIB} ${DEBFLAGS}
126          @test -d "${GPLIBDIR}" || (echo "Creating ${GPLIBDIR}"; mkdir ${GPLIBDIR})  gpamela_deb.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS}  ${GPMAINSRCS} ${GPMAINOBJS} ${GPMAINDEPENDS}
127          @echo Copyng $(@F) to ${GPLIBDIR}          @echo Creating $@ .....
128          @cp ${GARFIELDSRC}/$(@F)  ${GPLIBDIR}          $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPMAINOBJS} ${LDFLAGS}
129            @echo Removing object files .....
130  # Create binary local repository if non existent          @rm -f ${GPOBJS) ${GPMAINOBJS}
131  createdir :  
132          @test -d "${BIN}" || (echo "Creating ${BIN}"; mkdir ${BIN})  depend: ${GPXINTDEPENDS} ${GPMAINDEPENDS} ${GPDEPENDS}
133    
134  distclean: clean  %.d: %.F
135          @echo Removing garfield sources, objects and libraries          @echo Creating $@ from $< ;
136          @cd  ${GARFIELDSRC}; rm -f *.f *.o libgarfield-7.a          @$(SHELL) -ec '$(FC) -M $(FFLAGS) $< \
137          @rm -f ${GPLIBDIR}/libgarfield-7.a                  | sed '\''s/\($(*F)\)\.o[ :]*/ $(*D)\/\1.o $(*D)\/$(*F)\.d : /g'\'' > $@; \
138          @rm -fr ${GPLIBDIR}                  [ -s $@ ] || rm -f $@'
139          @echo Removing executables .....  
140          @rm -fr ${BIN}  .PHONY: distclean clean createdir install
141    # Move binaries from the local repository to the official repositories
142    install :
143            @test -d "$(GPAMELA_BIN)" && \
144  clean:          (echo "Now moving executable and auxiliary files to $(GPAMELA_BIN)"; \
145          @echo Removing object files .....           mv -f $(BIN)/*.exe $(GPAMELA_BIN)/. ; cp  ${AUXFILES} $(GPAMELA_BIN)/.;\
146          @rm -f ${GPOBJS}        ${GPMAINOBJS} ${GPXINTOBJS}          echo "Now unzipping the GCALOR cross section data files"; \
147          @echo Removing dependencies files .....          gzip -dv $(GPAMELA_BIN)/xsneut.dat.gz $(GPAMELA_BIN)/chetc.dat.gz)
148          @rm -f ${GPDEPENDS} ${GPMAINDEPENDS} ${GPXINTDEPENDS}  
149    ${GPLIBDIR}/libgarfield-7.a:  
150  include ${GPDEPENDS}          @echo Creating  libgarfield-7.a it will take few minutes .....
151            @cd  ${GARFIELDSRC}; make -f makefile_linux libgarfield-7.a
152            @test -d "${GPLIBDIR}" || (echo "Creating ${GPLIBDIR}"; mkdir ${GPLIBDIR})
153            @echo Copyng $(@F) to ${GPLIBDIR}
154            @cp ${GARFIELDSRC}/$(@F)  ${GPLIBDIR}
155    
156    # Create binary local repository if non existent
157    createdir :
158            @test -d "${BIN}" || (echo "Creating ${BIN}"; mkdir ${BIN})
159    
160    distclean: clean
161            @echo Removing garfield sources, objects and libraries
162            @cd  ${GARFIELDSRC}; rm -f *.f *.o libgarfield-7.a
163            @rm -f ${GPLIBDIR}/libgarfield-7.a
164            @rm -fr ${GPLIBDIR}
165            @echo Removing executables .....
166            @rm -fr ${BIN}
167    
168    
169    
170    clean:
171            @echo Removing object files .....
172            @rm -f ${GPOBJS}        ${GPMAINOBJS} ${GPXINTOBJS}
173            @echo Removing dependencies files .....
174            @rm -f ${GPDEPENDS} ${GPMAINDEPENDS} ${GPXINTDEPENDS}
175    
176    include ${GPDEPENDS}
177    
178    

Legend:
Removed from v.3.7  
changed lines
  Added in v.3.25

  ViewVC Help
Powered by ViewVC 1.1.23