source: freewrt/mk/build.mk@ 3fdeb56

historic/freewrt_1_0_1
Last change on this file since 3fdeb56 was 2e6e232, checked in by Thorsten Glaser <tg@…>, 19 years ago

smallest possible fix for the bug reported in
Message-ID: <45ADE560.1010806@…>

this is fixed differently in trunk

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@1625 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 3.5 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 allnoconfig allmodconfig snapshotconfig
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 cleanbuild cleandir distclean image_clean target_clean allpackages
27
28# In this section, we need .config
29-include .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
35allpackages: $(DL_DIR) $(BUILD_DIR) $(STAMP_DIR)
36 $(MAKE) -f mk/build.mk package/compile
37
38package_index:
39 (cd $(PACKAGE_DIR); $(TOPDIR)/scripts/ipkg-make-index.sh . > Packages)
40
41$(DL_DIR):
42 @mkdir -p $(DL_DIR)
43
44$(BUILD_DIR):
45 @mkdir -p $(BUILD_DIR)
46
47$(STAMP_DIR):
48 @mkdir -p $(STAMP_DIR)
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
85cleanbuild:
86 @$(TRACE) clean
87 rm -rf $(BUILD_DIR)
88
89cleandir:
90 @$(TRACE) cleandir
91 @$(MAKE) -C $(CONFIG) clean
92 rm -rf $(BUILD_DIR) $(BIN_DIR)
93 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
94 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
95 rm -f .tmpconfig.h
96
97distclean:
98 @$(TRACE) distclean
99 @$(MAKE) -C $(CONFIG) clean
100 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
101 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
102 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
103 rm -f .config* .tmpconfig.h
104
105else # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
106
107include $(TOPDIR)/lbin/prereq.mk
108
109all: menuconfig
110 @echo "Start the build with \"make\" or with \"make v\" to be verbose"
111
112# configuration
113# ---------------------------------------------------------------------------
114
115$(CONFIG)/conf:
116 @$(MAKE) -C $(CONFIG) conf
117$(CONFIG)/mconf:
118 @$(MAKE) -C $(CONFIG)
119
120menuconfig: $(CONFIG)/mconf
121 @-touch .config
122 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
123
124config: $(CONFIG)/conf
125 @-touch .config
126 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
127
128allnoconfig: $(CONFIG)/conf
129 @-touch .config
130 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
131
132# add patterns for config symbols to always restore from default here
133RESTORE_PATTERNS := BUSYBOX
134allmodconfig: $(CONFIG)/conf
135 @$(CONFIG)/conf -m $(CONFIG_CONFIG_IN)
136 scripts/restore-defaultconf.sh $(RESTORE_PATTERNS)
137
138snapshotconfig: $(CONFIG)/conf
139 @$(CONFIG)/conf -m Config.in.snapshot
140 scripts/restore-defaultconf.sh $(RESTORE_PATTERNS)
141
142tools/install-lbin:
143 $(MAKE) -C tools install-lbin
144
145endif # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.