Commit 834e1cc5 authored by Kai Germaschewski's avatar Kai Germaschewski

Merge http://linux-sam.bkbits.net/kbuild

into tp1.ruhr-uni-bochum.de:/home/kai/src/kernel/v2.5/linux-2.5.make-sam
parents cebce9d8 38a481f5
......@@ -200,7 +200,7 @@ scripts/docproc scripts/fixdep scripts/split-include : scripts ;
.PHONY: scripts
scripts:
+@$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts
$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts
# Objects we will link into vmlinux / subdirs we need to visit
# ---------------------------------------------------------------------------
......@@ -432,7 +432,7 @@ include/config/MARKER: scripts/split-include include/linux/autoconf.h
# with it and forgot to run make oldconfig
include/linux/autoconf.h: .config
+@$(call descend,scripts/kconfig,scripts/kconfig/conf)
$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig scripts/kconfig/conf
./scripts/kconfig/conf -s arch/$(ARCH)/Kconfig
# Generate some files
......@@ -636,13 +636,13 @@ ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
make_with_config
scripts/kconfig/conf scripts/kconfig/mconf scripts/kconfig/qconf: scripts/fixdep FORCE
+@$(call descend,scripts/kconfig,$@)
$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/kconfig $@
xconfig: scripts/kconfig/qconf
./scripts/kconfig/qconf arch/$(ARCH)/Kconfig
menuconfig: scripts/kconfig/mconf
$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts lxdialog
$(Q)$(MAKE) -f scripts/Makefile.build obj=scripts/lxdialog
./scripts/kconfig/mconf arch/$(ARCH)/Kconfig
config: scripts/kconfig/conf
......@@ -824,7 +824,7 @@ else # ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
# ===========================================================================
%:: FORCE
$(MAKE) $@
$(Q)$(MAKE) $@
endif # ifeq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),)
endif # ifdef include_config
......@@ -885,6 +885,6 @@ endef
# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>
descend = $(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
FORCE:
......@@ -66,7 +66,7 @@ drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/
CFLAGS += -Iarch/i386/$(MACHINE)
AFLAGS += -Iarch/i386/$(MACHINE)
makeboot = $(call descend,arch/i386/boot,$(1))
makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/i386/boot $(1)
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper
......@@ -77,20 +77,20 @@ BOOTIMAGE=arch/i386/boot/bzImage
zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage
zImage bzImage: vmlinux
+@$(call makeboot,$(BOOTIMAGE))
$(call makeboot,$(BOOTIMAGE))
compressed: zImage
zlilo bzlilo: vmlinux
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zlilo)
$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zlilo)
zdisk bzdisk: vmlinux
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zdisk)
$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) zdisk)
install: vmlinux
+@$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install)
$(call makeboot,BOOTIMAGE=$(BOOTIMAGE) install)
archclean:
@$(MAKE) -f scripts/Makefile.clean obj=arch/i386/boot
$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/i386/boot
archmrproper:
......@@ -32,12 +32,6 @@ subdir- := compressed
host-progs := tools/build
# Default
boot: bzImage
include $(TOPDIR)/Rules.make
# ---------------------------------------------------------------------------
$(obj)/zImage: IMAGE_OFFSET := 0x1000
......@@ -53,6 +47,7 @@ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/bootsect $(obj)/setup \
$(obj)/zImage $(obj)/bzImage: $(obj)/bootsect $(obj)/setup \
$(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(call if_changed,image)
@echo 'Kernel: $@ is ready'
$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
......@@ -64,9 +59,8 @@ $(obj)/setup $(obj)/bootsect: %: %.o FORCE
$(call if_changed,ld)
$(obj)/compressed/vmlinux: FORCE
+@$(call descend,$(obj)/compressed,IMAGE_OFFSET=$(IMAGE_OFFSET) \
$(obj)/compressed/vmlinux)
$(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed \
IMAGE_OFFSET=$(IMAGE_OFFSET) $@
zdisk: $(BOOTIMAGE)
dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0
......
......@@ -13,6 +13,7 @@ LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup_32
$(obj)/vmlinux: $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld)
@:
$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
......
#
# Makefile for misc devices that really don't fit anywhere else.
#
obj- := misc.o # Dummy rule to force built-in.o to be made
include $(TOPDIR)/Rules.make
......@@ -8,31 +8,12 @@
# docproc: Preprocess .tmpl file in order to generate .sgml documentation
# conmakehash: Create arrays for initializing the kernel console tables
EXTRA_TARGETS := fixdep split-include docproc conmakehash
subdir- := lxdialog kconfig
# Yikes. We need to build this stuff here even if the user only wants
# modules.
KBUILD_BUILTIN := 1
# The following temporary rule will make sure that people's
# trees get updated to the right permissions, since patch(1)
# can't do it
# ---------------------------------------------------------------------------
host-progs := fixdep split-include conmakehash docproc
build-targets := $(host-progs)
include $(TOPDIR)/Rules.make
# ---------------------------------------------------------------------------
# Targets hardcoded and wellknow in top-level makefile
.PHONY: lxdialog
lxdialog:
$(call descend,scripts/lxdialog,)
# Let clean descend into subdirs
subdir- := lxdialog kconfig
# fixdep is needed to compile other host programs
$(obj)/split-include $(obj)/docproc \
$(obj)/conmakehash lxdialog: $(obj)/fixdep
$(obj)/conmakehash: $(obj)/fixdep
......@@ -40,12 +40,14 @@ endif
ifdef L_TARGET
L_TARGET := $(obj)/$(L_TARGET)
else
ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-)),)
O_TARGET := $(obj)/built-in.o
endif
endif
__build: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
$(if $(KBUILD_MODULES),$(obj-m)) \
$(subdir-ym)
$(subdir-ym) $(build-targets)
@:
# Compile C sources (.c)
......@@ -103,7 +105,9 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
$(call if_changed_dep,cc_o_c)
quiet_cmd_cc_lst_c = MKLST $@
cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && sh scripts/makelst $*.o System.map $(OBJDUMP) > $@
cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \
$(CONFIG_SHELL) $(src)/scripts/makelst $*.o \
System.map $(OBJDUMP) > $@
%.lst: %.c FORCE
$(call if_changed_dep,cc_lst_c)
......@@ -116,9 +120,6 @@ modkern_aflags := $(AFLAGS_KERNEL)
$(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE)
$(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
quiet_cmd_as_s_S = CPP $(quiet_modtag) $@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
......@@ -217,9 +218,7 @@ targets += $(multi-used-y) $(multi-used-m)
# Create executable from a single .c file
# host-csingle -> Executable
quiet_cmd_host-csingle = HOSTCC $@
cmd_host-csingle = $(HOSTCC) -Wp,-MD,$(depfile) \
$(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
$(HOST_LOADLIBES) -o $@ $<
cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOST_LOADLIBES) -o $@ $<
$(host-csingle): %: %.c FORCE
$(call if_changed_dep,host-csingle)
......@@ -235,9 +234,7 @@ $(host-cmulti): %: $(host-cobjs) $(host-cshlib) FORCE
# Create .o file from a single .c file
# host-cobjs -> .o
quiet_cmd_host-cobjs = HOSTCC $@
cmd_host-cobjs = $(HOSTCC) -Wp,-MD,$(depfile) \
$(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
$(HOSTCFLAGS_$(@F)) -c -o $@ $<
cmd_host-cobjs = $(HOSTCC) $(hostc_flags) -c -o $@ $<
$(host-cobjs): %.o: %.c FORCE
$(call if_changed_dep,host-cobjs)
......@@ -253,18 +250,14 @@ $(host-cxxmulti): %: $(host-cobjs) $(host-cxxobjs) $(host-cshlib) FORCE
# Create .o file from a single .cc (C++) file
quiet_cmd_host-cxxobjs = HOSTCXX $@
cmd_host-cxxobjs = $(HOSTCXX) -Wp,-MD,$(depfile) \
$(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
$(HOSTCXXFLAGS_$(@F)) -c -o $@ $<
cmd_host-cxxobjs = $(HOSTCXX) $(hostcxx_flags) -c -o $@ $<
$(host-cxxobjs): %.o: %.cc FORCE
$(call if_changed_dep,host-cxxobjs)
# Compile .c file, create position independent .o file
# host-cshobjs -> .o
quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
cmd_host-cshobjs = $(HOSTCC) -Wp,-MD,$(depfile) -fPIC\
$(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
$(HOSTCFLAGS_$(@F)) -c -o $@ $<
cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
$(host-cshobjs): %.o: %.c FORCE
$(call if_changed_dep,host-cshobjs)
......
......@@ -92,6 +92,7 @@ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
# Add subdir path
EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
build-targets := $(addprefix $(obj)/,$(build-targets))
obj-y := $(addprefix $(obj)/,$(obj-y))
obj-m := $(addprefix $(obj)/,$(obj-m))
export-objs := $(addprefix $(obj)/,$(export-objs))
......@@ -128,6 +129,12 @@ modname_flags = -DKBUILD_MODNAME=$(subst $(comma),_,$(subst -,_,$(modname)))
c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \
$(basename_flags) $(modname_flags) $(export_flags)
a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(NOSTDINC_FLAGS)\
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
hostc_flags = -Wp,-MD,$(depfile) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS)\
$(HOSTCFLAGS_$(*F).o)
hostcxx_flags = -Wp,-MD,$(depfile) $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS)\
$(HOSTCXXFLAGS_$(*F).o)
# Finds the multi-part object the current object will be linked into
modname-multi = $(subst $(space),_,$(sort $(foreach m,$(multi-used),\
......@@ -139,7 +146,7 @@ modname-multi = $(subst $(space),_,$(sort $(foreach m,$(multi-used),\
quiet_cmd_shipped = SHIPPED $@
cmd_shipped = cat $< > $@
%:: %_shipped
$(obj)/%:: $(src)/%_shipped
$(call cmd,shipped)
# Commands useful for building a boot image
......@@ -236,4 +243,4 @@ endef
# $(call descend,<dir>,<target>)
# Recursively call a sub-make in <dir> with target <target>
descend = $(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
descend =$(Q)$(MAKE) -f scripts/Makefile.build obj=$(1) $(2)
......@@ -16,18 +16,14 @@ endif
endif
host-progs := lxdialog
build-targets := $(host-progs)
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
util.o lxdialog.o msgbox.o
EXTRA_TARGETS := lxdialog
first_rule: ncurses
include $(TOPDIR)/Rules.make
.PHONY: ncurses
ncurses:
@echo "main() {}" > lxtemp.c
@if $(HOSTCC) lxtemp.c $(HOST_LOADLIBES); then \
......
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