111 lines
3.8 KiB
Makefile
Executable File
111 lines
3.8 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
SHELL := sh -e
|
|
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
|
|
SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
|
|
VERSION := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
|
|
VERSION_UPSTREAM := $(shell echo "$(VERSION)" | sed -e 's,-[^-]*$$,,')
|
|
VERSION_BINNMU := $(shell echo "$(VERSION)" | sed -ne 's,.*+b\(.*\)$$,\1,p')
|
|
|
|
include debian/rules.defs
|
|
|
|
stamp = [ -d $(dir $@) ] || mkdir $(dir $@); touch $@
|
|
|
|
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
DEBIAN_KERNEL_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
endif
|
|
ifdef DEBIAN_KERNEL_JOBS
|
|
MAKEFLAGS += -j$(DEBIAN_KERNEL_JOBS)
|
|
endif
|
|
|
|
.NOTPARALLEL:
|
|
|
|
source: debian/control $(STAMPS_DIR)/source-base
|
|
$(STAMPS_DIR)/source-base:
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen source
|
|
@$(stamp)
|
|
|
|
setup: debian/control $(STAMPS_DIR)/setup-base
|
|
$(STAMPS_DIR)/setup-base: $(STAMPS_DIR)/source-base
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen setup_$(DEB_HOST_ARCH)
|
|
@$(stamp)
|
|
|
|
build: build-arch build-indep
|
|
|
|
build-arch: debian/control $(STAMPS_DIR)/build-arch-base
|
|
$(STAMPS_DIR)/build-arch-base: $(STAMPS_DIR)/setup-base
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen build-arch_$(DEB_HOST_ARCH)
|
|
@$(stamp)
|
|
|
|
build-indep: debian/control $(STAMPS_DIR)/build-indep-base
|
|
$(STAMPS_DIR)/build-indep-base: $(STAMPS_DIR)/setup-base
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen build-indep
|
|
@$(stamp)
|
|
|
|
DIR_ORIG = ../orig/$(SOURCE)-$(VERSION_UPSTREAM)
|
|
TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.xz
|
|
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
|
|
|
|
orig: $(DIR_ORIG)
|
|
rsync --delete --exclude /debian --exclude .svk --exclude .svn --exclude .git --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
|
|
QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0
|
|
|
|
$(DIR_ORIG):
|
|
ifeq ($(TAR_ORIG),)
|
|
$(error Cannot find orig tarball $(TAR_ORIG_NAME))
|
|
else
|
|
mkdir -p ../orig
|
|
tar -C ../orig -xaf $(TAR_ORIG)
|
|
endif
|
|
|
|
maintainerclean:
|
|
rm -f debian/config.defines.dump debian/control debian/control.md5sum debian/rules.gen
|
|
rm -rf $(filter-out debian .svk .svn .git, $(wildcard * .[^.]*))
|
|
|
|
clean: debian/control
|
|
dh_testdir
|
|
rm -rf $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/debian_linux/*.pyc debian/linux-headers-* debian/linux-image-* debian/linux-support-* debian/linux-source-* debian/linux-doc-* debian/linux-manual-* debian/xen-linux-system-* debian/*-modules-*-di*
|
|
dh_clean
|
|
|
|
binary-indep: $(STAMPS_DIR)/build-indep-base
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen binary-indep
|
|
|
|
binary-arch: $(STAMPS_DIR)/build-arch-base
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)
|
|
|
|
binary: binary-indep binary-arch
|
|
|
|
CONTROL_FILES = debian/changelog $(wildcard debian/templates/*.in)
|
|
CONTROL_FILES += debian/config/defines $(wildcard debian/config/*/defines) $(wildcard debian/config/*/*/defines)
|
|
CONTROL_FILES += $(wildcard debian/installer/*/kernel-versions) $(wildcard debian/installer/*/package-list) debian/installer/package-list
|
|
debian/control debian/rules.gen: debian/bin/gencontrol.py $(CONTROL_FILES)
|
|
ifeq ($(wildcard debian/control.md5sum),)
|
|
$(MAKE) -f debian/rules debian/control-real
|
|
else ifeq ($(VERSION_BINNMU),)
|
|
md5sum --check debian/control.md5sum --status || \
|
|
$(MAKE) -f debian/rules debian/control-real
|
|
else
|
|
grep -v debian/changelog debian/control.md5sum | md5sum --check - --status || \
|
|
$(MAKE) -f debian/rules debian/control-real
|
|
endif
|
|
|
|
debian/control-real: debian/bin/gencontrol.py $(CONTROL_FILES)
|
|
chmod +x $<
|
|
$<
|
|
md5sum $^ > debian/control.md5sum
|
|
@echo
|
|
@echo This target is made to fail intentionally, to make sure
|
|
@echo that it is NEVER run during the automated build. Please
|
|
@echo ignore the following error, the debian/control file has
|
|
@echo been generated SUCCESSFULLY.
|
|
@echo
|
|
exit 1
|
|
|
|
.PHONY: clean build setup binary-indep binary-arch binary
|