r3793 - in people/waldi/kernel/source/linux-2.6/debian: . bin

Bastian Blank waldi at costa.debian.org
Tue Aug 9 19:57:45 UTC 2005


Author: waldi
Date: 2005-08-09 19:57:44 +0000 (Tue, 09 Aug 2005)
New Revision: 3793

Modified:
   people/waldi/kernel/source/linux-2.6/debian/Makefile
   people/waldi/kernel/source/linux-2.6/debian/bin/gencontrol.py
   people/waldi/kernel/source/linux-2.6/debian/rules
Log:
* debian/Makefile
  - Fix directories.
  - Build anything in one subdir.
* debian/bin/gencontrol.py: Call debian/Makefile from package root.
* debian/rules: Updates.


Modified: people/waldi/kernel/source/linux-2.6/debian/Makefile
===================================================================
--- people/waldi/kernel/source/linux-2.6/debian/Makefile	2005-08-09 12:12:35 UTC (rev 3792)
+++ people/waldi/kernel/source/linux-2.6/debian/Makefile	2005-08-09 19:57:44 UTC (rev 3793)
@@ -7,8 +7,6 @@
 # It is possible to override the flavours by setting the flavours
 # variable. It will also be passed a list of source files
 #
-# This Makefile is run from the debian subdir. 
-#
 SHELL  := sh -e
 #
 # These variables control the behaviour of make-kpkg
@@ -31,10 +29,10 @@
 # Build the list of common config files to be included
 #
 ifeq ($(SUBARCH),none)
-  basedir := arch/$(ARCH)
+  basedir := debian/arch/$(ARCH)
   append  := 
 else
-  basedir := arch/$(ARCH)/$(SUBARCH)
+  basedir := debian/arch/$(ARCH)/$(SUBARCH)
   append  := $(SUBARCH)-
 endif
 
@@ -43,8 +41,6 @@
 ifndef flavours
   flavours := $(patsubst config.%,%,$(configs))
 endif
-controls := templates/control.source.in templates/control.headers.in
-controls += $(basedir)/control.in
 
 -include $(basedir)/Makefile.inc
 
@@ -55,7 +51,7 @@
 # in Makefile.inc. @flavour@ in the expressions is going to be
 # replaced by the flavour for which the command is run. 
 #
-kpkg_headers_cmd := HEADER_CLEAN_HOOK='$(CURDIR)/header-install-$(ARCH)-$(SUBARCH)'
+kpkg_headers_cmd := HEADER_CLEAN_HOOK='$(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH)'
 kpkg_headers_cmd += make-kpkg --append-to-version $(append)$(DEBNUM)
 kpkg_headers_cmd += --stem linux --config defconfig
 kpkg_build_cmd := make-kpkg --append-to-version $(DEBNUM)-$(FLAVOUR)
@@ -83,7 +79,7 @@
 ifndef headers_dirs
   headers_dirs = $(karch)
 endif
-ccommon = arch/config arch/$(karch)/config arch/$(karch)/$(subarch)/config
+ccommon = debian/arch/config debian/arch/$(karch)/config debian/arch/$(karch)/$(subarch)/config
 
 #
 # Targets
@@ -91,13 +87,13 @@
 binary-subarch: install-subarch-$(ARCH)-$(SUBARCH)
 binary-flavour: install-flavour-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
 
-build: stamp-build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+build: $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
 
-unpack-subarch: stamp-source-$(ARCH)-$(SUBARCH)
-unpack-flavour: stamp-unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+unpack-subarch: $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
+unpack-flavour: $(STAMPS_DIR)/unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
 
-install-flavour-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=install-flavour-dir-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-install-flavour-$(ARCH)-$(SUBARCH)-$(FLAVOUR): stamp-build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+install-flavour-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/install-flavour-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+install-flavour-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
 	rm -rf $(DIR)
 	cp -al build-$(ARCH)-$(SUBARCH)-$(FLAVOUR) $(DIR)
 	cd $(DIR); $(setup_env) $(kpkg_image_cmd)
@@ -105,8 +101,8 @@
 	@for i in $$(awk '{ print $$1; }' $(DIR)/debian/files); do echo mv $$i ../..; mv $$i ../..; done
 	rm -rf $(DIR)
 
-install-subarch-$(ARCH)-$(SUBARCH): DIR=install-subarch-dir-$(ARCH)-$(SUBARCH)
-install-subarch-$(ARCH)-$(SUBARCH): stamp-source-$(ARCH)-$(SUBARCH) header-install-$(ARCH)-$(SUBARCH)
+install-subarch-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/install-subarch-$(ARCH)-$(SUBARCH)
+install-subarch-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH) $(BUILD_DIR/header-install-$(ARCH)-$(SUBARCH)
 	rm -rf $(DIR)
 	cp -al source-$(ARCH)-$(SUBARCH) $(DIR)
 	cd $(DIR); $(setup_env) $(kpkg_headers_cmd)
@@ -114,7 +110,7 @@
 	@for i in $$(awk '{ print $$1; }' $(DIR)/debian/files); do echo mv $$i ../..; mv $$i ../..; done
 	rm -rf $(DIR)
 
-header-install-$(ARCH)-$(SUBARCH): templates/header-install.in
+$(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH): $(TEMPLATES_DIR)/header-install.in
 	sed -e 's, at kbpkg@,$(kbpkg),g'				\
 	    -e 's, at ksource_dir@,$(CURDIR)/$(kdir),g'		\
 	    -e 's, at flavours@,$(flavours),g'			\
@@ -130,7 +126,7 @@
 else
   extra_command := true
 endif
-post-install-$(ARCH)-$(SUBARCH): templates/post-install.in
+$(BUILD_DIR)/post-install-$(ARCH)-$(SUBARCH): $(TEMPLATES_DIR)/post-install.in
 	sed -e 's, at initrd_modules@,$(initrd_modules),'			\
 	    -e 's, at append_subarch@,$(append),'				\
 	    -e 's, at extra_postinstall_command@,$(extra_command),'	\
@@ -144,7 +140,7 @@
 # config file by setting include_common_config = no in the
 # arch/$(karch)/Makefile.inc.
 #
-config.$(ARCH)-$(SUBARCH)-$(FLAVOUR):
+$(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR):
 	@echo "configs=$(configs)"
 	@echo "Generating configuration file $@:"
 	rm -f $@
@@ -156,20 +152,20 @@
 #	Flavour config file must be present
 	cat $(basedir)/config.$(FLAVOUR) >> $@			 
 
-srcfiles := $(filter-out ../debian ../linux-source-$(VERSION), $(shell echo ../*))
-patches  := $(wildcard patches-arch/$(SUBARCH).*)
-patches  += $(wildcard patches-arch/$(SUBARCH)_*)
-patches  += $(wildcard patches-arch/$(ARCH).*)
-patches  += $(wildcard patches-arch/$(ARCH)_*)
+srcfiles := $(filter-out debian linux-source-$(VERSION), $(wildcard *))
+patches  := $(wildcard debian/patches-arch/$(SUBARCH).*)
+patches  += $(wildcard debian/patches-arch/$(SUBARCH)_*)
+patches  += $(wildcard debian/patches-arch/$(ARCH).*)
+patches  += $(wildcard debian/patches-arch/$(ARCH)_*)
 patches  := $(strip $(patches))
-stamp-source-$(ARCH)-$(SUBARCH): DIR=source-$(ARCH)-$(SUBARCH)
-stamp-source-$(ARCH)-$(SUBARCH): post-install-$(ARCH)-$(SUBARCH)
+$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
+$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): $(BUILD_DIR)/post-install-$(ARCH)-$(SUBARCH)
 	mkdir -p $(DIR)
 	cp -al $(srcfiles) $(DIR)
 	mkdir -p $(DIR)/debian
-	cp changelog $(DIR)/debian
-	cp copyright $(DIR)/debian
-	cp control $(DIR)/debian/control
+	cp debian/changelog $(DIR)/debian
+	cp debian/copyright $(DIR)/debian
+	cp debian/control $(DIR)/debian/control
 	touch $(DIR)/debian/official
 	if [ -n '$(patches)' ]; then			\
 	  cd $(DIR);					\
@@ -191,14 +187,12 @@
 # then be picked up and included into the linux-headers package
 # by the headers-install script.
 #
-stamp-build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-stamp-build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): stamp-unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-	ln -fs $$(command -v touch) bin/touch.orig
-	cd $(DIR);						\
-	$(setup_env) PATH=$(CURDIR)/bin:$(PATH) 		\
-	$(kpkg_build_cmd);					\
-	$(if $(image_postproc),$(image_postproc),true);		\
-	arch=$$(basename $$(readlink include/asm));		\
+$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+	ln -fs $$(command -v touch) debian/build/touch.orig
+	cd $(DIR); $(setup_env) PATH=$(CURDIR)/build:$(CURDIR)/bin:$(PATH) $(kpkg_build_cmd)
+	cd $(DIR); $(if $(image_postproc),$(image_postproc),true)
+	arch=$$(basename $$(readlink $(DIR)/include/asm));		\
 	arch="$${arch#asm-}";					\
 	src="arch/$${arch}/kernel/asm-offsets.s";		\
 	dst="../$(DIR)/$${src}";				\
@@ -209,9 +203,9 @@
 #
 # Creates a build directory for a particular flavour
 #
-stamp-unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=source-$(ARCH)-$(SUBARCH)
-stamp-unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
-stamp-unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR): config.$(ARCH)-$(SUBARCH)-$(FLAVOUR) stamp-source-$(ARCH)-$(SUBARCH)
+$(STAMPS_DIR)/unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
+$(STAMPS_DIR)/unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
+$(STAMPS_DIR)/unpack-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR) $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
 	rm -rf $(DIR)
 	cp -al $(SOURCE_DIR) $(DIR)
 	cp $< $(DIR)/.config

Modified: people/waldi/kernel/source/linux-2.6/debian/bin/gencontrol.py
===================================================================
--- people/waldi/kernel/source/linux-2.6/debian/bin/gencontrol.py	2005-08-09 12:12:35 UTC (rev 3792)
+++ people/waldi/kernel/source/linux-2.6/debian/bin/gencontrol.py	2005-08-09 19:57:44 UTC (rev 3793)
@@ -351,10 +351,10 @@
 
             subarch_makeflags = "ARCH='%s' SUBARCH='%s' VERSION='%s' DEBNUM='-%s'" % (arch, subarch_text, version, subarch_vars['abiname'])
             cmds_binary = []
-            cmds_binary.append(("$(MAKE) -C debian binary-subarch %s" % subarch_makeflags,))
+            cmds_binary.append(("$(MAKE) -f debian/Makefile binary-subarch %s" % subarch_makeflags,))
             cmds_build = []
             cmds_unpack = []
-            cmds_unpack.append(("$(MAKE) -C debian unpack-subarch %s" % subarch_makeflags,))
+            cmds_unpack.append(("$(MAKE) -f debian/Makefile unpack-subarch %s" % subarch_makeflags,))
             makefile.append(("binary-%s-%s-real:" % (arch, subarch_text), cmds_binary))
             makefile.append(("build-%s-%s-real:" % (arch, subarch_text), cmds_build))
             makefile.append(("unpack-%s-%s-real:" % (arch, subarch_text), cmds_unpack))
@@ -385,12 +385,12 @@
 
                 flavour_makeflags = subarch_makeflags + " FLAVOUR='%s'" % flavour
                 cmds_binary = []
-                cmds_binary.append(("$(MAKE) -C debian binary-flavour %s" % flavour_makeflags,))
+                cmds_binary.append(("$(MAKE) -f debian/Makefile binary-flavour %s" % flavour_makeflags,))
                 cmds_binary.append(("$(MAKE) -f debian/Makefile binary-dummy PACKAGES_ARG='%s'" % ' '.join(["-p%s" % i['Package'] for i in dummy_packages]),))
                 cmds_build = []
-                cmds_build.append(("$(MAKE) -C debian build %s" % flavour_makeflags,))
+                cmds_build.append(("$(MAKE) -f debian/Makefile build %s" % flavour_makeflags,))
                 cmds_unpack = []
-                cmds_unpack.append(("$(MAKE) -C debian unpack-flavour %s" % flavour_makeflags,))
+                cmds_unpack.append(("$(MAKE) -f debian/Makefile unpack-flavour %s" % flavour_makeflags,))
                 makefile.append(("binary-%s-%s-%s-real:" % (arch, subarch_text, flavour), cmds_binary))
                 makefile.append(("build-%s-%s-%s-real:" % (arch, subarch_text, flavour), cmds_build))
                 makefile.append(("unpack-%s-%s-%s-real:" % (arch, subarch_text, flavour), cmds_unpack))

Modified: people/waldi/kernel/source/linux-2.6/debian/rules
===================================================================
--- people/waldi/kernel/source/linux-2.6/debian/rules	2005-08-09 12:12:35 UTC (rev 3792)
+++ people/waldi/kernel/source/linux-2.6/debian/rules	2005-08-09 19:57:44 UTC (rev 3793)
@@ -1,15 +1,10 @@
 #!/usr/bin/make -f
 #
-# Required variables.  See README for a description of all the variables.
-# 
-abiname  := 1
-#
 # Generally nothing needs to be modified below this line
 #
 SHELL    := sh -e
 DEB_HOST_ARCH  := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
-karch    := $(DEB_BUILD_ARCH)
 srcver   := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
 version  := $(word 1,$(subst -, ,$(srcver)))
 ltver    := $(word 2,$(subst -, ,$(srcver)))
@@ -19,20 +14,6 @@
 release  := $(version)-$(ltver)
 uver     := $(subst .,_,$(version))
 #
-# If we are not passed a subarchs variable, we obtain the complete
-# subarch list as a list of subdirectories in arch/$(karch). We
-# also export the flavours variables, which allows to control which
-# flavours are built.
-#
-ifndef subarchs
-  subarchs := $(shell find debian/arch/$(karch) \
-                           -mindepth 1 -maxdepth 1 -type d \
-                           ! -name '.svn' -printf '%f\n')
-endif
-ifeq (,$(subarchs))
-  subarchs := none
-endif
-#
 # The following definition gets the list of relevant files in the top-level
 # directory. At this point we cannot verify that we are in top-level dir
 # (we probably are), so it should be referenced only in the targets which 
@@ -42,6 +23,10 @@
 
 export version abiname ltver kbuildver flavours major uver
 
+export BUILD_DIR = debian/build
+export STAMPS_DIR = debian/stamps
+export TEMPLATES_DIR = debian/templates
+
 patch: debian/patch-stamp
 debian/patch-stamp: debian/bin/apply
 	dh_testdir
@@ -173,17 +158,20 @@
 	touch debian/doc-stamp
 
 unpack: debian/unpack-stamp
-debian/unpack-stamp: debian/patch-stamp
+debian/unpack-stamp: $(BUILD_DIR) $(STAMPS_DIR) debian/patch-stamp
 	dh_testdir
 	$(MAKE) -f debian/rules.gen unpack-$(DEB_BUILD_ARCH)
 	touch $@
 
 build: debian/control debian/build-stamp
-debian/build-stamp: debian/unpack-stamp
+debian/build-stamp: $(BUILD_DIR) $(STAMPS_DIR) debian/unpack-stamp
 	dh_testdir
 	$(MAKE) -f debian/rules.gen build-$(DEB_BUILD_ARCH)
 	touch $@
 
+$(BUILD_DIR) $(STAMPS_DIR):
+	@[ -d $@ ] || mkdir $@
+
 orig: ../orig/linux-$(major)-$(version)
 	rsync --delete --exclude debian --exclude .svn -av ../orig/linux-$(major)-$(version)/ .
 
@@ -199,11 +187,8 @@
 clean: unpatch
 	dh_testdir
 	rm -f version.Debian
-	rm -rf linux-source-$(version)
-	cd debian;						\
-	rm -f stamp-* *-stamp config.* *.kpatches.arch; 	\
-	rm -f header-install-* post-install-* bin/touch.orig;	\
-	rm -rf linux-source-* build-* install-*
+	cd debian; rm -f *-stamp config.* *.kpatches.arch
+	rm -rf $(BUILD_DIR) $(STAMPS_DIR)
 	dh_clean
 
 binary-indep: source tree patch-debian doc




More information about the Kernel-svn-changes mailing list