/[PAMELA software]/gpamela/Makefile
ViewVC logotype

Diff of /gpamela/Makefile

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

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

Legend:
Removed from v.3.1  
changed lines
  Added in v.3.21

  ViewVC Help
Powered by ViewVC 1.1.23