move busybox init scripts from base-files into the busybox package and make them...
[openwrt.git] / include / kernel-build.mk
index e491e48..8462319 100644 (file)
@@ -6,6 +6,28 @@
 #
 KERNEL_BUILD:=1
 
 #
 KERNEL_BUILD:=1
 
+include $(INCLUDE_DIR)/prereq.mk
+
+-include ./config
+ifneq ($(CONFIG_ATM),)
+  FEATURES += atm
+endif
+ifneq ($(CONFIG_PCI),)
+  FEATURES += pci
+endif
+ifneq ($(CONFIG_USB),)
+  FEATURES += usb
+endif
+ifneq ($(CONFIG_PCMCIA),)
+  FEATURES += pcmcia
+endif
+
+# remove duplicates
+FEATURES:=$(sort $(FEATURES))
+
+# For target profile selection - the default set
+DEFAULT_PACKAGES:=base-files libgcc uclibc bridge busybox dnsmasq dropbear iptables mtd ppp ppp-mod-pppoe mtd
+
 ifeq ($(DUMP),1)
   all: dumpinfo
 else
 ifeq ($(DUMP),1)
   all: dumpinfo
 else
@@ -146,41 +168,59 @@ define BuildKernel
   mostlyclean: FORCE
        $(call Kernel/Clean)
 
   mostlyclean: FORCE
        $(call Kernel/Clean)
 
+  ifeq ($(DUMP),1)
+    dumpinfo:
+               @echo 'Target: $(BOARD)-$(KERNEL)'
+               @echo 'Target-Name: $(BOARDNAME) [$(KERNEL)]'
+               @echo 'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'
+               @echo 'Target-Arch: $(ARCH)'
+               @echo 'Target-Features: $(FEATURES)'
+               @echo 'Linux-Version: $(LINUX_VERSION)'
+               @echo 'Linux-Release: $(LINUX_RELEASE)'
+               @echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'
+               @echo 'Target-Description:'
+               @getvar $(call shvar,Target/Description)
+               @echo '@@'
+               @echo 'Default-Packages: $(DEFAULT_PACKAGES)'
+    ifneq ($(DUMPINFO),)
+               @$(DUMPINFO)
+    endif
+  endif
+
   define BuildKernel
   endef
 endef
 
   define BuildKernel
   endef
 endef
 
+define Profile/Default
+  NAME:=
+  PACKAGES:=
+endef
+
+define Profile
+  $(eval $(call Profile/Default))
+  $(eval $(call Profile/$(1)))
+  DUMPINFO += \
+       echo "Target-Profile: $(1)"; \
+       echo "Target-Profile-Name: $(NAME)"; \
+       echo "Target-Profile-Packages: $(PACKAGES)"; 
+endef
+
 $(eval $(call shexport,Target/Description))
 
 $(eval $(call shexport,Target/Description))
 
-ifeq ($(DUMP),1)
-  dumpinfo:
-       @echo 'Target: $(BOARD)-$(KERNEL)'
-       @echo 'Target-Name: $(BOARDNAME) [$(KERNEL)]'
-       @echo 'Target-Path: $(subst $(TOPDIR)/,,$(PWD))'
-       @echo 'Target-Arch: $(ARCH)'
-       @echo 'Target-Features: $(FEATURES)'
-       @echo 'Linux-Version: $(LINUX_VERSION)'
-       @echo 'Linux-Release: $(LINUX_RELEASE)'
-       @echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'
-       @echo 'Target-Description:'
-       @echo "$$$(call shvar,Target/Description)"
-       @echo '@@'
-else
-  download: $(DL_DIR)/$(LINUX_SOURCE)
-  prepare: $(LINUX_DIR)/.configured $(TMP_DIR)/.kernel.mk
-  compile: $(LINUX_DIR)/.modules
-  install: $(LINUX_DIR)/.image
+download: $(DL_DIR)/$(LINUX_SOURCE)
+prepare: $(LINUX_DIR)/.configured $(TMP_DIR)/.kernel.mk
+compile: $(LINUX_DIR)/.modules
+install: $(LINUX_DIR)/.image
 
 
-  clean: FORCE
+clean: FORCE
        rm -f $(STAMP_DIR)/.linux-compile
        rm -rf $(KERNEL_BUILD_DIR)
 
        rm -f $(STAMP_DIR)/.linux-compile
        rm -rf $(KERNEL_BUILD_DIR)
 
-  rebuild: FORCE
+rebuild: FORCE
        @$(MAKE) mostlyclean
        @if [ -f $(LINUX_KERNEL) ]; then \
                $(MAKE) clean; \
        fi
        @$(MAKE) compile
        @$(MAKE) mostlyclean
        @if [ -f $(LINUX_KERNEL) ]; then \
                $(MAKE) clean; \
        fi
        @$(MAKE) compile
-endif
 
 
 
 
This page took 0.022691 seconds and 4 git commands to generate.