#!/usr/bin/make -f # the upstream build passes LDFLAGS directly to ld instead of calling gcc for # linking; so instead of passing -Wl,foo in LDFLAGS as in automake builds, one # should set LDFLAGS to foo directly comma := , LDFLAGS := $(patsubst -Wl$(comma)%,%,$(LDFLAGS)) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- endif # u-boot breaks with gcc-4.5 export CC=$(CROSS_COMPILE)gcc-4.4 %: dh $@ override_dh_auto_clean: # upstream only cleans these files if passing the right O=, but it # shouldn't create these the source tree in the first place # XXX this hardcodes "arm" rm -f arch/arm/include/asm/arch arch/arm/include/asm/proc rm -rf debian/build override_dh_auto_build: while read plat target deb; do \ mkdir -p debian/build/$$plat; \ $(MAKE) O=$$PWD/debian/build/$$plat $${plat}_config; \ find debian/build; \ $(MAKE) O=$$PWD/debian/build/$$plat; \ done