Commit 7a897475 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Provide correct 'make some/dir/file.[iso]'

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].
parent 04a8c2f5
......@@ -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:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment