| 1 | #!/usr/bin/make -f |
|---|
| 2 | |
|---|
| 3 | # Uncomment this to turn on verbose mode. |
|---|
| 4 | #export DH_VERBOSE=1 |
|---|
| 5 | |
|---|
| 6 | DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
|---|
| 7 | DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) |
|---|
| 8 | |
|---|
| 9 | VERSION := $(shell dpkg-parsechangelog | perl -ne '/^Version:\s+(\S+)-[^-]+$$/ && print $$1;') |
|---|
| 10 | |
|---|
| 11 | include debian/rules.defs |
|---|
| 12 | |
|---|
| 13 | setup: $(STAMPS_DIR)/setup-base |
|---|
| 14 | $(STAMPS_DIR)/setup-base: debian/control $(BUILD_DIR) $(STAMPS_DIR) |
|---|
| 15 | dh_testdir |
|---|
| 16 | $(MAKE) -f debian/rules.gen setup-$(DEB_HOST_ARCH) |
|---|
| 17 | touch $@ |
|---|
| 18 | |
|---|
| 19 | build: debian/control $(STAMPS_DIR)/build-base |
|---|
| 20 | $(STAMPS_DIR)/build-base: $(STAMPS_DIR)/setup-base |
|---|
| 21 | dh_testdir |
|---|
| 22 | $(MAKE) -f debian/rules.gen build-$(DEB_HOST_ARCH) |
|---|
| 23 | touch $@ |
|---|
| 24 | |
|---|
| 25 | $(BUILD_DIR) $(STAMPS_DIR): |
|---|
| 26 | @[ -d $@ ] || mkdir $@ |
|---|
| 27 | |
|---|
| 28 | maintainerclean: |
|---|
| 29 | rm -f debian/control* debian/rules.gen debian/xen-hypervisor-* debian/xen-utils-* |
|---|
| 30 | rm -rf $(filter-out .svn debian, $(wildcard * .[^.]*)) |
|---|
| 31 | |
|---|
| 32 | clean: debian/control |
|---|
| 33 | dh_testdir |
|---|
| 34 | rm -rf $(BUILD_DIR) $(STAMPS_DIR) |
|---|
| 35 | dh_clean |
|---|
| 36 | |
|---|
| 37 | binary-indep: |
|---|
| 38 | dh_testdir |
|---|
| 39 | $(MAKE) -f debian/rules.gen binary-indep |
|---|
| 40 | |
|---|
| 41 | binary-arch: |
|---|
| 42 | dh_testdir |
|---|
| 43 | $(MAKE) -f debian/rules.gen binary-arch-$(DEB_HOST_ARCH) |
|---|
| 44 | |
|---|
| 45 | binary: binary-indep binary-arch |
|---|
| 46 | |
|---|
| 47 | DIR_ORIG = ../orig/xen-$(MAJOR)-$(VERSION) |
|---|
| 48 | |
|---|
| 49 | orig: $(DIR_ORIG) |
|---|
| 50 | rsync --delete --exclude debian --exclude .svn --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ . |
|---|
| 51 | |
|---|
| 52 | # This is to make dpatch-edit-patch work |
|---|
| 53 | unpatch: clean |
|---|
| 54 | |
|---|
| 55 | CONTROL_FILES += debian/changelog $(wildcard debian/templates/control.*) |
|---|
| 56 | CONTROL_FILES += $(wildcard debian/arch/defines) $(wildcard debian/arch/*/defines) |
|---|
| 57 | GENCONTROL = $(__MODULES_DIR)gencontrol.py |
|---|
| 58 | debian/control debian/rules.gen: $(CONTROL_FILES) |
|---|
| 59 | if [ -f debian/control ] && [ -f debian/control.md5sum ] && [ -f debian/rules.gen ]; then \ |
|---|
| 60 | if md5sum $^ | diff - debian/control.md5sum > /dev/null; then true; else \ |
|---|
| 61 | $(MAKE) -f debian/rules debian/control-real; \ |
|---|
| 62 | fi \ |
|---|
| 63 | else \ |
|---|
| 64 | $(MAKE) -f debian/rules debian/control-real; \ |
|---|
| 65 | fi |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | debian/control-real: $(CONTROL_FILES) |
|---|
| 69 | debian/bin/gencontrol.py $(KERNELVERSION) /usr/src/linux-support-$(KERNELVERSION) |
|---|
| 70 | md5sum $^ > debian/control.md5sum |
|---|
| 71 | @echo |
|---|
| 72 | @echo This target is made to fail intentionally, to make sure |
|---|
| 73 | @echo that it is NEVER run during the automated build. Please |
|---|
| 74 | @echo ignore the following error, the debian/control file has |
|---|
| 75 | @echo been generated SUCCESSFULLY. |
|---|
| 76 | @echo |
|---|
| 77 | exit 1 |
|---|
| 78 | |
|---|
| 79 | .PHONY: clean build binary-indep binary-arch binary |
|---|