aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
blob: 365d34c4ba1628e71cf5f20adeaed1aa6fb2cd09 (plain)
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
#!/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
#export DH_VERBOSE=1
#export DH_OPTIONS=-v

PLATFORMS_AND_TARGETS= \
	  ca9x4_ct_vxp	u-boot.bin	ca9x4-ct-vxp\
	  mx51evk 	u-boot.imx	mx51evk\
	  omap3_beagle 	u-boot.bin	omap3-beagle\
	  omap4_panda	u-boot.bin	omap4-panda

%:
	dh --with quilt $@

override_dh_auto_configure:
	@

override_dh_auto_clean:
	$(MAKE) distclean
	rm -rf debian/build

# the u-boot.imx target does not work with O= and make mrproper
# removes all *.bin files in the tree so we use rsync to make
# a copy of the tree for each platform
override_dh_auto_build:
	echo $(PLATFORMS_AND_TARGETS)| xargs -n 3 | \
	while read plat target deb; do \
		mkdir -p debian/build/$$plat; \
		rsync -a --exclude=debian * debian/build/$$plat; \
		$(MAKE) -C debian/build/$$plat $${plat}_config; \
		$(MAKE) -C debian/build/$$plat $$target; \
	done

override_dh_auto_install:
	echo $(PLATFORMS_AND_TARGETS) | xargs -n 3 | \
	while read plat target deb; do \
	    install -D -m644 debian/build/$$plat/$$target debian/u-boot-linaro-$$deb/usr/lib/u-boot/$$plat/$$target; \
	done