]>
Commit | Line | Data |
---|---|---|
2d523c23 | 1 | # Makefile for buildroot2 |
ffde94bd | 2 | # |
15b26aee | 3 | # Copyright (C) 1999-2005 by Erik Andersen <[email protected]> |
ffde94bd | 4 | # |
08782ae7 | 5 | # This program is free software; you can redistribute it and/or modify |
2d523c23 EA |
6 | # it under the terms of the GNU General Public License as published by |
7 | # the Free Software Foundation; either version 2 of the License, or | |
8 | # (at your option) any later version. | |
ffde94bd | 9 | # |
2d523c23 EA |
10 | # This program is distributed in the hope that it will be useful, |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
08782ae7 | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2d523c23 | 13 | # General Public License for more details. |
ffde94bd | 14 | # |
2d523c23 EA |
15 | # You should have received a copy of the GNU General Public License |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
3ad3d8a1 | 18 | # |
02bf5816 | 19 | |
2d523c23 EA |
20 | #-------------------------------------------------------------- |
21 | # Just run 'make menuconfig', configure stuff, then run 'make'. | |
22 | # You shouldn't need to mess with anything beyond this point... | |
23 | #-------------------------------------------------------------- | |
24 | TOPDIR=./ | |
25 | CONFIG_CONFIG_IN = Config.in | |
26 | CONFIG_DEFCONFIG = .defconfig | |
27 | CONFIG = package/config | |
a0aef7c4 | 28 | |
2d523c23 | 29 | noconfig_targets := menuconfig config oldconfig randconfig \ |
0c1e709e | 30 | defconfig allyesconfig allnoconfig release tags \ |
9e250356 BRF |
31 | |
32 | # $(shell find . -name *_defconfig |sed 's/.*\///') | |
cad58108 | 33 | |
2d523c23 EA |
34 | # Pull in the user's configuration file |
35 | ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) | |
36 | -include $(TOPDIR).config | |
37 | endif | |
9741a49e | 38 | |
2d523c23 | 39 | ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) |
54e098e4 EA |
40 | |
41 | ############################################################# | |
42 | # | |
2d523c23 EA |
43 | # The list of stuff to build for the target toolchain |
44 | # along with the packages to build for the target. | |
54e098e4 | 45 | # |
2d523c23 | 46 | ############################################################## |
98bc6dac | 47 | TARGETS:=uclibc-configured binutils gcc uclibc-target-utils |
2d523c23 | 48 | include toolchain/Makefile.in |
2d523c23 | 49 | include package/Makefile.in |
27bc59d4 | 50 | |
08782ae7 EA |
51 | ############################################################# |
52 | # | |
ef407d3d | 53 | # You should probably leave this stuff alone unless you know |
08782ae7 EA |
54 | # what you are doing. |
55 | # | |
56 | ############################################################# | |
d632d42b | 57 | |
cb7d5b81 | 58 | |
ffde94bd | 59 | |
08782ae7 | 60 | all: world |
ffde94bd | 61 | |
2d523c23 EA |
62 | # In this section, we need .config |
63 | include .config.cmd | |
64 | ||
d06645d8 EA |
65 | # We also need the various per-package makefiles, which also add |
66 | # each selected package to TARGETS if that package was selected | |
67 | # in the .config file. | |
68 | include toolchain/*/*.mk | |
69 | include package/*/*.mk | |
d06645d8 | 70 | |
79f5f1e8 EA |
71 | # target stuff is last so it can override anything else |
72 | include target/Makefile.in | |
73 | ||
08782ae7 | 74 | TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) |
a5c23541 | 75 | TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS)) |
08782ae7 | 76 | TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) |
ffde94bd | 77 | |
6e2823c1 | 78 | world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS) |
870cb9e8 | 79 | dirs: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) |
ffde94bd | 80 | |
870cb9e8 | 81 | .PHONY: all world dirs clean dirclean distclean source $(TARGETS) \ |
747b16dd EA |
82 | $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \ |
83 | $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR) | |
ffde94bd | 84 | |
08782ae7 EA |
85 | ############################################################# |
86 | # | |
ef407d3d | 87 | # staging and target directories do NOT list these as |
d99c31c6 | 88 | # dependencies anywhere else |
08782ae7 EA |
89 | # |
90 | ############################################################# | |
8d583fc0 BRF |
91 | $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR): |
92 | @mkdir -p $@ | |
3ad3d8a1 | 93 | |
08782ae7 | 94 | $(STAGING_DIR): |
bf38723f EA |
95 | @mkdir -p $(STAGING_DIR)/lib |
96 | @mkdir -p $(STAGING_DIR)/include | |
3da708e4 | 97 | @mkdir -p $(STAGING_DIR)/usr |
bf38723f | 98 | @mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) |
3da708e4 | 99 | @ln -snf ../lib $(STAGING_DIR)/usr/lib |
74ad4e12 | 100 | @ln -snf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib |
ffde94bd | 101 | |
08782ae7 | 102 | $(TARGET_DIR): |
a4c685f1 | 103 | mkdir -p $(TARGET_DIR) |
ba70f94e EA |
104 | if [ -d "$(TARGET_SKELETON)" ] ; then \ |
105 | cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \ | |
bb15c221 | 106 | fi; |
5418a923 | 107 | touch $(STAGING_DIR)/.fakeroot.00000 |
bb15c221 EA |
108 | -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf |
109 | -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf | |
08782ae7 | 110 | |
a5c23541 | 111 | source: $(TARGETS_SOURCE) |
08782ae7 EA |
112 | |
113 | ############################################################# | |
114 | # | |
115 | # Cleanup and misc junk | |
116 | # | |
117 | ############################################################# | |
118 | clean: $(TARGETS_CLEAN) | |
3ad3d8a1 | 119 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) |
08782ae7 EA |
120 | |
121 | dirclean: $(TARGETS_DIRCLEAN) | |
3ad3d8a1 | 122 | rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE) |
08782ae7 EA |
123 | |
124 | distclean: | |
5bc1f0c3 MF |
125 | ifeq ($(DL_DIR),$(BASE_DIR)/dl) |
126 | rm -rf $(DL_DIR) | |
127 | endif | |
128 | rm -rf $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE) | |
b5136193 | 129 | $(MAKE) -C $(CONFIG) clean |
08782ae7 | 130 | |
3ad3d8a1 | 131 | sourceball: |
08782ae7 EA |
132 | rm -rf $(BUILD_DIR) |
133 | set -e; \ | |
134 | cd ..; \ | |
135 | rm -f buildroot.tar.bz2; \ | |
136 | tar -cvf buildroot.tar buildroot; \ | |
137 | bzip2 -9 buildroot.tar; \ | |
2d523c23 EA |
138 | |
139 | ||
140 | else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) | |
141 | ||
142 | all: menuconfig | |
143 | ||
144 | # configuration | |
145 | # --------------------------------------------------------------------------- | |
146 | ||
147 | $(CONFIG)/conf: | |
148 | $(MAKE) -C $(CONFIG) conf | |
149 | -@if [ ! -f .config ] ; then \ | |
150 | cp $(CONFIG_DEFCONFIG) .config; \ | |
151 | fi | |
152 | $(CONFIG)/mconf: | |
153 | $(MAKE) -C $(CONFIG) ncurses conf mconf | |
154 | -@if [ ! -f .config ] ; then \ | |
155 | cp $(CONFIG_DEFCONFIG) .config; \ | |
156 | fi | |
157 | ||
158 | menuconfig: $(CONFIG)/mconf | |
159 | @$(CONFIG)/mconf $(CONFIG_CONFIG_IN) | |
160 | ||
161 | config: $(CONFIG)/conf | |
162 | @$(CONFIG)/conf $(CONFIG_CONFIG_IN) | |
163 | ||
164 | oldconfig: $(CONFIG)/conf | |
165 | @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN) | |
166 | ||
167 | randconfig: $(CONFIG)/conf | |
168 | @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN) | |
169 | ||
170 | allyesconfig: $(CONFIG)/conf | |
171 | #@$(CONFIG)/conf -y $(CONFIG_CONFIG_IN) | |
172 | #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config | |
173 | @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN) | |
174 | ||
175 | allnoconfig: $(CONFIG)/conf | |
176 | @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN) | |
177 | ||
178 | defconfig: $(CONFIG)/conf | |
179 | @$(CONFIG)/conf -d $(CONFIG_CONFIG_IN) | |
180 | ||
0c1e709e SH |
181 | %_defconfig: $(CONFIG)/conf |
182 | cp $(shell find . -name $@) .config | |
183 | @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN) | |
184 | ||
2d523c23 EA |
185 | ############################################################# |
186 | # | |
187 | # Cleanup and misc junk | |
188 | # | |
189 | ############################################################# | |
190 | clean: | |
191 | rm -f .config .config.old .config.cmd .tmpconfig.h | |
192 | - $(MAKE) -C $(CONFIG) clean | |
193 | ||
194 | distclean: clean | |
195 | rm -rf sources/* | |
196 | ||
197 | endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y) | |
198 | ||
199 | .PHONY: dummy subdirs release distclean clean config oldconfig \ | |
f3ccf319 | 200 | menuconfig tags check test depend defconfig |
2d523c23 EA |
201 | |
202 |