]> Git Repo - buildroot-mgba.git/blame - Makefile
Fix building of GDB when using external toolchain.
[buildroot-mgba.git] / Makefile
CommitLineData
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#--------------------------------------------------------------
24TOPDIR=./
25CONFIG_CONFIG_IN = Config.in
26CONFIG_DEFCONFIG = .defconfig
27CONFIG = package/config
a0aef7c4 28
2d523c23 29noconfig_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
35ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
36-include $(TOPDIR).config
37endif
9741a49e 38
2d523c23 39ifeq ($(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 47TARGETS:=uclibc-configured binutils gcc uclibc-target-utils
2d523c23 48include toolchain/Makefile.in
2d523c23 49include 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 60all: world
ffde94bd 61
2d523c23
EA
62# In this section, we need .config
63include .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.
68include toolchain/*/*.mk
69include package/*/*.mk
d06645d8 70
79f5f1e8
EA
71# target stuff is last so it can override anything else
72include target/Makefile.in
73
08782ae7 74TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
a5c23541 75TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
08782ae7 76TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
ffde94bd 77
6e2823c1 78world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS)
870cb9e8 79dirs: $(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 111source: $(TARGETS_SOURCE)
08782ae7
EA
112
113#############################################################
114#
115# Cleanup and misc junk
116#
117#############################################################
118clean: $(TARGETS_CLEAN)
3ad3d8a1 119 rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
08782ae7
EA
120
121dirclean: $(TARGETS_DIRCLEAN)
3ad3d8a1 122 rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
08782ae7
EA
123
124distclean:
5bc1f0c3
MF
125ifeq ($(DL_DIR),$(BASE_DIR)/dl)
126 rm -rf $(DL_DIR)
127endif
128 rm -rf $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
b5136193 129 $(MAKE) -C $(CONFIG) clean
08782ae7 130
3ad3d8a1 131sourceball:
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
140else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
141
142all: 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
158menuconfig: $(CONFIG)/mconf
159 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
160
161config: $(CONFIG)/conf
162 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
163
164oldconfig: $(CONFIG)/conf
165 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
166
167randconfig: $(CONFIG)/conf
168 @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
169
170allyesconfig: $(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
175allnoconfig: $(CONFIG)/conf
176 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
177
178defconfig: $(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#############################################################
190clean:
191 rm -f .config .config.old .config.cmd .tmpconfig.h
192 - $(MAKE) -C $(CONFIG) clean
193
194distclean: clean
195 rm -rf sources/*
196
197endif # 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
This page took 0.11385 seconds and 4 git commands to generate.