/[PAMELA software]/gpamela/Makefile
ViewVC logotype

Diff of /gpamela/Makefile

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

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

Legend:
Removed from v.3.1.1.1  
changed lines
  Added in v.3.26

  ViewVC Help
Powered by ViewVC 1.1.23