source: freewrt/build.mk@ 0669c54

freewrt_1_0 freewrt_2_0
Last change on this file since 0669c54 was 5a54ece, checked in by Thorsten Glaser <tg@…>, 19 years ago

V wasn't effective there

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

  • Property mode set to 100644
File size: 3.2 KB
Line 
1# $FreeWRT$
2#-
3# This file is part of the FreeWRT project. FreeWRT is copyrighted
4# material, please see the LICENCE file in the top-level directory
5# or at http://www.freewrt.org/license for details.
6
7TOPDIR=${shell pwd}
8export TOPDIR
9
10CONFIG_CONFIG_IN = Config.in
11CONFIG = package/config
12
13noconfig_targets := menuconfig config tags autobuild
14
15# Pull in the user's configuration file
16ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
17-include $(TOPDIR)/.config
18endif
19ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
20else
21V:=99
22endif
23include $(TOPDIR)/rules.mk
24
25ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
26all: world
27
28.NOTPARALLEL:
29.PHONY: all world clean cleandir distclean image_clean target_clean
30
31world: $(DL_DIR) $(BUILD_DIR) $(STAMP_DIR)
32 ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
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. See bin/ for the firmware and packages.
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
48package/%:
49 @$(TRACE) $@
50 $(MAKE) -C package $(patsubst package/%,%,$@)
51
52target/%:
53 @$(TRACE) $@
54 $(MAKE) -C target $(patsubst target/%,%,$@)
55
56toolchain/%:
57 @$(TRACE) $@
58 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
59
60tools/%:
61 @$(TRACE) $@
62 $(MAKE) -C tools $(patsubst tools/%,%,$@)
63
64#############################################################
65#
66# Cleanup and misc junk
67#
68#############################################################
69root_clean:
70 @$(TRACE) root_clean
71 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
72
73target_clean: root_clean
74 rm -f $(STAMP_DIR)/.*-compile
75 rm -f $(STAMP_DIR)/.*-install
76 rm -rf $(BIN_DIR)
77
78cleandir:
79 @$(TRACE) cleandir
80 @$(MAKE) -C $(CONFIG) clean
81 rm -rf $(BUILD_DIR) $(BIN_DIR)
82 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
83 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
84 rm -f .tmpconfig.h
85
86distclean:
87 @$(TRACE) distclean
88 @$(MAKE) -C $(CONFIG) clean
89 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
90 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
91 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
92 rm -f .config* .tmpconfig.h
93
94else # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
95all: menuconfig
96 @echo "Start the build with \"make\" or with \"make v\" to be verbose"
97
98tools/install-lbin:
99 $(MAKE) -C tools install-lbin
100
101endif # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
102
103# configuration
104# ---------------------------------------------------------------------------
105
106$(CONFIG)/conf:
107 @$(MAKE) -C $(CONFIG) conf >/dev/null 2>&1
108$(CONFIG)/mconf:
109 @$(MAKE) -C $(CONFIG) >/dev/null 2>&1
110
111menuconfig: $(CONFIG)/mconf
112 @-touch .config
113 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
114
115config: $(CONFIG)/conf
116 @-touch .config
117 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
118
119oldconfig: $(CONFIG)/conf
120 @-touch .config
121 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
122
123autobuild: $(CONFIG)/conf
124 @-touch .config
125 @$(CONFIG)/conf -m $(CONFIG_CONFIG_IN)
126 @grep -v ^BUSYBOX .config > .config.autobuild
127 @cat .busybox-config .config.autobuild > .config
128
129clean:
130 @$(TRACE) clean
131 @$(MAKE) -C $(CONFIG) clean
132 rm -rf $(BUILD_DIR) $(BIN_DIR)
Note: See TracBrowser for help on using the repository browser.