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