source: freewrt/Makefile@ 475ad56

freewrt_1_0 freewrt_2_0
Last change on this file since 475ad56 was 475ad56, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

add OpenWrt trunk revision 3830.

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

  • Property mode set to 100644
File size: 4.5 KB
Line 
1# Makefile for OpenWrt
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_DEFCONFIG = .defconfig
34CONFIG = package/config
35
36noconfig_targets := menuconfig config oldconfig randconfig \
37 defconfig allyesconfig allnoconfig tags
38
39# Pull in the user's configuration file
40ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
41-include $(TOPDIR)/.config
42endif
43
44ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
45include $(TOPDIR)/rules.mk
46
47all: world
48
49.NOTPARALLEL:
50.PHONY: all world clean dirclean distclean image_clean target_clean source configtest
51
52#############################################################
53#
54# You should probably leave this stuff alone unless you know
55# what you are doing.
56#
57#############################################################
58
59# In this section, we need .config
60include .config.cmd
61
62world: $(DL_DIR) $(BUILD_DIR) configtest
63 $(MAKE) toolchain/install target/compile package/compile root_clean package/install target/install package_index
64 @$(TRACE) Build complete.
65
66configtest:
67 -cp .config .config.test
68 -scripts/configtest.pl
69
70package_index:
71 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
72
73$(DL_DIR):
74 @mkdir -p $(DL_DIR)
75
76$(BUILD_DIR):
77 @mkdir -p $(BUILD_DIR)
78
79source: toolchain/source package/source target/source
80
81package/%:
82 @$(TRACE) $@
83 $(MAKE) -C package $(patsubst package/%,%,$@)
84
85target/%:
86 @$(TRACE) $@
87 $(MAKE) -C target $(patsubst target/%,%,$@)
88
89toolchain/%:
90 @$(TRACE) $@
91 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
92
93#############################################################
94#
95# Cleanup and misc junk
96#
97#############################################################
98root_clean:
99 @$(TRACE) root_clean
100 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
101
102target_clean: root_clean
103 rm -f $(STAMP_DIR)/.*-compile
104 rm -f $(STAMP_DIR)/.*-install
105 rm -rf $(BIN_DIR)
106
107clean: dirclean
108
109dirclean:
110 @$(TRACE) dirclean
111 @$(MAKE) -C $(CONFIG) clean
112 rm -rf $(BUILD_DIR)
113
114distclean: dirclean
115 rm -rf $(STAMP_DIR) $(DL_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
116 rm -f .config* .tmpconfig.h
117
118else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
119
120all: menuconfig
121
122# configuration
123# ---------------------------------------------------------------------------
124
125$(CONFIG)/conf:
126 $(MAKE) -C $(CONFIG) conf
127 -@if [ ! -f .config ] ; then \
128 cp $(CONFIG_DEFCONFIG) .config; \
129 fi
130$(CONFIG)/mconf:
131 $(MAKE) -C $(CONFIG)
132 -@if [ ! -f .config ] ; then \
133 cp $(CONFIG_DEFCONFIG) .config; \
134 fi
135
136menuconfig: $(CONFIG)/mconf
137 -touch .config
138 -cp .config .config.test
139 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
140 -./scripts/configtest.pl
141
142config: $(CONFIG)/conf
143 -touch .config
144 -cp .config .config.test
145 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
146 -./scripts/configtest.pl
147
148oldconfig: $(CONFIG)/conf
149 -touch .config
150 -cp .config .config.test
151 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
152 -./scripts/configtest.pl
153
154randconfig: $(CONFIG)/conf
155 -touch .config
156 -cp .config .config.test
157 @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
158 -./scripts/configtest.pl
159
160allyesconfig: $(CONFIG)/conf
161 -touch .config
162 -cp .config .config.test
163 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
164 -./scripts/configtest.pl
165
166allnoconfig: $(CONFIG)/conf
167 -touch .config
168 -cp .config .config.test
169 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
170 -./scripts/configtest.pl
171
172defconfig: $(CONFIG)/conf
173 -touch .config
174 -cp .config .config.test
175 @$(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
176 -./scripts/configtest.pl
177
178endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.