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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
#!/usr/bin/make -f
i=$(shell pwd)/debian/tmp
b=$(shell pwd)/debian/build
export DH_COMPAT=3
CFLAGS = -g -Wall
INSTALL = install
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
# The autotools target adds a forced build-time dependency on
# autotools-dev (for /usr/share/misc/config.*)
autotools:
OLDDATESUB=`./config.sub -t | tr -d - `;\
NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d - `;\
if [ "$$OLDDATESUB" -lt "$$NEWDATESUB" ]; then \
if [ ! -e config.sub.bak ]; then\
cp -f config.sub config.sub.bak;\
fi;\
if [ -e config.sub.bak ]; then\
cp -f /usr/share/misc/config.sub config.sub;\
fi;\
fi
Makefile:
@echo "--- Configuring"
./configure --prefix=/usr --sysconfdir=/etc --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
build: autotools Makefile build-debstamp
build-debstamp:
@echo "--- Compiling"
dh_testdir
$(MAKE) all
touch build-debstamp
clean:
@echo "--- Cleaning"
dh_testdir
-rm -rf static shared
-rm -f build-debstamp install-debstamp
-make distclean
-rm -f config/fnrc
-rm -f `find . -name "*~"`
-rm -rf `find . -name "\.deps"`
-rm -rf `find . -name "\.libs"`
-rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
-rm -f debian/*substvars
-if [ -e config.sub.bak ]; then \
cp -pf config.sub.bak config.sub && rm -f config.sub.bak; \
fi
#-rm -f configure
dh_clean
install: build install-debstamp
install-debstamp:
@echo "--- Installing"
dh_testdir
dh_testroot
dh_clean
rm -rf $(b)
$(MAKE) install prefix=$(i)/usr sysconfdir=$(i)/etc
cp Fnlib/libFnlib.la $(i)/usr/lib/
# mkdir -p $(i)/usr/share/doc/fnlib-data
touch install-debstamp
install-save: install
rm -rf $(i).saved
cp -a $(i) $(i).saved
install-saved:
rm -rf $(i)
rm -rf $(b)
cp -a $(i).saved $(i)
touch install-debstamp
binary-indep: build install \
fnlib-data
binary-arch: build install \
libfnlib0 \
libfnlib-dev
#
# libfnlib0
#
libfnlib0: install
@echo "--- Building: $@"
# used for creating postinst/prerm scripts
dh_installdocs -p$@ -P$(b)/$@
rm -rf $(b)/$@/usr/share/doc/$@
dh_movefiles -p$@ -P$(b)/$@
dh_strip -p$@ -P$(b)/$@
dh_link -p$@ -P$(b)/$@
dh_compress -p$@ -P$(b)/$@
dh_fixperms -p$@ -P$(b)/$@
dh_shlibdeps -p$@ -P$(b)/$@
dh_makeshlibs -p$@ -P$(b)/$@ -V
dh_installdeb -p$@ -P$(b)/$@
dh_gencontrol -p$@ -P$(b)/$@
dh_md5sums -p$@ -P$(b)/$@
dh_builddeb -p$@ -P$(b)/$@
#
# libfnlib-dev
#
libfnlib-dev: install
@echo "--- Building: $@"
# used for creating postinst/prerm scripts
dh_installdocs -p$@ -P$(b)/$@
rm -rf $(b)/$@/usr/share/doc/$@
dh_movefiles -p$@ -P$(b)/$@
dh_strip -p$@ -P$(b)/$@
dh_link -p$@ -P$(b)/$@
dh_compress -p$@ -P$(b)/$@
dh_fixperms -p$@ -P$(b)/$@
dh_installdeb -p$@ -P$(b)/$@
dh_shlibdeps -p$@ -P$(b)/$@
dh_gencontrol -p$@ -P$(b)/$@
dh_md5sums -p$@ -P$(b)/$@
dh_builddeb -p$@ -P$(b)/$@
fnlib-data: install
@echo "--- Building: $@"
dh_installdocs -p$@ -P$(b)/$@ AUTHORS fonts/fontinfo.README
dh_installchangelogs -p$@ -P$(b)/$@ ChangeLog
dh_movefiles -p$@ -P$(b)/$@
dh_compress -p$@ -P$(b)/$@
dh_fixperms -p$@ -P$(b)/$@
dh_installdeb -p$@ -P$(b)/$@
dh_gencontrol -p$@ -P$(b)/$@
dh_md5sums -p$@ -P$(b)/$@
dh_builddeb -p$@ -P$(b)/$@
binary: binary-indep binary-arch
.PHONY: binary clean binary-indep binary-arch build install install-save install-saved autotools
|