source: freewrt/build.mk@ fa1dc34

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

.config.cmd is not used (I think)

git-svn-id: svn://www.freewrt.org/trunk/freewrt@516 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
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
28world: $(DL_DIR) $(BUILD_DIR) $(STAMP_DIR)
29 ${BASH} ${TOPDIR}/scripts/scan-pkgs.sh
30 $(MAKE) -f build.mk tools/install toolchain/install target/compile package/compile root_clean package/install target/install package_index
31 @$(TRACE) Build complete. See bin/ for the firmware and packages.
32
33package_index:
34 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
35
36$(DL_DIR):
37 @mkdir -p $(DL_DIR)
38
39$(BUILD_DIR):
40 @mkdir -p $(BUILD_DIR)
41
42$(STAMP_DIR):
43 @mkdir -p $(STAMP_DIR)
44
45package/%:
46 @$(TRACE) $@
47 $(MAKE) -C package $(patsubst package/%,%,$@)
48
49target/%:
50 @$(TRACE) $@
51 $(MAKE) -C target $(patsubst target/%,%,$@)
52
53toolchain/%:
54 @$(TRACE) $@
55 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
56
57tools/%:
58 @$(TRACE) $@
59 $(MAKE) -C tools $(patsubst tools/%,%,$@)
60
61#############################################################
62#
63# Cleanup and misc junk
64#
65#############################################################
66root_clean:
67 @$(TRACE) root_clean
68 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
69
70target_clean: root_clean
71 rm -f $(STAMP_DIR)/.*-compile
72 rm -f $(STAMP_DIR)/.*-install
73 rm -rf $(BIN_DIR)
74
75clean:
76 @$(TRACE) clean
77 @$(MAKE) -C $(CONFIG) clean
78 rm -rf $(BUILD_DIR) $(BIN_DIR)
79
80cleandir:
81 @$(TRACE) cleandir
82 @$(MAKE) -C $(CONFIG) clean
83 rm -rf $(BUILD_DIR) $(BIN_DIR)
84 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
85 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
86 rm -f .tmpconfig.h
87
88distclean:
89 @$(TRACE) distclean
90 @$(MAKE) -C $(CONFIG) clean
91 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
92 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
93 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
94 rm -f .config* .tmpconfig.h
95
96else # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
97
98include $(TOPDIR)/lbin/prereq.mk
99
100all: menuconfig
101 @echo "Start the build with \"make\" or with \"make v\" to be verbose"
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
129tools/install-lbin:
130 $(MAKE) -C tools install-lbin
131
132endif # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.