#!/usr/bin/make -f # # $(DEBIAN)/rules for Ubuntu linux # # Use this however you want, just give credit where credit is due. # # Copyright (c) 2007 Ben Collins # DEBIAN=$(shell awk -F= '($$1 == "DEBIAN") { print $$2 }' >$(prev_abidir)/../modules.ignore) endif # Either tools package needs the common source preparation do_any_tools=$(sort $(filter-out false,$(do_linux_tools) $(do_cloud_tools))) # autopkgtest -- rebuild support # only build the first flavour on the assumption it is representative ifneq ($(filter autopkgtest,$(DEB_BUILD_PROFILES)),) flavours := $(firstword $(flavours)) disable_d_i=true endif # Debian Build System targets binary: binary-indep binary-arch build: build-arch build-indep clean: debian/control dh_testdir dh_testroot dh_clean # d-i stuff rm -rf $(DEBIAN)/d-i-$(arch) # Generated on the fly. rm -f $(DEBIAN)/d-i/firmware/$(arch)/kernel-image # normal build junk rm -rf $(DEBIAN)/abi/$(release)-$(revision) rm -rf $(builddir) rm -f $(stampdir)/stamp-* rm -rf $(DEBIAN)/linux-* # This gets rid of the d-i packages in control cp -f $(DEBIAN)/control.stub $(DROOT)/control cp $(DEBIAN)/changelog debian/changelog # Install the copyright information. cp $(DEBIAN)/copyright debian/copyright # Install the retpoline extractor. cp $(DROOT)/scripts/retpoline-extract-one scripts/ubuntu-retpoline-extract-one # If we have a reconstruct script use it. [ -f $(DEBIAN)/reconstruct ] && bash $(DEBIAN)/reconstruct # Remove generated intermediate files rm -f $(DROOT)/control.stub $(DEBIAN)/control.stub distclean: clean rm -rf $(DROOT)/control debian/changelog \ debian/control debian/control.stub debian/copyright \ scripts/ubuntu-retpoline-extract-one # Builds the image, arch headers and debug packages include $(DROOT)/rules.d/2-binary-arch.mk # Rules for building the udebs ($(DEBIAN)-installer) include $(DROOT)/rules.d/5-udebs.mk # Builds the source, doc and linux-headers indep packages include $(DROOT)/rules.d/3-binary-indep.mk # Various checks to be performed on builds include $(DROOT)/rules.d/4-checks.mk # Misc stuff .PHONY: $(DEBIAN)/control.stub $(DEBIAN)/control.stub: \ $(DROOT)/scripts/control-create \ $(DEBIAN)/control.stub.in \ $(DEBIAN)/changelog \ $(wildcard $(DEBIAN)/control.d/* $(DEBIAN)/sub-flavours/*.vars) for i in $(DEBIAN)/control.stub.in; do \ new=`echo $$i | sed 's/\.in$$//'`; \ cat $$i | sed -e 's/PKGVER/$(release)/g' \ -e 's/ABINUM/$(abinum)/g' \ -e 's/SRCPKGNAME/$(src_pkg_name)/g' \ -e 's/=HUMAN=/$(human_arch)/g' \ > $$new; \ done flavours="$(sort $(wildcard $(DEBIAN)/control.d/vars.* $(DEBIAN)/sub-flavours/*.vars))";\ for i in $$flavours; do \ $(SHELL) $(DROOT)/scripts/control-create $$i | \ sed -e 's/PKGVER/$(release)/g' \ -e 's/ABINUM/$(abinum)/g' \ -e 's/SRCPKGNAME/$(src_pkg_name)/g' \ -e 's/=HUMAN=/$(human_arch)/g' \ >> $(DEBIAN)/control.stub; \ done .PHONY: debian/control debian/control: $(DEBIAN)/control.stub echo "# placebo control.stub for kernel-wedge flow change" >debian/control.stub cp $(DEBIAN)/control.stub debian/control export KW_DEFCONFIG_DIR=$(DEBIAN)/d-i && \ export KW_CONFIG_DIR=$(DEBIAN)/d-i && \ LANG=C kernel-wedge gen-control $(release)-$(abinum) | \ perl -f $(DROOT)/scripts/misc/kernel-wedge-arch.pl $(arch) \ >>$(CURDIR)/debian/control