]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/Makefile
update
[l4.git] / kernel / fiasco / src / Makefile
index b23b5fd7fd0d1b3bd37f0872ab9fc90c2c50d5c1..428b9a056c3cc64e7e1b876829ad5aa10f7f7d0d 100644 (file)
@@ -4,7 +4,8 @@ tooldir         := $(srcdir)/../tool
 CONFIG_BANNER_STRING ?= "Fiasco - prepare for world domination"
 
 .PHONY: all do-all test-all config textconfig menuconfig xconfig \
-        oldconfig regenconfig mrproper doc help update
+        oldconfig regenconfig mrproper doc help update nconfig \
+        savedefconfig listnewconfig oldnoconfig oldaskconfig
 
 all:
 
@@ -84,6 +85,7 @@ else # ! no ABI
 include $(srcdir)/Makeconf
 
 include $(MODULES_FILE)
+MODULES_FILES += $(srcdir)/Modules.generic
 
 ifdef SUBSYSTEMS
  _modules_read_ = true
@@ -97,8 +99,11 @@ ALL = $(foreach subsys, $(SUBSYSTEMS), $($(subsys)) $($(subsys)_EXTRA))
 $(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:                              \
@@ -140,10 +145,14 @@ DEPS_FILES=DEPS DEPS.a4 DEPS.tred
 #
 # Makefile.sub2: Create everything else.
 #
-all doc $(addsuffix .ps,$(DEPS_FILES)) $(addsuffix .svg,$(DEPS_FILES)) TAGS tags %.o %_t: \
+all doc $(addsuffix .ps,$(DEPS_FILES)) $(addsuffix .svg,$(DEPS_FILES)) TAGS tags: \
   $(MODULES_FILES) .Modules.deps create-sources globalconfig.h
        $(MAKE) srcdir=$(srcdir) objbase=$(objbase) -f $(srcdir)/Makefile.sub2 $@
 
+%.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,
@@ -155,7 +164,8 @@ all doc $(addsuffix .ps,$(DEPS_FILES)) $(addsuffix .svg,$(DEPS_FILES)) TAGS tags
 
 # Well, we need to provide some empty rules for some targets to
 # prevent the above catch-all from running amok.
-Makerules.local $(srcdir)/Makeconf.local $(objbase)/Makeconf.local : ;
+Makerules.local $(srcdir)/Makeconf.local $(objbase)/Makeconf.local \
+   $(objbase)/.Host-config: ;
 
 %: %.o                         # delete implicit rule
 
@@ -166,7 +176,11 @@ endif # ! config xconfig menuconfig oldconfig
 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            := $(srcdir)/kern/arm/bsp $(srcdir)/kern/ppc32/bsp $(srcdir)/kern/sparc/bsp
 KCONFIG_FILE       := Kconfig
 KCONFIG_SRC_FILE   := $(srcdir)/Kconfig
 KCONFIG_BSP_FILES  := $(shell find $(BSP_DIR) -name Kconfig -follow -print)
@@ -179,25 +193,32 @@ kconfig_call = $(MAKE) -C $(tooldir)/kconfig O=$(objbase) \
               KCONFIG_AUTOCONFIG=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)
 
 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 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
+
+listnewconfig oldnoconfig savedefconfig: $(KCONFIG_FILE)
+       +$(kconfig_call) $@
 
-menuconfig oldconfig xconfig qconfig gconfig randconfig allyesconfig allnoconfig: $(KCONFIG_FILE)
-       $(kconfig_call) $@ silentoldconfig
+oldaskconfig: $(KCONFIG_FILE)
+       +$(kconfig_call) config
 
 ifneq ($(filter clean cleanall mrproper,$(MAKECMDGOALS)),)
 
@@ -220,9 +241,10 @@ clean: $(foreach subsys, $(SUBSYSTEMS), clean-$(subsys))
        $(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*