source: freewrt/build.mk@ 131a9d7

freewrt_1_0 freewrt_2_0
Last change on this file since 131a9d7 was 131a9d7, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

move tools like sed, trx, lzma, which does not belong to the toolchain (gcc,binutils,gdb,libc) to a separate directory, all stuff is compiled with the host compiler

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

  • Property mode set to 100644
File size: 3.3 KB
Line 
1# $Id$
2#--------------------------------------------------------------
3# Just run 'make menuconfig', configure stuff, then run 'make'.
4# You shouldn't need to mess with anything beyond this point...
5#--------------------------------------------------------------
6
7TOPDIR=${shell pwd}
8export TOPDIR
9
10CONFIG_CONFIG_IN = Config.in
11CONFIG = package/config
12
13noconfig_targets := menuconfig config oldconfig randconfig \
14 allyesconfig allnoconfig tags
15
16# Pull in the user's configuration file
17ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
18-include $(TOPDIR)/.config
19endif
20
21ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
22include $(TOPDIR)/rules.mk
23
24all: world
25
26.NOTPARALLEL:
27.PHONY: all world clean cleandir distclean image_clean target_clean source
28
29# In this section, we need .config
30include .config.cmd
31
32world: $(DL_DIR) $(BUILD_DIR) $(STAMP_DIR)
33 $(MAKE) -f build.mk tools/install toolchain/install target/compile package/compile root_clean package/install target/install package_index
34 @$(TRACE) Build complete.
35
36package_index:
37 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
38
39$(DL_DIR):
40 @mkdir -p $(DL_DIR)
41
42$(BUILD_DIR):
43 @mkdir -p $(BUILD_DIR)
44
45$(STAMP_DIR):
46 @mkdir -p $(STAMP_DIR)
47
48source: tools/source toolchain/source package/source target/source
49
50package/%:
51 @$(TRACE) $@
52 $(MAKE) -C package $(patsubst package/%,%,$@)
53
54target/%:
55 @$(TRACE) $@
56 $(MAKE) -C target $(patsubst target/%,%,$@)
57
58toolchain/%:
59 @$(TRACE) $@
60 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
61
62tools/%:
63 @$(TRACE) $@
64 $(MAKE) -C tools $(patsubst tools/%,%,$@)
65
66#############################################################
67#
68# Cleanup and misc junk
69#
70#############################################################
71root_clean:
72 @$(TRACE) root_clean
73 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
74
75target_clean: root_clean
76 rm -f $(STAMP_DIR)/.*-compile
77 rm -f $(STAMP_DIR)/.*-install
78 rm -rf $(BIN_DIR)
79
80clean:
81 @$(TRACE) clean
82 @$(MAKE) -C $(CONFIG) clean
83 rm -rf $(BUILD_DIR) $(BIN_DIR)
84
85cleandir:
86 @$(TRACE) cleandir
87 @$(MAKE) -C $(CONFIG) clean
88 rm -rf $(BUILD_DIR) $(BIN_DIR)
89 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
90 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
91 rm -f .tmpconfig.h
92
93distclean:
94 @$(TRACE) distclean
95 @$(MAKE) -C $(CONFIG) clean
96 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
97 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
98 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
99 rm -f .config* .tmpconfig.h
100
101else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
102
103include $(TOPDIR)/lbin/prereq.mk
104
105all: menuconfig
106 @echo "Start the build with \"make\" or with \"make v\" to be verbose"
107
108# configuration
109# ---------------------------------------------------------------------------
110
111$(CONFIG)/conf:
112 $(MAKE) -C $(CONFIG) conf
113$(CONFIG)/mconf:
114 $(MAKE) -C $(CONFIG)
115
116menuconfig: $(CONFIG)/mconf
117 -touch .config
118 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
119
120config: $(CONFIG)/conf
121 -touch .config
122 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
123
124oldconfig: $(CONFIG)/conf
125 -touch .config
126 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
127
128randconfig: $(CONFIG)/conf
129 -touch .config
130 @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
131
132allyesconfig: $(CONFIG)/conf
133 -touch .config
134 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
135
136allnoconfig: $(CONFIG)/conf
137 -touch .config
138 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
139
140endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.