source: freewrt/build.mk@ 4ea6595

freewrt_1_0 freewrt_2_0
Last change on this file since 4ea6595 was 4ea6595, checked in by Thorsten Glaser <tg@…>, 20 years ago

change target distclean to also remove the download area
(distclean = "as clean as if we were making a distfile")

new target cleandir removes everything removed by distclean
except the configuration and downloaded distfiles
(cleandir = clean + toolchain directories)

removed target dirclean, replaced by ordinary clean target
(clean = clean packages, bindir, builddir)

ok wbx@

git-svn-id: svn://www.freewrt.org/trunk/freewrt@46 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 4.4 KB
Line 
1# Makefile for FreeWRT development environment
2#
3# Copyright (C) 2005 by Felix Fietkau <openwrt@nbd.name>
4# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
5#
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.
10#
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.
15#
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
19#
20
21#--------------------------------------------------------------
22# Just run 'make menuconfig', configure stuff, then run 'make'.
23# You shouldn't need to mess with anything beyond this point...
24#--------------------------------------------------------------
25TOPDIR=${shell pwd}
26export TOPDIR
27
28ifneq ($(DEVELOPER),)
29CONFIG_CONFIG_IN = Config.in.devel
30else
31CONFIG_CONFIG_IN = Config.in
32endif
33CONFIG = package/config
34
35noconfig_targets := menuconfig config oldconfig randconfig \
36 allyesconfig allnoconfig tags
37
38# Pull in the user's configuration file
39ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
40-include $(TOPDIR)/.config
41endif
42
43ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
44include $(TOPDIR)/rules.mk
45
46all: world
47
48.NOTPARALLEL:
49.PHONY: all world clean cleandir distclean image_clean target_clean source configtest
50
51#############################################################
52#
53# You should probably leave this stuff alone unless you know
54# what you are doing.
55#
56#############################################################
57
58# In this section, we need .config
59include .config.cmd
60
61world: $(DL_DIR) $(BUILD_DIR) configtest
62 $(MAKE) -f build.mk toolchain/install target/compile package/compile root_clean package/install target/install package_index
63 @$(TRACE) Build complete.
64
65configtest:
66 -cp .config .config.test
67 -scripts/configtest.pl
68
69package_index:
70 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
71
72$(DL_DIR):
73 @mkdir -p $(DL_DIR)
74
75$(BUILD_DIR):
76 @mkdir -p $(BUILD_DIR)
77
78source: toolchain/source package/source target/source
79
80package/%:
81 @$(TRACE) $@
82 $(MAKE) -C package $(patsubst package/%,%,$@)
83
84target/%:
85 @$(TRACE) $@
86 $(MAKE) -C target $(patsubst target/%,%,$@)
87
88toolchain/%:
89 @$(TRACE) $@
90 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
91
92#############################################################
93#
94# Cleanup and misc junk
95#
96#############################################################
97root_clean:
98 @$(TRACE) root_clean
99 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
100
101target_clean: root_clean
102 rm -f $(STAMP_DIR)/.*-compile
103 rm -f $(STAMP_DIR)/.*-install
104 rm -rf $(BIN_DIR)
105
106clean:
107 @$(TRACE) clean
108 @$(MAKE) -C $(CONFIG) clean
109 rm -rf $(BUILD_DIR) $(BIN_DIR)
110
111cleandir:
112 @$(TRACE) cleandir
113 @$(MAKE) -C $(CONFIG) clean
114 rm -rf $(BUILD_DIR) $(BIN_DIR)
115 rm -rf $(STAMP_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
116 rm -f .tmpconfig.h
117
118distclean:
119 @$(TRACE) distclean
120 @$(MAKE) -C $(CONFIG) clean
121 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
122 rm -rf $(STAMP_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
123 rm -f .config* .tmpconfig.h
124
125else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
126
127all: menuconfig
128
129# configuration
130# ---------------------------------------------------------------------------
131
132$(CONFIG)/conf:
133 $(MAKE) -C $(CONFIG) conf
134$(CONFIG)/mconf:
135 $(MAKE) -C $(CONFIG)
136
137menuconfig: $(CONFIG)/mconf
138 -touch .config
139 -cp .config .config.test
140 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
141 -./scripts/configtest.pl
142
143config: $(CONFIG)/conf
144 -touch .config
145 -cp .config .config.test
146 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
147 -./scripts/configtest.pl
148
149oldconfig: $(CONFIG)/conf
150 -touch .config
151 -cp .config .config.test
152 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
153 -./scripts/configtest.pl
154
155randconfig: $(CONFIG)/conf
156 -touch .config
157 -cp .config .config.test
158 @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
159 -./scripts/configtest.pl
160
161allyesconfig: $(CONFIG)/conf
162 -touch .config
163 -cp .config .config.test
164 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
165 -./scripts/configtest.pl
166
167allnoconfig: $(CONFIG)/conf
168 -touch .config
169 -cp .config .config.test
170 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
171 -./scripts/configtest.pl
172
173endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.