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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
# -Wl,--no-allow-shlib-undefined not possible due to 625712
# (and libc no longer pulling in ld-linux.so in directly)
LDFLAGS += -Wl,-z,defs
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
ALSODO =
# life would be to simple if there was something to work everywhere....
ABIFLAG_32=-m32
ABIFLAG_64=-m64
# do not forget to update Build-depends when changing something here:
ifeq ($(DEB_HOST_ARCH),sparc)
ALSODO = 64
else ifeq ($(DEB_HOST_ARCH),i386)
ALSODO = 64
else ifeq ($(DEB_HOST_ARCH),kfreebsd-amd64)
ALSODO = 32
else ifeq ($(DEB_HOST_ARCH),amd64)
ALSODO = 32
else ifeq ($(DEB_HOST_ARCH),mips)
ABIFLAG_32=-mabi=n32
ABIFLAG_64=-mabi=64
ALSODO = 64 32
else ifeq ($(DEB_HOST_ARCH),mipsel)
ABIFLAG_32=-mabi=n32
ABIFLAG_64=-mabi=64
ALSODO = 64 32
else ifeq ($(DEB_HOST_ARCH),powerpc)
ALSODO = 64
else ifeq ($(DEB_HOST_ARCH),s390)
ALSODO = 64
else ifeq ($(DEB_HOST_ARCH),s390x)
ABIFLAG_32=-m31
ALSODO = 32
endif
build-arch: build-arch-stamp $(foreach bits,$(ALSODO),build-arch-$(bits)-stamp)
build-indep:
build: build-arch
build-arch-%-stamp:
$(MAKE) BITSOFS=$* CC="$(DEB_HOST_GNU_TYPE)-gcc" CFLAGS='$(ABIFLAG_$*) $(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
touch $@
build-arch-stamp:
dh_testdir
$(MAKE) CC="$(DEB_HOST_GNU_TYPE)-gcc" CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
touch build-arch-stamp
clean:
dh_testdir
dh_testroot
rm -f build-arch*-stamp
$(MAKE) clean
rm -f *.o *.so *.so.*
dh_clean
# Build architecture-independent files here.
binary-indep: build-indep
# We have nothing to do
LIBNAME = libnss_extrausers.so.2
# Build architecture-dependent files here.
binary-arch: build-arch
dh_testdir
dh_testroot
dh_prep
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/libnss-extrausers
for also in $(ALSODO) ; do \
$(MAKE) BITSOFS=$${also} install DESTDIR=$(CURDIR)/debian/libnss-extrausers ; \
done
dh_installchangelogs
dh_installdocs
dh_link
dh_strip
[ "$(ALSODO)" = "" ] || \
dpkg-shlibdeps -Tdebian/libnss-extrausers.substvars \
-palternatelibs -dSuggests \
$(foreach bits,$(ALSODO), debian/libnss-extrausers/usr/lib$(bits)/$(LIBNAME))
dh_shlibdeps $(foreach bits,$(ALSODO), -X/usr/lib$(bits)/$(LIBNAME))
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary
|