1 | #============================================================
|
---|
2 | # Makefile to compile modified 5.20 version of CORSIKA.
|
---|
3 | #
|
---|
4 | # Copyright (c) J C Gonzalez, 1998
|
---|
5 | #============================================================
|
---|
6 | #
|
---|
7 | # Modified by C. Bigongiari 2001-11-06 to handle two different
|
---|
8 | # codes for Linux and Alpha.
|
---|
9 | # Now it compiles/link Corsika version 6.005
|
---|
10 | #
|
---|
11 | #==============================================================
|
---|
12 |
|
---|
13 | DESTDIR = .
|
---|
14 |
|
---|
15 | F77 = f77
|
---|
16 | CC = cc
|
---|
17 | CERNDIR = CERN
|
---|
18 | ADDFLAGS =
|
---|
19 |
|
---|
20 | EXE_VERSION = c614nx
|
---|
21 |
|
---|
22 | ###
|
---|
23 | # compiler & linker options section
|
---|
24 | ###
|
---|
25 |
|
---|
26 | # machine dependencies
|
---|
27 | SYSTEM = GENERIC
|
---|
28 |
|
---|
29 | ## generic (alpha)
|
---|
30 | GENERIC_CFLAGS = -I. -I/usr/include -DJC_UNDERSCORES ${ADDFLAGS}
|
---|
31 | GENERIC_FFLAGS = ${GENERIC_CFLAGS}
|
---|
32 | GENERIC_EXE = ${EXE_VERSION}-generic
|
---|
33 | GENERIC_LIBS = -lm -lc
|
---|
34 | GENERIC_CC = cc
|
---|
35 | GENERIC_F77 = f77
|
---|
36 | GENERIC_SRC = c614nx-osf.f
|
---|
37 |
|
---|
38 | ## osf (alpha)
|
---|
39 | OSF_CFLAGS = -I. -I/usr/include -DJC_UNDERSCORES ${ADDFLAGS}
|
---|
40 | OSF_FFLAGS = ${OSF_CFLAGS}
|
---|
41 | OSF_EXE = ${EXE_VERSION}-osf
|
---|
42 | OSF_LIBS = -lm -lc
|
---|
43 | OSF_CC = cc
|
---|
44 | OSF_F77 = f77
|
---|
45 | OSF_SRC = c614nx-osf.f
|
---|
46 |
|
---|
47 | ## linux
|
---|
48 | LINUX_CFLAGS = -I. -I/usr/include -funderscoring -DJC_UNDERSCORES \
|
---|
49 | -m486 -DCPU=686 ${ADDFLAGS}
|
---|
50 | LINUX_FFLAGS = ${LINUX_CFLAGS}
|
---|
51 | LINUX_EXE = ${EXE_VERSION}-linux
|
---|
52 | LINUX_LIBS = -lm -lc
|
---|
53 | LINUX_CC = gcc
|
---|
54 | LINUX_F77 = g77
|
---|
55 | LINUX_SRC = c614nx-linux.f
|
---|
56 |
|
---|
57 | # choose this machine values
|
---|
58 | F77 = ${${SYSTEM}_F77}
|
---|
59 | CC = ${${SYSTEM}_CC}
|
---|
60 | CFLAGS = ${${SYSTEM}_CFLAGS}
|
---|
61 | FFLAGS = ${${SYSTEM}_FFLAGS}
|
---|
62 | LIBS = ${${SYSTEM}_LIBS}
|
---|
63 | SRC = ${${SYSTEM}_SRC}
|
---|
64 |
|
---|
65 | ###
|
---|
66 | # miscelanea
|
---|
67 | ###
|
---|
68 |
|
---|
69 | CERNDIR = CERN
|
---|
70 |
|
---|
71 | ###
|
---|
72 | # files section
|
---|
73 | ###
|
---|
74 |
|
---|
75 | HEADERS =
|
---|
76 |
|
---|
77 | FSRCS = \
|
---|
78 | gheisha600.f venus.f ${SRC}
|
---|
79 |
|
---|
80 | CSRCS = \
|
---|
81 | jcio.c jcdate.c timer.c atmo.c
|
---|
82 |
|
---|
83 | ALLOBJS = ${FSRCS:.f=.o} ${CSRCS:.c=.o}
|
---|
84 |
|
---|
85 | PROGRAM = ${${SYSTEM}_EXE}
|
---|
86 |
|
---|
87 | help:
|
---|
88 | @echo ''
|
---|
89 | @echo 'Usage::'
|
---|
90 | @echo ''
|
---|
91 | @echo ' make help shows this help or'
|
---|
92 | @echo ' make clean cleans-up garbage or'
|
---|
93 | @echo ' make all [ SYSTEM = { OSF | LINUX | GENERIC} ]'
|
---|
94 | @echo ' compiles with pre-defined flags for'
|
---|
95 | @echo ' OSF, Linux of Unix'
|
---|
96 | @echo ''
|
---|
97 | @echo 'Additionally, you can add to your command line ADDFLAGS=<flags>'
|
---|
98 | @echo 'to include any new flag you want.'
|
---|
99 | @echo ''
|
---|
100 | @echo 'In case of problems, please contact to <gonzalez@mppmu.mpg.de>'
|
---|
101 | @echo ''
|
---|
102 |
|
---|
103 | all: message ${PROGRAM}
|
---|
104 |
|
---|
105 | message:
|
---|
106 | @echo "============================================================"
|
---|
107 | @echo " Compilation of CORSIKA ("${EXE_VERSION}")"
|
---|
108 | @echo " Target machine => `uname -a`"
|
---|
109 | @echo " System choosen => "${SYSTEM}
|
---|
110 | @echo " Date: `date`"
|
---|
111 | @echo "============================================================"
|
---|
112 | @echo ''
|
---|
113 |
|
---|
114 | ${PROGRAM}: ${ALLOBJS}
|
---|
115 | @echo -n " . . . and linking -> "${PROGRAM}" . . . "
|
---|
116 | $(F77) ${FFLAGS} -o ${PROGRAM} ${ALLOBJS} ${LIBS} ${XLIB}
|
---|
117 | @echo "done."
|
---|
118 |
|
---|
119 | .f.o:
|
---|
120 | @echo "Compiling "$<" . . ."
|
---|
121 | $(F77) -c $(FFLAGS) $< -o $@
|
---|
122 |
|
---|
123 | .c.o:
|
---|
124 | @echo "Compiling "$<" . . ."
|
---|
125 | $(CC) -c $(CFLAGS) $< -o $@
|
---|
126 |
|
---|
127 | clean:
|
---|
128 | @echo "Cleaning . . ."
|
---|
129 | @rm *.o *~ core *.BAK > /dev/null 2>&1 || echo "...already clean."
|
---|
130 |
|
---|
131 |
|
---|
132 |
|
---|
133 |
|
---|
134 |
|
---|
135 |
|
---|
136 |
|
---|
137 |
|
---|
138 |
|
---|
139 |
|
---|
140 |
|
---|
141 |
|
---|
142 |
|
---|
143 |
|
---|
144 |
|
---|
145 |
|
---|
146 |
|
---|
147 |
|
---|
148 |
|
---|