| 1 |
# Unix makefile: see README. |
| 2 |
# For C++, first "make hadd". |
| 3 |
# If your compiler does not recognize ANSI C, add |
| 4 |
# -DKR_headers |
| 5 |
# to the CFLAGS = line below. |
| 6 |
# On Sun and other BSD systems that do not provide an ANSI sprintf, add |
| 7 |
# -DUSE_STRLEN |
| 8 |
# to the CFLAGS = line below. |
| 9 |
# On Linux systems, add |
| 10 |
# -DNON_UNIX_STDIO |
| 11 |
# to the CFLAGS = line below. For libf2c.so under Linux, also add |
| 12 |
# -fPIC |
| 13 |
# to the CFLAGS = line below. |
| 14 |
|
| 15 |
.SUFFIXES: .c .o |
| 16 |
CC = cc |
| 17 |
SHELL = /bin/sh |
| 18 |
|
| 19 |
ifeq (10.4,$(OS)) |
| 20 |
CC=gcc-4.0 |
| 21 |
LIST_ARCH=-arch ppc -arch i386 -arch ppc64 -arch x86_64 |
| 22 |
SDK=/Developer/SDKs/MacOSX10.4u.sdk |
| 23 |
endif |
| 24 |
ifeq (10.5,$(OS)) |
| 25 |
LIST_ARCH=-arch ppc -arch i386 -arch x86_64 -arch ppc64 |
| 26 |
SDK=/Developer/SDKs/MacOSX10.5.sdk |
| 27 |
endif |
| 28 |
ifeq (10.6,$(OS)) |
| 29 |
LIST_ARCH= -arch i386 -arch x86_64 |
| 30 |
SDK=/Developer/SDKs/MacOSX10.6.sdk |
| 31 |
endif |
| 32 |
|
| 33 |
CFLAGS = -O -isysroot $(SDK) $(LIST_ARCH) -mmacosx-version-min=$(OS) -DNO_My_ctype |
| 34 |
LDFLAGS=-Wl,-syslibroot,$(SDK) $(LIST_ARCH) |
| 35 |
AR=libtool -static -o |
| 36 |
LIBDIR=/usr/local/lib |
| 37 |
# compile, then strip unnecessary symbols |
| 38 |
.c.o: |
| 39 |
$(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c |
| 40 |
## Under Solaris (and other systems that do not understand ld -x), |
| 41 |
## omit -x in the ld line above. |
| 42 |
## If your system does not have the ld command, comment out |
| 43 |
## or remove both the ld and mv lines above. |
| 44 |
|
| 45 |
MISC = f77vers.o i77vers.o main.o s_rnge.o abort_.o exit_.o getarg_.o iargc_.o\ |
| 46 |
getenv_.o signal_.o s_stop.o s_paus.o system_.o cabs.o\ |
| 47 |
derf_.o derfc_.o erf_.o erfc_.o sig_die.o uninit.o |
| 48 |
POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o |
| 49 |
CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o |
| 50 |
DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o |
| 51 |
REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\ |
| 52 |
r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\ |
| 53 |
r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\ |
| 54 |
r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o |
| 55 |
DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\ |
| 56 |
d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\ |
| 57 |
d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\ |
| 58 |
d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\ |
| 59 |
d_sqrt.o d_tan.o d_tanh.o |
| 60 |
INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o\ |
| 61 |
lbitbits.o lbitshft.o |
| 62 |
HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o |
| 63 |
CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o |
| 64 |
EFL = ef1asc_.o ef1cmc_.o |
| 65 |
CHAR = f77_aloc.o s_cat.o s_cmp.o s_copy.o |
| 66 |
I77 = backspac.o close.o dfe.o dolio.o due.o endfile.o err.o\ |
| 67 |
fmt.o fmtlib.o ftell_.o iio.o ilnw.o inquire.o lread.o lwrite.o\ |
| 68 |
open.o rdfmt.o rewind.o rsfe.o rsli.o rsne.o sfe.o sue.o\ |
| 69 |
typesize.o uio.o util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o |
| 70 |
QINT = pow_qq.o qbitbits.o qbitshft.o ftell64_.o |
| 71 |
TIME = dtime_.o etime_.o |
| 72 |
|
| 73 |
# If you get an error compiling dtime_.c or etime_.c, try adding |
| 74 |
# -DUSE_CLOCK to the CFLAGS assignment above; if that does not work, |
| 75 |
# omit $(TIME) from OFILES = assignment below. |
| 76 |
|
| 77 |
# To get signed zeros in write statements on IEEE-arithmetic systems, |
| 78 |
# add -DSIGNED_ZEROS to the CFLAGS assignment below and add signbit.o |
| 79 |
# to the end of the OFILES = assignment below. |
| 80 |
|
| 81 |
# For INTEGER*8 support (which requires system-dependent adjustments to |
| 82 |
# f2c.h), add $(QINT) to the OFILES = assignment below... |
| 83 |
|
| 84 |
OFILES = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ |
| 85 |
$(HALF) $(CMP) $(EFL) $(CHAR) $(I77) $(TIME) |
| 86 |
|
| 87 |
all: f2c.h signal1.h sysdep1.h libf2c.a |
| 88 |
|
| 89 |
libf2c.a: $(OFILES) |
| 90 |
libtool -static -o libf2c.a $(OFILES) |
| 91 |
|
| 92 |
## Shared-library variant: the following rule works on Linux |
| 93 |
## systems. Details are system-dependent. Under Linux, -fPIC |
| 94 |
## must appear in the CFLAGS assignment when making libf2c.so. |
| 95 |
## Under Solaris, use -Kpic in CFLAGS and use "ld -G" instead |
| 96 |
## of "cc -shared". |
| 97 |
|
| 98 |
libf2c.so: $(OFILES) |
| 99 |
libtool -dynamic -o libf2c.dylib $(OFILES) |
| 100 |
# cc -shared -o libf2c.so $(OFILES) |
| 101 |
|
| 102 |
### If your system lacks ranlib, you don't need it; see README. |
| 103 |
|
| 104 |
f77vers.o: f77vers.c |
| 105 |
$(CC) -c f77vers.c |
| 106 |
|
| 107 |
i77vers.o: i77vers.c |
| 108 |
$(CC) -c i77vers.c |
| 109 |
|
| 110 |
# To get an "f2c.h" for use with "f2c -C++", first "make hadd" |
| 111 |
hadd: f2c.h0 f2ch.add |
| 112 |
cat f2c.h0 f2ch.add >f2c.h |
| 113 |
|
| 114 |
# For use with "f2c" and "f2c -A": |
| 115 |
f2c.h: f2c.h0 |
| 116 |
cp f2c.h0 f2c.h |
| 117 |
|
| 118 |
# You may need to adjust signal1.h and sysdep1.h suitably for your system... |
| 119 |
signal1.h: signal1.h0 |
| 120 |
cp signal1.h0 signal1.h |
| 121 |
|
| 122 |
sysdep1.h: sysdep1.h0 |
| 123 |
cp sysdep1.h0 sysdep1.h |
| 124 |
|
| 125 |
# If your system lacks onexit() and you are not using an |
| 126 |
# ANSI C compiler, then you should uncomment the following |
| 127 |
# two lines (for compiling main.o): |
| 128 |
#main.o: main.c |
| 129 |
# $(CC) -c -DNO_ONEXIT -DSkip_f2c_Undefs main.c |
| 130 |
# On at least some Sun systems, it is more appropriate to |
| 131 |
# uncomment the following two lines: |
| 132 |
#main.o: main.c |
| 133 |
# $(CC) -c -Donexit=on_exit -DSkip_f2c_Undefs main.c |
| 134 |
|
| 135 |
install: libf2c.a |
| 136 |
cp -p libf2c.a $(LIBDIR) |
| 137 |
#-ranlib $(LIBDIR)/libf2c.a |
| 138 |
|
| 139 |
clean: |
| 140 |
rm -f libf2c.a *.o arith.h signal1.h sysdep1.h |
| 141 |
|
| 142 |
backspac.o: fio.h |
| 143 |
close.o: fio.h |
| 144 |
dfe.o: fio.h |
| 145 |
dfe.o: fmt.h |
| 146 |
due.o: fio.h |
| 147 |
endfile.o: fio.h rawio.h |
| 148 |
err.o: fio.h rawio.h |
| 149 |
fmt.o: fio.h |
| 150 |
fmt.o: fmt.h |
| 151 |
iio.o: fio.h |
| 152 |
iio.o: fmt.h |
| 153 |
ilnw.o: fio.h |
| 154 |
ilnw.o: lio.h |
| 155 |
inquire.o: fio.h |
| 156 |
lread.o: fio.h |
| 157 |
lread.o: fmt.h |
| 158 |
lread.o: lio.h |
| 159 |
lread.o: fp.h |
| 160 |
lwrite.o: fio.h |
| 161 |
lwrite.o: fmt.h |
| 162 |
lwrite.o: lio.h |
| 163 |
open.o: fio.h rawio.h |
| 164 |
rdfmt.o: fio.h |
| 165 |
rdfmt.o: fmt.h |
| 166 |
rdfmt.o: fp.h |
| 167 |
rewind.o: fio.h |
| 168 |
rsfe.o: fio.h |
| 169 |
rsfe.o: fmt.h |
| 170 |
rsli.o: fio.h |
| 171 |
rsli.o: lio.h |
| 172 |
rsne.o: fio.h |
| 173 |
rsne.o: lio.h |
| 174 |
sfe.o: fio.h |
| 175 |
signbit.o: arith.h |
| 176 |
sue.o: fio.h |
| 177 |
uio.o: fio.h |
| 178 |
uninit.o: arith.h |
| 179 |
util.o: fio.h |
| 180 |
wref.o: fio.h |
| 181 |
wref.o: fmt.h |
| 182 |
wref.o: fp.h |
| 183 |
wrtfmt.o: fio.h |
| 184 |
wrtfmt.o: fmt.h |
| 185 |
wsfe.o: fio.h |
| 186 |
wsfe.o: fmt.h |
| 187 |
wsle.o: fio.h |
| 188 |
wsle.o: fmt.h |
| 189 |
wsle.o: lio.h |
| 190 |
wsne.o: fio.h |
| 191 |
wsne.o: lio.h |
| 192 |
xwsne.o: fio.h |
| 193 |
xwsne.o: lio.h |
| 194 |
xwsne.o: fmt.h |
| 195 |
|
| 196 |
arith.h: arithchk.c |
| 197 |
$(CC) $(CFLAGS) -DNO_FPINIT arithchk.c -lm ||\ |
| 198 |
$(CC) -DNO_LONG_LONG $(CFLAGS) -DNO_FPINIT arithchk.c -lm |
| 199 |
./a.out >arith.h |
| 200 |
rm -f a.out arithchk.o |
| 201 |
|
| 202 |
check: |
| 203 |
xsum Notice README abort_.c arithchk.c backspac.c c_abs.c c_cos.c \ |
| 204 |
c_div.c c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c close.c comptry.bat \ |
| 205 |
d_abs.c d_acos.c d_asin.c d_atan.c d_atn2.c d_cnjg.c d_cos.c d_cosh.c \ |
| 206 |
d_dim.c d_exp.c d_imag.c d_int.c d_lg10.c d_log.c d_mod.c \ |
| 207 |
d_nint.c d_prod.c d_sign.c d_sin.c d_sinh.c d_sqrt.c d_tan.c \ |
| 208 |
d_tanh.c derf_.c derfc_.c dfe.c dolio.c dtime_.c due.c ef1asc_.c \ |
| 209 |
ef1cmc_.c endfile.c erf_.c erfc_.c err.c etime_.c exit_.c f2c.h0 \ |
| 210 |
f2ch.add f77_aloc.c f77vers.c fio.h fmt.c fmt.h fmtlib.c \ |
| 211 |
fp.h ftell_.c ftell64_.c \ |
| 212 |
getarg_.c getenv_.c h_abs.c h_dim.c h_dnnt.c h_indx.c h_len.c \ |
| 213 |
h_mod.c h_nint.c h_sign.c hl_ge.c hl_gt.c hl_le.c hl_lt.c \ |
| 214 |
i77vers.c i_abs.c i_dim.c i_dnnt.c i_indx.c i_len.c i_mod.c \ |
| 215 |
i_nint.c i_sign.c iargc_.c iio.c ilnw.c inquire.c l_ge.c l_gt.c \ |
| 216 |
l_le.c l_lt.c lbitbits.c lbitshft.c libf2c.lbc libf2c.sy lio.h \ |
| 217 |
lread.c lwrite.c main.c makefile.sy makefile.u makefile.vc \ |
| 218 |
makefile.wat math.hvc mkfile.plan9 open.c pow_ci.c pow_dd.c \ |
| 219 |
pow_di.c pow_hh.c pow_ii.c pow_qq.c pow_ri.c pow_zi.c pow_zz.c \ |
| 220 |
qbitbits.c qbitshft.c r_abs.c r_acos.c r_asin.c r_atan.c r_atn2.c \ |
| 221 |
r_cnjg.c r_cos.c r_cosh.c r_dim.c r_exp.c r_imag.c r_int.c r_lg10.c \ |
| 222 |
r_log.c r_mod.c r_nint.c r_sign.c r_sin.c r_sinh.c r_sqrt.c \ |
| 223 |
r_tan.c r_tanh.c rawio.h rdfmt.c rewind.c rsfe.c rsli.c rsne.c \ |
| 224 |
s_cat.c s_cmp.c s_copy.c s_paus.c s_rnge.c s_stop.c scomptry.bat sfe.c \ |
| 225 |
sig_die.c signal1.h0 signal_.c signbit.c sue.c sysdep1.h0 system_.c \ |
| 226 |
typesize.c \ |
| 227 |
uio.c uninit.c util.c wref.c wrtfmt.c wsfe.c wsle.c wsne.c xwsne.c \ |
| 228 |
z_abs.c z_cos.c z_div.c z_exp.c z_log.c z_sin.c z_sqrt.c >xsum1.out |
| 229 |
cmp xsum0.out xsum1.out && mv xsum1.out xsum.out || diff xsum[01].out |