| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/architecture.mk |
| 4 |
-include /usr/share/dpkg/buildtools.mk |
| 5 |
|
| 6 |
binaries := $(shell dh_listpackages) |
| 7 |
|
| 8 |
CC := $(CC) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
| 9 |
|
| 10 |
CFLAGS := -g -Wall -W |
| 11 |
INSTALL_PROGRAM := install |
| 12 |
|
| 13 |
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 14 |
CFLAGS += -O2 |
| 15 |
endif |
| 16 |
|
| 17 |
build: build-arch build-indep |
| 18 |
|
| 19 |
build-arch: build-stamp |
| 20 |
|
| 21 |
build-indep: build-stamp |
| 22 |
|
| 23 |
build-stamp: |
| 24 |
./configure --prefix=`pwd`/debian/mbr/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) |
| 25 |
$(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)" |
| 26 |
touch build |
| 27 |
|
| 28 |
clean: |
| 29 |
dh_testdir |
| 30 |
dh_testroot |
| 31 |
dh_clean |
| 32 |
[ ! -f Makefile ] || $(MAKE) distclean |
| 33 |
rm -f build |
| 34 |
|
| 35 |
install: build |
| 36 |
dh_testdir |
| 37 |
dh_testroot |
| 38 |
dh_prep |
| 39 |
dh_installdirs -p mbr-udeb usr/sbin |
| 40 |
dh_installdocs -p mbr debian/README-1st.Debian NEWS README AUTHORS |
| 41 |
dh_installchangelogs |
| 42 |
$(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM)" |
| 43 |
ifneq ($(filter mbr-udeb,$(binaries)),) |
| 44 |
cp `pwd`/debian/mbr/usr/sbin/install-mbr `pwd`/debian/mbr-udeb/usr/sbin/ |
| 45 |
endif |
| 46 |
|
| 47 |
binary-indep: build |
| 48 |
dh_testdir |
| 49 |
|
| 50 |
binary-arch: build install |
| 51 |
dh_testdir |
| 52 |
dh_testroot |
| 53 |
dh_strip |
| 54 |
dh_compress |
| 55 |
dh_fixperms |
| 56 |
dh_shlibdeps |
| 57 |
dh_gencontrol |
| 58 |
dh_md5sums |
| 59 |
dh_builddeb |
| 60 |
|
| 61 |
binary: binary-indep binary-arch |
| 62 |
|
| 63 |
.PHONY: binary binary-arch binary-indep clean |