source: freewrt/build.mk@ d98165f

Last change on this file since d98165f was 79128b4, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

realizes autobuild target, non-interactive

git-svn-id: svn://www.freewrt.org/trunk/freewrt@493 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
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 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
78clean:
79 @$(TRACE) clean
80 @$(MAKE) -C $(CONFIG) clean
81 rm -rf $(BUILD_DIR) $(BIN_DIR)
82
83cleandir:
84 @$(TRACE) cleandir
85 @$(MAKE) -C $(CONFIG) clean
86 rm -rf $(BUILD_DIR) $(BIN_DIR)
87 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
88 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
89 rm -f .tmpconfig.h
90
91distclean:
92 @$(TRACE) distclean
93 @$(MAKE) -C $(CONFIG) clean
94 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
95 rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR)
96 rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR)
97 rm -f .config* .tmpconfig.h
98
99else # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
100
101include $(TOPDIR)/lbin/prereq.mk
102
103all: menuconfig
104 @echo "Start the build with \"make\" or with \"make v\" to be verbose"
105
106# configuration
107# ---------------------------------------------------------------------------
108
109$(CONFIG)/conf:
110 @$(MAKE) -C $(CONFIG) conf > /dev/null 2>&1
111$(CONFIG)/mconf:
112 @$(MAKE) -C $(CONFIG) > /dev/null 2>&1
113
114menuconfig: $(CONFIG)/mconf
115 @-touch .config
116 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
117
118config: $(CONFIG)/conf
119 @-touch .config
120 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
121
122oldconfig: $(CONFIG)/conf
123 @-touch .config
124 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
125
126autobuild: $(CONFIG)/conf
127 @-touch .config
128 @$(CONFIG)/conf -m $(CONFIG_CONFIG_IN)
129 @grep -v ^BUSYBOX .config > .config.autobuild
130 @cat .busybox-config .config.autobuild > .config
131
132tools/install-lbin:
133 $(MAKE) -C tools install-lbin
134
135endif # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.