Commit 80fee71c authored by Sam Ravnborg's avatar Sam Ravnborg

kbuild: Introduced build-targets

build-targets is used to list targets that is always built.
This allowed misuse of EXTRA_TARGETS to be deleted.
built-in.o is now only created for directories defining a obj-* variable,
avoiding this for scripts and lxdialog

One Makefile needed a dummy obj- statement
parent 996fdfdc
...@@ -629,7 +629,7 @@ xconfig: scripts/kconfig/qconf ...@@ -629,7 +629,7 @@ xconfig: scripts/kconfig/qconf
./scripts/kconfig/qconf arch/$(ARCH)/Kconfig ./scripts/kconfig/qconf arch/$(ARCH)/Kconfig
menuconfig: scripts/kconfig/mconf 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 ./scripts/kconfig/mconf arch/$(ARCH)/Kconfig
config: scripts/kconfig/conf config: scripts/kconfig/conf
......
# #
# Makefile for misc devices that really don't fit anywhere else. # 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 include $(TOPDIR)/Rules.make
...@@ -8,31 +8,12 @@ ...@@ -8,31 +8,12 @@
# docproc: Preprocess .tmpl file in order to generate .sgml documentation # docproc: Preprocess .tmpl file in order to generate .sgml documentation
# conmakehash: Create arrays for initializing the kernel console tables # conmakehash: Create arrays for initializing the kernel console tables
EXTRA_TARGETS := fixdep split-include docproc conmakehash host-progs := fixdep split-include conmakehash docproc
build-targets := $(host-progs)
# Let clean descend into subdirs
subdir- := lxdialog kconfig 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
include $(TOPDIR)/Rules.make
# ---------------------------------------------------------------------------
# Targets hardcoded and wellknow in top-level makefile
.PHONY: lxdialog
lxdialog:
$(call descend,scripts/lxdialog,)
# fixdep is needed to compile other host programs # fixdep is needed to compile other host programs
$(obj)/split-include $(obj)/docproc \ $(obj)/split-include $(obj)/docproc \
$(obj)/conmakehash lxdialog: $(obj)/fixdep $(obj)/conmakehash: $(obj)/fixdep
...@@ -40,12 +40,14 @@ endif ...@@ -40,12 +40,14 @@ endif
ifdef L_TARGET ifdef L_TARGET
L_TARGET := $(obj)/$(L_TARGET) L_TARGET := $(obj)/$(L_TARGET)
else else
ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-)),)
O_TARGET := $(obj)/built-in.o O_TARGET := $(obj)/built-in.o
endif endif
endif
__build: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \ __build: $(if $(KBUILD_BUILTIN),$(O_TARGET) $(L_TARGET) $(EXTRA_TARGETS)) \
$(if $(KBUILD_MODULES),$(obj-m)) \ $(if $(KBUILD_MODULES),$(obj-m)) \
$(subdir-ym) $(subdir-ym) $(build-targets)
@: @:
# Compile C sources (.c) # Compile C sources (.c)
......
...@@ -92,6 +92,7 @@ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) ...@@ -92,6 +92,7 @@ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
# Add subdir path # Add subdir path
EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS)) EXTRA_TARGETS := $(addprefix $(obj)/,$(EXTRA_TARGETS))
build-targets := $(addprefix $(obj)/,$(build-targets))
obj-y := $(addprefix $(obj)/,$(obj-y)) obj-y := $(addprefix $(obj)/,$(obj-y))
obj-m := $(addprefix $(obj)/,$(obj-m)) obj-m := $(addprefix $(obj)/,$(obj-m))
export-objs := $(addprefix $(obj)/,$(export-objs)) export-objs := $(addprefix $(obj)/,$(export-objs))
......
...@@ -15,19 +15,15 @@ endif ...@@ -15,19 +15,15 @@ endif
endif endif
endif endif
host-progs := lxdialog host-progs := lxdialog
build-targets := $(host-progs)
lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \ lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \
util.o lxdialog.o msgbox.o util.o lxdialog.o msgbox.o
EXTRA_TARGETS := lxdialog
first_rule: ncurses first_rule: ncurses
include $(TOPDIR)/Rules.make
.PHONY: ncurses .PHONY: ncurses
ncurses: ncurses:
@echo "main() {}" > lxtemp.c @echo "main() {}" > lxtemp.c
@if $(HOSTCC) lxtemp.c $(HOST_LOADLIBES); then \ @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