1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
#!/usr/bin/make -f
# -*- mode: makefile; -*-
# debian.rules file - for f2c, libraries, header file, etc.
package=f2c
arch=$(shell dpkg --print-architecture)
dir=$(package)-$(version)
file=$(package)_$(version)-$(debian)
flibmajorver=2
flibver=2.1
# Optimization options.
GCCOP2=-ansi -O2 -fomit-frame-pointer -mieee-fp -D_POSIX_SOURCE -DDEBIAN
GCCOP1=-ansi -O2 -fomit-frame-pointer -D_POSIX_SOURCE -DDEBIAN
## Chose which options to use depending upon
## whether or not target is i386
ifeq ($(arch),i386)
GCCOPT=$(GCCOP2)
else
GCCOPT=$(GCCOP1)
endif
build:
$(checkdir)
$(MAKE) -C "./src" CFLAGS="$(GCCOP1)" xsum.out
## Avoid using -mieee-fp on anything other than the i386 platform
## as it is a gcc i386 specific option
if [ $(arch) == "i386" ] ;\
then echo "Building for i386" ;\
fi
if [ $(arch) == "alpha" ] ;\
then echo "Building for ALPHA" ;\
sed 's/long //' ./src/f2c.master.h > ./src/f2c.h ;\
else cp ./src/f2c.master.h ./src/f2c.h ;\
fi
$(MAKE) -C "./src" CFLAGS="$(GCCOPT)" ;\
sh libi77
sh libf77
## These take gcc options from GCCOPT
$(MAKE) -f ./debian/make_lib INTSIZE=f2c
$(MAKE) -f ./debian/make_lib INTSIZE=f2c_i2
strip libf2c.so.2.1
strip libf2c_i2.so.2.1
touch build
clean:
$(checkdir)
$(MAKE) -C src clean
rm -rf libF77 libI77
rm -f libf2c* *.tmp __*
cd src && rm -f xsum xsum1.out xsum.out; $(MAKE) -i clean
rm -f hello hello.o hello.c verify.out hello.P
rm -f build build_f2c build_f2c_i2
rm -rf debian/tmp *~
rm -rf debian/*~ debian/files* debian/substvars
cp ./src/f2c.master.h ./src/f2c.h
binary-indep: checkroot build
${checkdir}
binary-arch: checkroot
rm -rf debian/tmp
install -d debian/tmp debian/tmp/DEBIAN
install -d debian/tmp/usr/share/doc/${package}
cp debian/shlibs debian/tmp/DEBIAN/shlibs
install -c -m 0755 debian/postinst debian/tmp/DEBIAN
install -c -m 0755 debian/prerm debian/tmp/DEBIAN
install -d -m 0755 debian/tmp/usr/bin
install -s -m 0755 src/f2c debian/tmp/usr/bin/f2c
install -c -m 0755 fc debian/tmp/usr/bin/fc
install -d -m 0755 debian/tmp/usr/share/man/man1
install -c -m 0644 fc.1 debian/tmp/usr/share/man/man1/fc.1
install -c -m 0644 src/f2c.1t debian/tmp/usr/share/man/man1/f2c.1
gzip -9v debian/tmp/usr/share/man/man1/f2c.1
gzip -9v debian/tmp/usr/share/man/man1/fc.1
install -d -m 0755 debian/tmp/usr/lib
install -c -m 0644 libf2c.a debian/tmp/usr/lib/libf2c.a
install -c -m 0644 libf2c_i2.a debian/tmp/usr/lib/libf2c_i2.a
install -d -m 0755 debian/tmp/usr/include
install -c -m 0644 src/f2c.h debian/tmp/usr/include/f2c.h
install -c -m 0644 libf2c.so.$(flibver) \
debian/tmp/usr/lib/libf2c.so.$(flibver)
install -c -m 0644 libf2c_i2.so.$(flibver) \
debian/tmp/usr/lib/libf2c_i2.so.$(flibver)
(cd debian/tmp/usr/lib; ln -s libf2c.so.$(flibver) libf2c.so.$(flibmajorver); \
ln -s libf2c_i2.so.$(flibver) libf2c_i2.so.$(flibmajorver) )
install -d -m 0755 debian/tmp/usr/share/doc/$(package)
install -c -m 0644 f2c.ps debian/tmp/usr/share/doc/$(package)
install -c -m 0644 changes debian/tmp/usr/share/doc/$(package)/changelog
install -c -m 0644 readme debian/tmp/usr/share/doc/$(package)
install -c -m 0644 debian/changelog \
debian/tmp/usr/share/doc/f2c/changelog.Debian
install -c -m 0644 debian/README.debian \
debian/tmp/usr/share/doc/f2c/README.debian
(cd debian/tmp/usr/share/doc/$(package); gzip -9v *)
install -c -m 0644 debian/copyright \
debian/tmp/usr/share/doc/f2c/copyright
dpkg-shlibdeps ./src/f2c
dpkg-gencontrol
chown -R root.root debian/tmp
chmod -R go-ws debian/tmp
dpkg --build debian/tmp ..
## Below Here is Generic
define checkdir
test -f ./src/$(package).1t
endef
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
dist: binary source diff changes
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary source diff clean checkroot changes dist
|