/[PAMELA software]/gpamela/Makefile
ViewVC logotype

Contents of /gpamela/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3.7 - (show annotations) (download)
Thu Jul 21 13:23:43 2005 UTC (19 years, 4 months ago) by pamela
Branch: MAIN
Changes since 3.6: +1 -0 lines
Prova

1 #
2 # Steering Makefile to create gpamelaX11 and gpamela executable
3 # First of all define the src files. One for each subdirectory
4 #
5 # some addition
6 GPAMELASRCS= gpamela/ffuser.F gpamela/gdraws.F gpamela/gpadigi.F \
7 gpamela/gpal.F gpamela/gpdat.F \
8 gpamela/gpffr.F gpamela/gpfil.F gpamela/gpgaus.F \
9 gpamela/gpgeo.F gpamela/gphbk.F \
10 gpamela/gphit.F gpamela/gplook.F \
11 gpamela/gpmapa.F gpamela/gpmat.F gpamela/gpmed.F \
12 gpamela/gpn2g.F gpamela/gpnhit.F gpamela/gppama.F \
13 gpamela/gprhit.F gpamela/gprsht.F \
14 gpamela/gpsed.F gpamela/gpsptm.F \
15 gpamela/gpudat.F gpamela/gpudig.F gpamela/gpuffr.F \
16 gpamela/gpufil.F gpamela/gpugeo.F gpamela/gpuhbk.F \
17 gpamela/gpuhit.F gpamela/gpuini.F \
18 gpamela/gpukin.F gpamela/gpulas.F \
19 gpamela/gpumat.F gpamela/gpumed.F gpamela/gpuout.F \
20 gpamela/gpused.F gpamela/gpustep.F gpamela/gputra.F \
21 gpamela/gputre.F gpamela/gudigi.F \
22 gpamela/guhadr.F gpamela/gukine.F gpamela/guout.F \
23 gpamela/guphad.F gpamela/gustep.F \
24 gpamela/gutrak.F gpamela/gutrev.F \
25 gpamela/gviewyz.F gpamela/n2g.F \
26 gpamela/uginit.F gpamela/uglast.F
27 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 GPFIELDSRCS = gpfield/flin3.F gpfield/gufld.F
33 GPGARSRCS = gpgar/gpgacl.F gpgar/gpgapart.F gpgar/gpgarin.F \
34 gpgar/gpgarsel.F gpgar/gptogar.F gpgar/grinit.F
35 GPHYSSRCSRCS = gphys/gfluct.F
36 GPMAINSRCS = gpmain/gpmain.F
37 GPSPESRCS = gpspe/gpcp.F gpspe/gpdspe.F gpspe/gpfe.F \
38 gpspe/gpkap.F gpspe/gpmaspe.F gpspe/gproa.F \
39 gpspe/gpsitr.F gpspe/gpspema.F gpspe/gpspev.F gpspe/gpuspe.F
40 GPTOFSRCS = gptof/gpdtof.F gptof/gpscin.F gptof/gpscint.F \
41 gptof/gptofv.F gptof/gputof.F
42 GPTRDSRCS = gptrd/gpdtrd.F gptrd/gptrad.F gptrd/gptrdv.F \
43 gptrd/gputrd.F gptrd/gpxe.F gptrd/gpxtr.F \
44 gptrd/npoiss.F gptrd/xescape.F gptrd/xtrinteg.F \
45 gptrd/xtrinter.F gptrd/xtryield.F
46 GPXINTSRCS = gpxint/gxint.F gpxint/qnext.F
47 #
48 GPSRCS = $(GPAMELASRCS) $(GPCALSRCS) $(GPCASSRCS) $(GPCATSRCS) $(GPFIELDSRCS) $(GPGARSRCS) $(GPHYSSRCS) \
49 $(GPSPESRCS) $(GPTOFSRCS) $(GPTRDSRCS)
50 GPOBJS =$(addsuffix .o,$(basename ${GPSRCS}) )
51 GPDEPENDS =$(GPOBJS:.o=.d)
52 GPMAINOBJS =$(addsuffix .o,$(basename ${GPMAINSRCS}) )
53 GPMAINDEPENDS =$(GPMAINOBJS:.o=.d)
54 GPXINTOBJS =$(addsuffix .o,$(basename ${GPXINTSRCS}) )
55 GPXINTDEPENDS =$(GPXINTOBJS:.o=.d)
56 #
57 GEANTINC = gcdes
58 GPINC = gpcdes
59 CERNLIB = `cernlib geant,genlib,pawlib,graflib/X11,packlib,mathlib`
60 GPLIBDIR = ./lib
61 GPLIB = ${GPLIBDIR}/libgarfield-7.a
62 #
63 BIN = ./bin
64 AUX = ./aux
65 AUXFILES = ${AUX}/gpfield.rz ${AUX}/GPAMELA.FFR ${AUX}/TRD_ATT.DAT ${AUX}/GARFIELD.GAR \
66 $(AUX)/xe_80_co2_20.gas
67 GARFIELDSRC = ./garfield/src
68 #
69 INTERFLAGS = -DGPAMELA_UNIX -DGPAMELA_TYPE -DGPAMELA_X11 -DGPAMELA_INTER -DGPAMELA_HIGZ \
70 -DGPAMELA_GARFIELD -DGPAMELA_MANYWIRE -DGPAMELA_LONGLIST -DGPAMELA_BIGMAP
71 BATCHFLAGS = -DGPAMELA_UNIX -DGPAMELA_TYPE -DGPAMELA_GARFIELD -DGPAMELA_MANYWIRE -DGPAMELA_LONGLIST -DGPAMELA_BIGMAP
72 #
73 CC = gcc
74 FC = g77
75 DEBFLAGS = -g -fdebug-kludge
76 FFLAGS = -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GEANTINC} ${BATCHFLAGS}
77 LDFLAGS= ${GPLIB} ${CERNLIB}
78
79
80 gpamelax11.exe: FFLAGS = -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GEANTINC} ${INTERFLAGS}
81 gpamelax11.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS} ${GPXINTSRCS} ${GPXINTOBJS} ${GPXINTDEPENDS}
82 @echo Creating $@ .....
83 $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPXINTOBJS} ${LDFLAGS}
84 @echo Removing object files .....
85 @rm -f ${GPOBJS} ${GPXINTOBJS}
86
87 gpamela.exe: FFLAGS = -fvxt -fno-automatic -Wno-globals -I${GPINC} -I${GEANTINC} ${BATCHFLAGS}
88 gpamela.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS} ${GPMAINSRCS} ${GPMAINOBJS} ${GPMAINDEPENDS}
89 @echo Creating $@ .....
90 $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPMAINOBJS} ${LDFLAGS}
91 @echo Removing object files .....
92 @rm -f ${GPOBJS} ${GPMAINOBJS}
93
94 gpamelax11_deb.exe: FFLAGS = -fvxt -fno-automatic -Wno-globals ${DEBFLAGS} -I${GPINC} -I${GEANTINC} ${INTERFLAGS}
95 gpamelax11_deb.exe: createdir ${GPLIBDIR}/libgarfield-7.a ${GPSRCS} ${GPOBJS} ${GPDEPENDS} ${GPXINTSRCS} ${GPXINTOBJS} ${GPXINTDEPENDS}
96 @echo Creating $@ .....
97 $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPXINTOBJS} ${LDFLAGS}
98 @echo Removing object files .....
99 @rm -f ${GPOBJS) ${GPXINTOBJS}
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}
103 @echo Creating $@ .....
104 $(FC) -o ${BIN}/$@ ${GPOBJS} ${GPMAINOBJS} ${LDFLAGS}
105 @echo Removing object files .....
106 @rm -f ${GPOBJS) ${GPMAINOBJS}
107
108 depend: ${GPXINTDEPENDS} ${GPMAINDEPENDS} ${GPDEPENDS}
109
110 %.d: %.F
111 @echo Creating $@ from $< ;
112 @$(SHELL) -ec '$(FC) -M $(FFLAGS) $< \
113 | sed '\''s/\($(*F)\)\.o[ :]*/ $(*D)\/\1.o $(*D)\/$(*F)\.d : /g'\'' > $@; \
114 [ -s $@ ] || rm -f $@'
115
116 .PHONY: distclean clean createdir install
117 # Move binaries from the local repository to the official repositories
118 install :
119 @test -d "$(GPAMELA_BIN)" && \
120 (echo "Now moving executable and auxiliary files to $(GPAMELA_BIN)"; \
121 mv -f $(BIN)/*.exe $(GPAMELA_BIN)/. ; cp -f ${AUXFILES} $(GPAMELA_BIN)/. )
122
123 ${GPLIBDIR}/libgarfield-7.a:
124 @echo Creating libgarfield-7.a it will take few minutes .....
125 @cd ${GARFIELDSRC}; make -f makefile_linux libgarfield-7.a
126 @test -d "${GPLIBDIR}" || (echo "Creating ${GPLIBDIR}"; mkdir ${GPLIBDIR})
127 @echo Copyng $(@F) to ${GPLIBDIR}
128 @cp ${GARFIELDSRC}/$(@F) ${GPLIBDIR}
129
130 # Create binary local repository if non existent
131 createdir :
132 @test -d "${BIN}" || (echo "Creating ${BIN}"; mkdir ${BIN})
133
134 distclean: clean
135 @echo Removing garfield sources, objects and libraries
136 @cd ${GARFIELDSRC}; rm -f *.f *.o libgarfield-7.a
137 @rm -f ${GPLIBDIR}/libgarfield-7.a
138 @rm -fr ${GPLIBDIR}
139 @echo Removing executables .....
140 @rm -fr ${BIN}
141
142
143
144 clean:
145 @echo Removing object files .....
146 @rm -f ${GPOBJS} ${GPMAINOBJS} ${GPXINTOBJS}
147 @echo Removing dependencies files .....
148 @rm -f ${GPDEPENDS} ${GPMAINDEPENDS} ${GPXINTDEPENDS}
149
150 include ${GPDEPENDS}
151
152

  ViewVC Help
Powered by ViewVC 1.1.23