1 | #============================================================
|
---|
2 | # Makefile to compile modified 5.20 version of CORSIKA.
|
---|
3 | #
|
---|
4 | # Copyright (c) J C Gonzalez, 1998
|
---|
5 | #============================================================
|
---|
6 |
|
---|
7 | DESTDIR = .
|
---|
8 |
|
---|
9 | F77 = f77
|
---|
10 | CC = cc
|
---|
11 | CERNDIR = CERN
|
---|
12 | ADDFLAGS =
|
---|
13 |
|
---|
14 | EXE_VERSION = c520
|
---|
15 |
|
---|
16 | ###
|
---|
17 | # compiler & linker options section
|
---|
18 | ###
|
---|
19 |
|
---|
20 | # machine dependencies
|
---|
21 | SYSTEM = GENERIC
|
---|
22 |
|
---|
23 | ## generic (alpha)
|
---|
24 | GENERIC_CFLAGS = -I. -I/usr/include -DJC_UNDERSCORES ${ADDFLAGS}
|
---|
25 | GENERIC_FFLAGS = ${GENERIC_CFLAGS}
|
---|
26 | GENERIC_EXE = ${EXE_VERSION}-generic
|
---|
27 | GENERIC_LIBS = -lm -lc
|
---|
28 | GENERIC_CC = cc
|
---|
29 | GENERIC_F77 = f77
|
---|
30 |
|
---|
31 | ## osf (alpha)
|
---|
32 | OSF_CFLAGS = -I. -I/usr/include -DJC_UNDERSCORES ${ADDFLAGS}
|
---|
33 | OSF_FFLAGS = ${OSF_CFLAGS}
|
---|
34 | OSF_EXE = ${EXE_VERSION}-osf
|
---|
35 | OSF_LIBS = -lm -lc
|
---|
36 | OSF_CC = cc
|
---|
37 | OSF_F77 = f77
|
---|
38 |
|
---|
39 | ## linux
|
---|
40 | LINUX_CFLAGS = -I. -I/usr/include -funderscoring -DJC_UNDERSCORES \
|
---|
41 | -m486 -DCPU=686 ${ADDFLAGS}
|
---|
42 | LINUX_FFLAGS = ${LINUX_CFLAGS}
|
---|
43 | LINUX_EXE = ${EXE_VERSION}-linux
|
---|
44 | LINUX_LIBS = -lm -lc
|
---|
45 | LINUX_CC = gcc
|
---|
46 | LINUX_F77 = g77
|
---|
47 |
|
---|
48 | ## aix (ibm rs6000)
|
---|
49 | AIX_CFLAGS = -I. -I/usr/include -DJC_NO_UNDERSCORES ${ADDFLAGS}
|
---|
50 | AIX_FFLAGS = ${AIX_CFLAGS}
|
---|
51 | AIX_EXE = ${EXE_VERSION}-aix
|
---|
52 | AIX_LIBS = -lm -lc -lbsd
|
---|
53 | AIX_CC = cc
|
---|
54 | AIX_F77 = xlf
|
---|
55 |
|
---|
56 | # choose this machine values
|
---|
57 | F77 = ${${SYSTEM}_F77}
|
---|
58 | CC = ${${SYSTEM}_CC}
|
---|
59 | CFLAGS = ${${SYSTEM}_CFLAGS}
|
---|
60 | FFLAGS = ${${SYSTEM}_FFLAGS}
|
---|
61 | LIBS = ${${SYSTEM}_LIBS}
|
---|
62 |
|
---|
63 | ###
|
---|
64 | # miscelanea
|
---|
65 | ###
|
---|
66 |
|
---|
67 | CERNDIR = CERN
|
---|
68 |
|
---|
69 | ###
|
---|
70 | # files section
|
---|
71 | ###
|
---|
72 |
|
---|
73 | HEADERS =
|
---|
74 |
|
---|
75 | FSRCS = \
|
---|
76 | GHEISHA.f VENUS.f addang.f addani.f age.f amoeba.f \
|
---|
77 | amotry.f annih.f ausgab.f ausgb2.f avage.f avept.f \
|
---|
78 | bhabha.f block1.f box2.f box3.f box60.f box61.f \
|
---|
79 | box62.f box63.f box65.f box66.f box67.f box68.f \
|
---|
80 | box69.f box70.f box71.f box72.f box73.f box74.f \
|
---|
81 | brems.f cerenkov.f cghei.f cghini.f cghsig.f \
|
---|
82 | chisq.f compt.f coorin.f datac.f decay1.f decay6.f \
|
---|
83 | difrac.f dpfunc.f egs4.f egs4bd.f egsini.f electr.f \
|
---|
84 | em.f etadec.f flpsor.f fstack.f gam.f garndm.f \
|
---|
85 | gbrsgm.f gprsgm.f granor.f grndm.f hatch.f hdpm.f \
|
---|
86 | heigh.f hmeson.f howfar.f ininkg.f inprm.f isobar.f \
|
---|
87 | istack.f jadach.f kdecay.f leaddf.f ledeny.f \
|
---|
88 | lepacx.f longft.f lowup.f lpm.f main.f mitage.f \
|
---|
89 | mmol4.f mmolie.f moller.f mpoiss.f mpprop.f mscat.f \
|
---|
90 | mubrem.f mucoul.f mudecy.f mupair.f muprpr.f \
|
---|
91 | mutrac.f nihila.f nkg.f nsd.f nucint.f outend.f \
|
---|
92 | output.f pair.f pamaf.f parnum.f parrap.f pcl.f \
|
---|
93 | photo.f photon.f pi0dec.f pigen.f pigen1.f pigen2.f \
|
---|
94 | pparam.f prange.f prtime.f ptram.f ptran.f ptrans.f \
|
---|
95 | rangen.f rannor.f resdec.f rhof.f rmmaq.f rmmar.f \
|
---|
96 | rnegbi.f sdpm.f selcor.f shower.f single.f sobseq.f \
|
---|
97 | staend.f stankg.f start.f strdec.f tarint.f thick.f \
|
---|
98 | tobuf.f tstack.f tstend.f tstini.f tstout.f ucopy.f \
|
---|
99 | update.f uphi.f utqsea.f utqval.f vapor.f vendat.f \
|
---|
100 | venini.f venlnk.f vhmeso.f vstore.f vzero.f
|
---|
101 |
|
---|
102 | CSRCS = \
|
---|
103 | jcio.c jcdate.c
|
---|
104 |
|
---|
105 | ALLOBJS = ${FSRCS:.f=.o} ${CSRCS:.c=.o}
|
---|
106 |
|
---|
107 | PROGRAM = ${${SYSTEM}_EXE}
|
---|
108 |
|
---|
109 | help:
|
---|
110 | @echo ''
|
---|
111 | @echo 'Usage::'
|
---|
112 | @echo ''
|
---|
113 | @echo ' make help shows this help or'
|
---|
114 | @echo ' make clean cleans-up garbage or'
|
---|
115 | @echo ' make all [ SYSTEM = { OSF | LINUX | AIX | GENERIC} ]'
|
---|
116 | @echo ' compiles with pre-defined flags for'
|
---|
117 | @echo ' OSF, Linux or AIX flavour of Unix'
|
---|
118 | @echo ''
|
---|
119 | @echo 'Additionally, you can add to your command line ADDFLAGS=<flags>'
|
---|
120 | @echo 'to include any new flag you want.'
|
---|
121 | @echo ''
|
---|
122 | @echo 'In case of problems, please contact to <gonzalez@mppmu.mpg.de>'
|
---|
123 | @echo ''
|
---|
124 |
|
---|
125 | all: message ${PROGRAM}
|
---|
126 |
|
---|
127 | message:
|
---|
128 | @echo "============================================================"
|
---|
129 | @echo " Compilation of CORSIKA ("${EXE_VERSION}")"
|
---|
130 | @echo " Target machine => `uname -a`"
|
---|
131 | @echo " System choosed => "${SYSTEM}
|
---|
132 | @echo " Date: `date`"
|
---|
133 | @echo "============================================================"
|
---|
134 | @echo ''
|
---|
135 |
|
---|
136 | ${PROGRAM}: ${ALLOBJS}
|
---|
137 | @echo -n " . . . and linking -> "${PROGRAM}" . . . "
|
---|
138 | $(F77) ${FFLAGS} -o ${PROGRAM} ${ALLOBJS} ${LIBS} ${XLIB}
|
---|
139 | @echo "done."
|
---|
140 |
|
---|
141 | .f.o:
|
---|
142 | @echo "Compiling "$<" . . ."
|
---|
143 | $(F77) -c $(FFLAGS) $< -o $@
|
---|
144 |
|
---|
145 | .c.o:
|
---|
146 | @echo "Compiling "$<" . . ."
|
---|
147 | $(CC) -c $(CFLAGS) $< -o $@
|
---|
148 |
|
---|
149 | script:
|
---|
150 | @sh ./c-script.sh
|
---|
151 |
|
---|
152 | clean:
|
---|
153 | @echo "Cleaning . . ."
|
---|
154 | @rm *.o *~ core *.BAK > /dev/null 2>&1 || echo "...already clean."
|
---|