source: freewrt/build.mk@ b84b14f

freewrt_1_0 freewrt_2_0
Last change on this file since b84b14f was b84b14f, checked in by Thorsten Glaser <tg@…>, 19 years ago
  • instead of using a $(VARS_TO_PASS) write the variables into a *.mk include file, so that people can cd to some package direc- tory and invoke gmake directly
  • fake OpenBSD as uname for MirBSD, so that we get a little further in the build process there (stops at linux requiring bash now)

Tested with a full build (standard config) on Linux.
Invoking gmake in a subdirectory *not* tested, but
that didn't work before at all, so it's not a problem.

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

  • Property mode set to 100644
File size: 4.0 KB
Line 
1# Makefile for FreeWRT development environment
2#
3# Copyright (C) 2005 by Felix Fietkau <openwrt@nbd.name>
4# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19#
20
21#--------------------------------------------------------------
22# Just run 'make menuconfig', configure stuff, then run 'make'.
23# You shouldn't need to mess with anything beyond this point...
24#--------------------------------------------------------------
25
26TOPDIR=${shell pwd}
27export TOPDIR
28
29CONFIG_CONFIG_IN = Config.in
30CONFIG = package/config
31
32noconfig_targets := menuconfig config oldconfig randconfig \
33 allyesconfig allnoconfig tags
34
35# Pull in the user's configuration file
36ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
37-include $(TOPDIR)/.config
38endif
39
40ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
41include $(TOPDIR)/rules.mk
42
43all: world
44
45.NOTPARALLEL:
46.PHONY: all world clean cleandir distclean image_clean target_clean source
47
48#############################################################
49#
50# You should probably leave this stuff alone unless you know
51# what you are doing.
52#
53#############################################################
54
55# In this section, we need .config
56include .config.cmd
57
58world: $(DL_DIR) $(BUILD_DIR)
59 $(MAKE) -f build.mk toolchain/install target/compile package/compile root_clean package/install target/install package_index
60 @$(TRACE) Build complete.
61
62package_index:
63 (cd $(PACKAGE_DIR); $(STAGING_DIR)/usr/bin/ipkg-make-index . > Packages)
64
65$(DL_DIR):
66 @mkdir -p $(DL_DIR)
67
68$(BUILD_DIR):
69 @mkdir -p $(BUILD_DIR)
70
71source: toolchain/source package/source target/source
72
73package/%:
74 @$(TRACE) $@
75 $(MAKE) -C package $(patsubst package/%,%,$@)
76
77target/%:
78 @$(TRACE) $@
79 $(MAKE) -C target $(patsubst target/%,%,$@)
80
81toolchain/%:
82 @$(TRACE) $@
83 $(MAKE) -C toolchain $(patsubst toolchain/%,%,$@)
84
85#############################################################
86#
87# Cleanup and misc junk
88#
89#############################################################
90root_clean:
91 @$(TRACE) root_clean
92 rm -rf $(BUILD_DIR)/linux-*/root $(BUILD_DIR)/root
93
94target_clean: root_clean
95 rm -f $(STAMP_DIR)/.*-compile
96 rm -f $(STAMP_DIR)/.*-install
97 rm -rf $(BIN_DIR)
98
99clean:
100 @$(TRACE) clean
101 @$(MAKE) -C $(CONFIG) clean
102 rm -rf $(BUILD_DIR) $(BIN_DIR)
103
104cleandir:
105 @$(TRACE) cleandir
106 @$(MAKE) -C $(CONFIG) clean
107 rm -rf $(BUILD_DIR) $(BIN_DIR)
108 rm -rf $(STAMP_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
109 rm -f .tmpconfig.h
110
111distclean:
112 @$(TRACE) distclean
113 @$(MAKE) -C $(CONFIG) clean
114 rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR)
115 rm -rf $(STAMP_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
116 rm -f .config* .tmpconfig.h
117
118else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
119
120include $(TOPDIR)/lbin/prereq.mk
121
122all: menuconfig
123
124# configuration
125# ---------------------------------------------------------------------------
126
127$(CONFIG)/conf:
128 $(MAKE) -C $(CONFIG) conf
129$(CONFIG)/mconf:
130 $(MAKE) -C $(CONFIG)
131
132menuconfig: $(CONFIG)/mconf
133 -touch .config
134 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
135
136config: $(CONFIG)/conf
137 -touch .config
138 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
139
140oldconfig: $(CONFIG)/conf
141 -touch .config
142 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
143
144randconfig: $(CONFIG)/conf
145 -touch .config
146 @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
147
148allyesconfig: $(CONFIG)/conf
149 -touch .config
150 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
151
152allnoconfig: $(CONFIG)/conf
153 -touch .config
154 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
155
156endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
Note: See TracBrowser for help on using the repository browser.