/[PAMELA software]/gpamela/Makefile
ViewVC logotype

Diff of /gpamela/Makefile

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

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

Legend:
Removed from v.3.11  
changed lines
  Added in v.3.22

  ViewVC Help
Powered by ViewVC 1.1.23