| 1 | #!/usr/bin/make -f |
| 2 | # This file is in the public domain. |
| 3 | # You may freely use, modify, distribute, and relicense it. |
| 4 | |
| 5 | build clean install binary-arch binary-indep binary: |
| 6 | +dh --parallel $(opt_no_act) $@ |
| 7 | |
| 8 | override_dh_auto_clean: |
| 9 | test -e debian/xburst_stage1.bin || { \ |
| 10 | echo >&2 see debian/README.source; \ |
| 11 | exit 1; \ |
| 12 | } |
| 13 | dh_auto_clean |
| 14 | sh debian/clean.sh |
| 15 | |
| 16 | override_dh_auto_configure: configure |
| 17 | dh_auto_configure -- $(opt_optimize) $(opt_quiet) \ |
| 18 | --disable-firmware LDFLAGS=-Wl,-z,defs |
| 19 | |
| 20 | override_dh_auto_install: |
| 21 | dh_auto_install |
| 22 | : install firmware from source package |
| 23 | dh_install debian/xburst_stage1.bin usr/share/xburst-tools/ |
| 24 | dh_install debian/xburst_stage2.bin usr/share/xburst-tools/ |
| 25 | dh_install debian/stage1.bin usr/share/xburst-tools/ |
| 26 | |
| 27 | override_dh_installchangelogs: |
| 28 | dh_installchangelogs debian/changelog.upstream |
| 29 | |
| 30 | opt_optimize = CFLAGS="-g -O2" |
| 31 | opt_no_act = |
| 32 | opt_quiet = |
| 33 | |
| 34 | ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) |
| 35 | opt_optimize = CFLAGS="-g -O0" |
| 36 | endif |
| 37 | |
| 38 | ifneq (,$(findstring n,$(MAKEFLAGS))) |
| 39 | opt_no_act = --no-act |
| 40 | endif |
| 41 | |
| 42 | ifneq (,$(filter quiet,$(DEB_BUILD_OPTIONS))) |
| 43 | opt_quiet = --quiet |
| 44 | MAKEFLAGS += --quiet |
| 45 | endif |
| 46 | |
| 47 | configure: configure.ac |
| 48 | AUTOMAKE="automake --foreign" autoreconf -is |
| 49 | |
| 50 | firmware: configure |
| 51 | ./configure --enable-firmware CROSS_COMPILE=mipsel-openwrt-linux- |
| 52 | $(MAKE) -C usbboot/src \ |
| 53 | ../xburst_stage1/xburst_stage1.bin \ |
| 54 | ../xburst_stage2/xburst_stage2.bin |
| 55 | $(MAKE) -C xbboot/host-app \ |
| 56 | ../target-stage1/stage1.bin |
| 57 | |
| 58 | VERSION = 201007 |
| 59 | debiandir_SQ = $(subst ','\'',$(dir $(lastword $(MAKEFILE_LIST)))) |
| 60 | get-orig-source: |
| 61 | VERSION='$(VERSION)' sh '$(debiandir_SQ)'get-orig-source.sh |
| 62 | |