#!/usr/bin/make -f DOCDIR=debian/tmp/usr/share/doc/intel2gas include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/buildtools.mk CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 CXXFLAGS += -O0 else CFLAGS += -O2 CXXFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_OPTS += -s endif INSTALL_OPTS += --strip-program=$(STRIP) BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p') build-arch: build build-indep: build build: if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi ./configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) $(MAKE) CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" INSTALL_OPTS="$(INSTALL_OPTS)" touch build clean: if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi -rm -f build [ ! -f Makefile ] || $(MAKE) distclean -rm -rf debian/tmp debian/files* debian/substvars binary-indep: build if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi if [ $$(id -u) != 0 ]; then echo "not root!"; exit 1; fi binary-arch: build if [ ! -f debian/rules ]; then echo "wrong dir!"; exit 1; fi if [ ! `id -ru` = 0 ]; then echo "not root!"; exit 1; fi -rm -rf debian/tmp install -d -m 755 -o root -g root debian/tmp debian/tmp/DEBIAN \ $(DOCDIR) debian/tmp/usr/share/man/man1 $(MAKE) install prefix=debian/tmp/usr INSTALL_OPTS="$(INSTALL_OPTS)" # fix weird permissions inherited from upstream... chmod -R 0644 debian/tmp/usr/share/intel2gas/*/* install -p -o root -g root -m 644 debian/copyright README BUGS \ DATAFILES TODO THANKS $(DOCDIR) install -p -o root -g root -m 644 debian/changelog \ $(DOCDIR)/changelog.Debian install -p -o root -g root -m 644 ChangeLog $(DOCDIR)/changelog # there is no proper manpage for intel2gas...i'll do a minimal one install -p -o root -g root -m 644 debian/intel2gas.man debian/tmp/usr/share/man/man1/intel2gas.1 gzip -9n debian/tmp/usr/share/man/man1/intel2gas.1 # fixme: changelog and changelog.debian?? # those two are bigger than 4k... gzip -9n $(DOCDIR)/DATAFILES $(DOCDIR)/README $(DOCDIR)/changelog* dpkg-shlibdeps intel2gas dpkg-gencontrol -isp find debian/tmp -depth -newermt '$(BUILD_DATE)' -print0 | \ xargs -0r touch --no-dereference --date='$(BUILD_DATE)' dpkg --build debian/tmp .. binary: binary-indep binary-arch .PHONY: binary binary-arch binary-indep clean