CONFIG_BANNER_STRING ?= "Fiasco - prepare for world domination"
.PHONY: all do-all test-all config textconfig menuconfig xconfig \
- oldconfig regenconfig mrproper doc help update nconfig
+ oldconfig regenconfig mrproper doc help update nconfig \
+ savedefconfig listnewconfig oldnoconfig oldaskconfig
all:
$(foreach m, $(GENERATED_MODULES), auto/stamp-$(m).ready): $(MODULES_FILES)
.PRECIOUS: .Modules.deps
-.Modules.deps: $(MODULES_FILES) globalconfig.h
+.Modules.deps: $(MODULES_FILES) globalconfig.h source
@mkdir -p auto
+ @echo "Cleaning up build directory"
+ $(VERBOSE)$(RM_R) *.o fiasco *.d .*.d .*.d.new *.d.new
+ $(VERBOSE)$(RM_R) auto/*.cc auto/*.h auto/*.S auto/stamp-*.ready
@echo "Creating $@"
@($(foreach mod, $(GENERATED_MODULES), \
echo 'auto/stamp-$(mod).ready: \
%.o %_t: $(MODULES_FILES) .Modules.deps create-sources globalconfig.h
$(MAKE) srcdir=$(srcdir) objbase=$(objbase) -f $(srcdir)/Makefile.sub2 $@
+
# Divert any target we do not explicitly mention in this Makefile to
# Makefile.sub2. (Unfortunately 1, this does not work for file
# targets that already exist in this directory. Unfortunately 2,
auto:
test -e auto || mkdir auto
-BSP_DIR := $(srcdir)/kern/arm/bsp $(srcdir)/kern/ppc32/bsp
+source:
+ test -e source || ln -sf $(srcdir) source
+
+
+BSP_DIR := $(wildcard $(srcdir)/kern/*/bsp)
KCONFIG_FILE := Kconfig
KCONFIG_SRC_FILE := $(srcdir)/Kconfig
KCONFIG_BSP_FILES := $(shell find $(BSP_DIR) -name Kconfig -follow -print)
+KCONFIG_ARCH_FILES := $(wildcard $(srcdir)/kern/*/Kconfig)
kconfig_call = $(MAKE) -C $(tooldir)/kconfig O=$(objbase) \
Kconfig=$(KCONFIG_FILE) \
KCONFIG_AUTOHEADER=globalconfig.h \
- KCONFIG_TRISTATE=config/tristate.conf \
+ KCONFIG_TRISTATE=include/config/tristate.conf \
KCONFIG_CONFIG=globalconfig.out \
- KCONFIG_AUTOCONFIG=config/auto.conf \
+ KCONFIG_AUTOCONFIG=include/config/auto.conf \
KERNELVERSION=SVN MENUCONFIG_COLOR=blackbg \
INCLUDE_PPC32=$(INCLUDE_PPC32) \
+ INCLUDE_SPARC=$(INCLUDE_SPARC) \
fiasco_srcdir=$(srcdir)/..
-$(KCONFIG_FILE): $(KCONFIG_SRC_FILE) $(KCONFIG_BSP_FILES) $(srcdir)/Makefile
- @$(tooldir)/gen_kconfig $(KCONFIG_SRC_FILE) $(KCONFIG_FILE) $(KCONFIG_BSP_FILES)
+$(KCONFIG_FILE): $(KCONFIG_SRC_FILE) $(KCONFIG_BSP_FILES) \
+ $(KCONFIG_ARCH_FILES) $(srcdir)/Makefile
+ @$(tooldir)/gen_kconfig $(KCONFIG_SRC_FILE) $(KCONFIG_FILE) \
+ $(KCONFIG_BSP_FILES) $(KCONFIG_ARCH_FILES)
globalconfig.out: $(KCONFIG_FILE)
- $(kconfig_call) oldconfig
+ +$(kconfig_call) oldconfig
globalconfig.h: globalconfig.out
- $(kconfig_call) silentoldconfig
+ +$(kconfig_call) silentoldconfig
config: $(KCONFIG_FILE)
- $(kconfig_call) menuconfig silentoldconfig
+ +$(kconfig_call) menuconfig
+ +$(kconfig_call) silentoldconfig
textconfig: $(KCONFIG_FILE)
- $(kconfig_call) config silentoldconfig
+ +$(kconfig_call) config silentoldconfig
menuconfig oldconfig xconfig gconfig nconfig randconfig allyesconfig allnoconfig: $(KCONFIG_FILE)
- $(kconfig_call) $@ silentoldconfig
+ +$(kconfig_call) $@
+ +$(kconfig_call) silentoldconfig
+
+listnewconfig olddefconfig oldnoconfig savedefconfig: $(KCONFIG_FILE)
+ +$(kconfig_call) $@
+
+oldaskconfig: $(KCONFIG_FILE)
+ +$(kconfig_call) config
ifneq ($(filter clean cleanall mrproper,$(MAKECMDGOALS)),)
$(RM) .Clean-auto .Compiler-config
cleanall: clean $(foreach subsys, $(SUBSYSTEMS), cleanall-$(subsys))
- $(foreach subdir, $(SUBDIRS), $(RM) $(subdir)/{.,}*.d)
- $(RM) {.,}*.d {.,}*.d.new *~ globalconfig.{h,h.old} Circular
- $(RM) .Modules.deps
+ $(foreach subdir, $(SUBDIRS), $(RM) $(subdir)/*.d $(subdir)/.*.d)
+ $(RM) *.d .*.d .*.d.new *.d.new *~
+ $(RM) globalconfig.h globalconfig.h.old Circular
+ $(RM) .Modules.deps source
mrproper: cleanall
$(RM_R) globalconfig.out Modules.* DEPS*