]> git.hungrycats.org Git - linux/commitdiff
kbuild: Provide correct 'make some/dir/file.[iso]'
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Tue, 28 May 2002 16:35:34 +0000 (11:35 -0500)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Tue, 28 May 2002 16:35:34 +0000 (11:35 -0500)
Don't include Rules.make in the top-level Makefile, we don't
actually build anything from there, so we don't need the rules.

If asked to build some file in a subdirectory, descend into the
subdir and build it from there - only there we can know what
extra flags etc we have to add.

This also works for building preprocessed [.i] and assembler
output [.s].

Makefile

index b8e171b6dc66b02a46c79c595de93f0d31d6d27f..45d2d5368fff118ca6ccb70c449ecc1deb0269be 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -223,6 +223,20 @@ $(sort $(vmlinux-objs)): $(SUBDIRS) ;
 $(SUBDIRS): FORCE include/linux/version.h include/config/MARKER
        @$(MAKE) -C $@
 
+# Single targets
+# ---------------------------------------------------------------------------
+
+%.s: %.c FORCE
+       @$(MAKE) -C $(@D) $(@F)
+%.i: %.c FORCE
+       @$(MAKE) -C $(@D) $(@F)
+%.o: %.c FORCE
+       @$(MAKE) -C $(@D) $(@F)
+%.s: %.S FORCE
+       @$(MAKE) -C $(@D) $(@F)
+%.o: %.S FORCE
+       @$(MAKE) -C $(@D) $(@F)
+
 # Configuration
 # ---------------------------------------------------------------------------
 
@@ -275,11 +289,15 @@ depend dep: dep-files
 
 dep-files: scripts/mkdep archdep include/linux/version.h
        scripts/mkdep -- `find $(FINDHPATH) -name SCCS -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend
-       $(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) _FASTDEP_ALL_SUB_DIRS="$(SUBDIRS)"
+       @$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
 ifdef CONFIG_MODVERSIONS
        $(MAKE) update-modverfile
 endif
 
+.PHONY: $(patsubst %,_sfdep_%,$(SUBDIRS))
+$(patsubst %,_sfdep_%,$(SUBDIRS)): FORCE
+       @$(MAKE) -C $(patsubst _sfdep_%, %, $@) fastdep
+
 # update modversions.h, but only if it would change
 update-modverfile:
        @(echo "#ifndef _LINUX_MODVERSIONS_H";\
@@ -362,10 +380,6 @@ modules modules_install: FORCE
 
 endif # CONFIG_MODULES
 
-# ---------------------------------------------------------------------------
-
-include Rules.make
-
 # Cleaning up
 # ---------------------------------------------------------------------------
 
@@ -523,3 +537,4 @@ if_changed_rule = $(if $(strip $? \
                               $(filter-out $(cmd_$(@F)),$(cmd_$(1)))),\
                       @$(rule_$(1)))
 
+FORCE: