source: freewrt/mk/build.mk@ 6fc4520e

freewrt_1_0 freewrt_2_0
Last change on this file since 6fc4520e was 4111e0f, checked in by Thorsten Glaser <tg@…>, 19 years ago

PR #86

git-svn-id: svn://www.freewrt.org/trunk/freewrt@702 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/licence 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
19
20ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
21include $(TOPDIR)/rules.mk
22
23all: world
24
25.NOTPARALLEL:
26.PHONY: all world clean cleandir distclean image_clean target_clean
27
28# In this section, we need .config
29include .config.cmd
30
31world: $(DL_DIR) $(BUILD_DIR) $(STAMP_DIR)
32 ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
33 $(MAKE) -f mk/build.mk tools/install toolchain/install target/compile package/compile root_clean package/install target/install package_index
34
35package_index:
36 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
37
38$(DL_DIR):
39 @mkdir -p $(DL_DIR)
40
41$(BUILD_DIR):
42 @mkdir -p $(BUILD_DIR)
43
44$(STAMP_DIR):
45 @mkdir -p $(STAMP_DIR)
46
47package/%:
48 @$(TRACE) $@
49 $(MAKE) -C package $(patsubst package/%,%,$@)
50
51target/%:
52 @$(TRACE) $@
53 $(MAKE) -C target $(patsubst target/%,%,$@)
54
55toolchain/%:
56 @$(TRACE) $@
57 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
58
59tools/%:
60 @$(TRACE) $@
61 $(MAKE) -C tools $(patsubst tools/%,%,$@)
62
63#############################################################
64#
65# Cleanup and misc junk
66#
67#############################################################
68root_clean:
69 @$(TRACE) root_clean
70 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
71
72target_clean: root_clean
73 rm -f $(STAMP_DIR)/.*-compile
74 rm -f $(STAMP_DIR)/.*-install
75 rm -rf $(BIN_DIR)
76
77clean:
78 @$(TRACE) clean
79 @$(MAKE) -C $(CONFIG) clean
80 rm -rf $(BUILD_DIR) $(BIN_DIR)
81
82cleandir:
83 @$(TRACE) cleandir
84 @$(MAKE) -C $(CONFIG) clean
85 rm -rf $(BUILD_DIR) $(BIN_DIR)
86 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
87 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
88 rm -f .tmpconfig.h
89
90distclean:
91 @$(TRACE) distclean
92 @$(MAKE) -C $(CONFIG) clean
93 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
94 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
95 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
96 rm -f .config* .tmpconfig.h
97
98else # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
99
100include $(TOPDIR)/lbin/prereq.mk
101
102all: menuconfig
103 @echo "Start the build with \"make\" or with \"make v\" to be verbose"
104
105# configuration
106# ---------------------------------------------------------------------------
107
108$(CONFIG)/conf:
109 @$(MAKE) -C $(CONFIG) conf
110$(CONFIG)/mconf:
111 @$(MAKE) -C $(CONFIG)
112
113menuconfig: $(CONFIG)/mconf
114 @-touch .config
115 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
116
117config: $(CONFIG)/conf
118 @-touch .config
119 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
120
121oldconfig: $(CONFIG)/conf
122 @-touch .config
123 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
124
125autobuild: $(CONFIG)/conf
126 @-touch .config
127 @$(CONFIG)/conf -m $(CONFIG_CONFIG_IN)
128 @grep -v ^BUSYBOX .config > .config.autobuild
129 @cat .busybox-config .config.autobuild > .config
130
131tools/install-lbin:
132 $(MAKE) -C tools install-lbin
133
134endif # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.