3 # Copyright (C) 2005 by Felix Fietkau <openwrt@nbd.name>
4 # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #--------------------------------------------------------------
22 # Just run 'make menuconfig', configure stuff, then run 'make'.
23 # You shouldn't need to mess with anything beyond this point...
24 #--------------------------------------------------------------
29 CONFIG_CONFIG_IN = Config.in.devel
31 CONFIG_CONFIG_IN = Config.in
33 CONFIG_DEFCONFIG = .defconfig
34 CONFIG = package/config
36 noconfig_targets := menuconfig config oldconfig randconfig \
37 defconfig allyesconfig allnoconfig release tags
39 # Pull in the user's configuration file
40 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
41 -include $(TOPDIR)/.config
44 ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
45 include $(TOPDIR)/rules.mk
51 #############################################################
53 # You should probably leave this stuff alone unless you know
56 #############################################################
58 # In this section, we need .config
61 world: $(DL_DIR) $(BUILD_DIR) configtest
62 $(MAKE) toolchain/install target/compile package/compile root_clean package/install target/install package_index
64 .PHONY: all world clean dirclean distclean image_clean target_clean source configtest
67 -cp .config .config.test
68 -scripts/configtest.pl
71 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
77 @mkdir -p $(BUILD_DIR)
79 source: toolchain/source package/source target/source
83 $(MAKE) -C package $(patsubst package/%,%,$@)
87 $(MAKE) -C target $(patsubst target/%,%,$@)
91 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
93 #############################################################
95 # Cleanup and misc junk
97 #############################################################
100 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
102 target_clean: root_clean
103 rm -f $(STAMP_DIR)/.*-compile
104 rm -f $(STAMP_DIR)/.*-install
110 @$(TRACE) Cleaning...
111 @$(MAKE) -C $(CONFIG) clean
115 rm -rf $(STAMP_DIR) $(DL_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
116 rm -f .config* .tmpconfig.h
118 else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
123 # ---------------------------------------------------------------------------
126 $(MAKE) -C $(CONFIG) conf
127 -@if [ ! -f .config ] ; then \
128 cp $(CONFIG_DEFCONFIG) .config; \
132 -@if [ ! -f .config ] ; then \
133 cp $(CONFIG_DEFCONFIG) .config; \
136 menuconfig: $(CONFIG)/mconf
138 -cp .config .config.test
139 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
140 -./scripts/configtest.pl
142 config: $(CONFIG)/conf
144 -cp .config .config.test
145 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
146 -./scripts/configtest.pl
148 oldconfig: $(CONFIG)/conf
150 -cp .config .config.test
151 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
152 -./scripts/configtest.pl
154 randconfig: $(CONFIG)/conf
156 -cp .config .config.test
157 @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
158 -./scripts/configtest.pl
160 allyesconfig: $(CONFIG)/conf
162 -cp .config .config.test
163 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
164 -./scripts/configtest.pl
166 allnoconfig: $(CONFIG)/conf
168 -cp .config .config.test
169 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
170 -./scripts/configtest.pl
172 defconfig: $(CONFIG)/conf
174 -cp .config .config.test
175 @$(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
176 -./scripts/configtest.pl
178 endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
180 .PHONY: dummy subdirs release distclean clean config oldconfig \
181 menuconfig tags check test depend