aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2003-02-23 22:46:59 -0800
committerSam Ravnborg <sam@ravnborg.org>2003-02-23 22:46:59 -0800
commit1ceb967fa8ef3f184c7e53d6b67581118e8968a6 (patch)
tree4a012f45d1b1fd3e9244d246d3f8f0a091be25f8 /Makefile
parent7cfa0dcdc09e1ca1946a8fbbc65c964e9e956561 (diff)
downloadhistory-1ceb967fa8ef3f184c7e53d6b67581118e8968a6.tar.gz
[PATCH] fix make rpm
make rpm has been broken in several kernel versions, fix it. Solves http://bugme.osdl.org/show_bug.cgi?id=373 which Paolo Ciarrocchi pushed me to fix. 1) Moved make rpm to the noconfig section, thus allowing it to see the clean target. 2) Fixed the commandline for find 3) Use rpmbuild if present 4) In mkspec use the generic all target, and drop the dep target This made the build command arch independent
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile62
1 files changed, 32 insertions, 30 deletions
diff --git a/Makefile b/Makefile
index a4823a105a3a6..d39a0c8c6a776 100644
--- a/Makefile
+++ b/Makefile
@@ -194,7 +194,7 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
noconfig_targets := xconfig menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig allmodconfig \
- clean mrproper distclean \
+ clean mrproper distclean rpm \
help tags TAGS cscope sgmldocs psdocs pdfdocs htmldocs \
checkconfig checkhelp checkincludes
@@ -571,34 +571,6 @@ define generate-asm-offsets.h
echo "#endif" )
endef
-# RPM target
-# ---------------------------------------------------------------------------
-
-# If you do a make spec before packing the tarball you can rpm -ta it
-
-spec:
- . scripts/mkspec >kernel.spec
-
-# Build a tar ball, generate an rpm from it and pack the result
-# There arw two bits of magic here
-# 1) The use of /. to avoid tar packing just the symlink
-# 2) Removing the .dep files as they have source paths in them that
-# will become invalid
-
-rpm: clean spec
- find . $(RCS_FIND_IGNORE) \
- \( -size 0 -o -name .depend -o -name .hdepend\) \
- -type f -print | xargs rm -f
- set -e; \
- cd $(TOPDIR)/.. ; \
- ln -sf $(TOPDIR) $(KERNELPATH) ; \
- tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
- rm $(KERNELPATH) ; \
- cd $(TOPDIR) ; \
- $(CONFIG_SHELL) $(srctree)/scripts/mkversion > .version ; \
- rpm -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
- rm $(TOPDIR)/../$(KERNELPATH).tar.gz
-
else # ifdef include_config
ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
@@ -630,7 +602,7 @@ ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
# ---------------------------------------------------------------------------
.PHONY: oldconfig xconfig menuconfig config \
- make_with_config
+ make_with_config rpm
scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf: scripts/fixdep FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig $@
@@ -763,6 +735,36 @@ TAGS: FORCE
tags: FORCE
$(call cmd,tags)
+# RPM target
+# ---------------------------------------------------------------------------
+
+# If you do a make spec before packing the tarball you can rpm -ta it
+
+spec:
+ . scripts/mkspec >kernel.spec
+
+# Build a tar ball, generate an rpm from it and pack the result
+# There arw two bits of magic here
+# 1) The use of /. to avoid tar packing just the symlink
+# 2) Removing the .dep files as they have source paths in them that
+# will become invalid
+
+rpm: clean spec
+ find . $(RCS_FIND_IGNORE) \
+ \( -size 0 -o -name .depend -o -name .hdepend \) \
+ -type f -print | xargs rm -f
+ set -e; \
+ cd $(TOPDIR)/.. ; \
+ ln -sf $(TOPDIR) $(KERNELPATH) ; \
+ tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
+ rm $(KERNELPATH) ; \
+ cd $(TOPDIR) ; \
+ $(CONFIG_SHELL) $(srctree)/scripts/mkversion > .version ; \
+ RPM=`which rpmbuild`; \
+ if [ -z "$$RPM" ]; then RPM=rpm; fi; \
+ $$RPM -ta $(TOPDIR)/../$(KERNELPATH).tar.gz ; \
+ rm $(TOPDIR)/../$(KERNELPATH).tar.gz
+
# Brief documentation of the typical targets used
# ---------------------------------------------------------------------------