aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2003-10-03 01:16:13 +0200
committerSam Ravnborg <sam@mars.ravnborg.org>2003-10-03 01:16:13 +0200
commit9d8f731dc151479c9ad3b5ff0b7b1c02146f0556 (patch)
treed09d978ccc8a8c548dd5277f8162d19961c8cbc7 /Makefile
parentd302b49758326ca67f8a9e37f65d6fc10bd7f645 (diff)
parent236eb45238ec5e1ba1dd4c0e857122907d485ecf (diff)
downloadhistory-9d8f731dc151479c9ad3b5ff0b7b1c02146f0556.tar.gz
Merge mars.ravnborg.org:/home/sam/bk/linux-2.6
into mars.ravnborg.org:/home/sam/bk/kbuild
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 22 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 80d119d5599eae..f83008b6390c11 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,7 @@ ifdef V
endif
endif
ifndef KBUILD_VERBOSE
- KBUILD_VERBOSE = 0
+ KBUILD_VERBOSE = 0
endif
# Call sparse as part of compilation of C files
@@ -79,16 +79,24 @@ ifdef O
endif
endif
+# That's our default target when none is given on the command line
+.PHONY: all
+all:
+
ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
- KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT); /bin/pwd)
+# check that the output directory actually exists
+saved-output := $(KBUILD_OUTPUT)
+KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+$(if $(wildcard $(KBUILD_OUTPUT)),, \
+ $(error output directory "$(saved-output)" does not exist))
-.PHONY: $(MAKECMDGOALS) all
+.PHONY: $(MAKECMDGOALS)
-$(MAKECMDGOALS) all:
+$(filter-out all,$(MAKECMDGOALS)) all:
$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
KBUILD_SRC=$(CURDIR) KBUILD_VERBOSE=$(KBUILD_VERBOSE) \
- KBUILD_CHECK=$(KBUILD_CHECK) -f $(CURDIR)/Makefile $(MAKECMDGOALS)
+ KBUILD_CHECK=$(KBUILD_CHECK) -f $(CURDIR)/Makefile $@
# Leave processing to above invocation of make
skip-makefile := 1
@@ -156,13 +164,6 @@ HOSTCXX = g++
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCXXFLAGS = -O2
-
-# That's our default target when none is given on the command line
-# Note that 'modules' will be added as a prerequisite as well,
-# in the CONFIG_MODULES part below
-
-all: vmlinux
-
# Decide whether to build built-in, modular, or both.
# Normally, just do built-in.
@@ -366,6 +367,12 @@ else
# Build targets only - this includes vmlinux, arch specific targets, clean
# targets and others. In general all targets except *config targets.
+# That's our default target when none is given on the command line
+# Note that 'modules' will be added as a prerequisite as well,
+# in the CONFIG_MODULES part below
+
+all: vmlinux
+
# Objects we will link into vmlinux / subdirs we need to visit
init-y := init/
drivers-y := drivers/ sound/
@@ -753,7 +760,7 @@ MRPROPER_FILES += \
.menuconfig.log \
include/asm \
.hdepend include/linux/modversions.h \
- tags TAGS cscope.out kernel.spec \
+ tags TAGS cscope* kernel.spec \
.tmp*
# Directories removed with 'make mrproper'
@@ -877,7 +884,7 @@ help:
@echo ' mrproper - remove all generated files + config + various backup files'
@echo ''
@echo 'Configuration targets:'
- @$(MAKE) -f scripts/kconfig/Makefile help
+ @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help
@echo ''
@echo 'Other generic targets:'
@echo ' all - Build all targets marked with [*]'
@@ -890,7 +897,7 @@ help:
@echo ' tags/TAGS - Generate tags file for editors'
@echo ''
@echo 'Documentation targets:'
- @$(MAKE) -f Documentation/DocBook/Makefile dochelp
+ @$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
@echo ''
@echo 'Architecture specific targets ($(ARCH)):'
@$(if $(archhelp),$(archhelp),\