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
|
#!/usr/bin/make -f
# -*- mode: makefile; -*-
# debian.rules file - for f2c, header file, etc.
package=f2c
INSTALL = /usr/bin/install
INSTALL_PROGRAM = $(INSTALL) -o root -g root -m 0755
CDEBUGFLAGS = -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CDEBUGFLAGS += -O0
else
CDEBUGFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
arch=$(shell dpkg --print-architecture)
dir=$(package)-$(version)
file=$(package)_$(version)-$(debian)
# Optimization options.
GCCOP2=-ansi $(CDEBUGFLAGS) -fomit-frame-pointer -mieee-fp -D_GNU_SOURCE -DDEBIAN
GCCOP1=-ansi $(CDEBUGFLAGS) -fomit-frame-pointer -D_GNU_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)
## 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
$(MAKE) -C "./src" -f makefile.u CFLAGS="$(GCCOPT)" ;\
touch build
clean:
$(checkdir)
$(MAKE) -C ./src -f makefile.u clean
cd src && rm -f xsum xsum1.out xsum.out
rm -f build build_f2c build_f2c_i2
rm -rf debian/tmp *~
rm -rf debian/*~ debian/files* debian/substvars
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}
install -d -m 0755 debian/tmp/usr/bin
$(INSTALL_PROGRAM) 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 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/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 -isp
dh_md5sums
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
|