# This file contains rules which are shared between multiple Makefiles.
#
-#
-# Special variables which should not be exported
-#
-unexport EXTRA_AFLAGS
-unexport EXTRA_CFLAGS
-unexport EXTRA_LDFLAGS
-unexport EXTRA_ARFLAGS
-unexport SUBDIRS
-unexport SUB_DIRS
-unexport ALL_SUB_DIRS
-unexport MOD_SUB_DIRS
-unexport O_TARGET
-
-unexport obj-y
-unexport obj-m
-unexport obj-n
-unexport obj-
-unexport export-objs
-unexport subdir-y
-unexport subdir-m
-unexport subdir-n
-unexport subdir-
-unexport mod-subdirs
-
# Some standard vars
comma := ,
subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)))
# Replace multi-part objects by their individual parts, look at local dir only
-real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m)))
+real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m))) $(EXTRA_TARGETS)
real-objs-m := $(foreach m, $(obj-m), $(if $($(m:.o=-objs)),$($(m:.o=-objs)),$(m)))
# ==========================================================================
#
# Get things started.
#
-first_rule: all_targets
+first_rule: vmlinux
#
# Common rules
# Build the compiled-in targets
# ---------------------------------------------------------------------------
-all_targets: $(O_TARGET) $(L_TARGET) sub_dirs
+vmlinux: $(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS) sub_dirs
# To build objects in subdirs, we need to descend into the directories
$(sort $(subdir-obj-y)): sub_dirs ;
endif
.PHONY: modules
-modules: $(obj-m) FORCE \
- $(patsubst %,_modsubdir_%,$(MOD_SUB_DIRS))
+modules: $(obj-m) FORCE $(patsubst %,_modsubdir_%,$(MOD_SUB_DIRS))
.PHONY: _modinst__
_modinst__: FORCE
endif
.PHONY: modules_install
-modules_install: _modinst__ \
- $(patsubst %,_modinst_%,$(MOD_SUB_DIRS))
+modules_install: _modinst__ $(patsubst %,_modinst_%,$(MOD_SUB_DIRS))
# Add FORCE to the prequisites of a target to force it to be always rebuilt.
#
# Makefile for the linux kernel.
#
-# Note! Dependencies are done automagically by 'make dep', which also
-# removes any old dependencies. DON'T put your own dependencies here
-# unless it's something special (ie not a .c file).
-#
-# Note 2! The CFLAGS definitions are now in the main makefile...
-
-EXTRA_AFLAGS := -traditional
-all: kernel.o head.o init_task.o
+EXTRA_TARGETS := head.o init_task.o
O_TARGET := kernel.o
obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o
endif
+EXTRA_AFLAGS := -traditional
+
include $(TOPDIR)/Rules.make