]> Git Repo - buildroot-mgba.git/blame - Makefile
- rm cruft via fakeroot, not afterwards where it has no effect.
[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
SH
30 defconfig allyesconfig allnoconfig release tags \
31 $(shell find . -name *_defconfig |sed 's/.*\///')
cad58108 32
2d523c23
EA
33# Pull in the user's configuration file
34ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
35-include $(TOPDIR).config
36endif
9741a49e 37
2d523c23 38ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
54e098e4
EA
39
40#############################################################
41#
2d523c23
EA
42# The list of stuff to build for the target toolchain
43# along with the packages to build for the target.
54e098e4 44#
2d523c23 45##############################################################
98bc6dac 46TARGETS:=uclibc-configured binutils gcc uclibc-target-utils
2d523c23 47include toolchain/Makefile.in
2d523c23 48include package/Makefile.in
27bc59d4 49
08782ae7
EA
50#############################################################
51#
ef407d3d 52# You should probably leave this stuff alone unless you know
08782ae7
EA
53# what you are doing.
54#
55#############################################################
d632d42b 56
cb7d5b81 57
ffde94bd 58
08782ae7 59all: world
ffde94bd 60
2d523c23
EA
61# In this section, we need .config
62include .config.cmd
63
d06645d8
EA
64# We also need the various per-package makefiles, which also add
65# each selected package to TARGETS if that package was selected
66# in the .config file.
67include toolchain/*/*.mk
68include package/*/*.mk
69include target/*/*.mk
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#############################################################
91$(DL_DIR):
bf38723f 92 @mkdir -p $(DL_DIR)
ffde94bd 93
08782ae7 94$(BUILD_DIR):
bf38723f 95 @mkdir -p $(BUILD_DIR)
c79e9982 96
3ad3d8a1 97$(TOOL_BUILD_DIR):
bf38723f 98 @mkdir -p $(TOOL_BUILD_DIR)
3ad3d8a1 99
08782ae7 100$(STAGING_DIR):
bf38723f
EA
101 @mkdir -p $(STAGING_DIR)/lib
102 @mkdir -p $(STAGING_DIR)/include
103 @mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)
74ad4e12 104 @ln -snf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
ffde94bd 105
08782ae7 106$(TARGET_DIR):
a4c685f1 107 mkdir -p $(TARGET_DIR)
ba70f94e
EA
108 if [ -d "$(TARGET_SKELETON)" ] ; then \
109 cp -fa $(TARGET_SKELETON)/* $(TARGET_DIR)/; \
bb15c221 110 fi;
5418a923 111 touch $(STAGING_DIR)/.fakeroot.00000
bb15c221
EA
112 -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf
113 -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf
08782ae7 114
a5c23541 115source: $(TARGETS_SOURCE)
08782ae7
EA
116
117#############################################################
118#
119# Cleanup and misc junk
120#
121#############################################################
122clean: $(TARGETS_CLEAN)
3ad3d8a1 123 rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
08782ae7
EA
124
125dirclean: $(TARGETS_DIRCLEAN)
3ad3d8a1 126 rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
08782ae7
EA
127
128distclean:
5bc1f0c3
MF
129ifeq ($(DL_DIR),$(BASE_DIR)/dl)
130 rm -rf $(DL_DIR)
131endif
132 rm -rf $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
08782ae7 133
3ad3d8a1 134sourceball:
08782ae7
EA
135 rm -rf $(BUILD_DIR)
136 set -e; \
137 cd ..; \
138 rm -f buildroot.tar.bz2; \
139 tar -cvf buildroot.tar buildroot; \
140 bzip2 -9 buildroot.tar; \
2d523c23
EA
141
142
143else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
144
145all: menuconfig
146
147# configuration
148# ---------------------------------------------------------------------------
149
150$(CONFIG)/conf:
151 $(MAKE) -C $(CONFIG) conf
152 -@if [ ! -f .config ] ; then \
153 cp $(CONFIG_DEFCONFIG) .config; \
154 fi
155$(CONFIG)/mconf:
156 $(MAKE) -C $(CONFIG) ncurses conf mconf
157 -@if [ ! -f .config ] ; then \
158 cp $(CONFIG_DEFCONFIG) .config; \
159 fi
160
161menuconfig: $(CONFIG)/mconf
162 @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
163
164config: $(CONFIG)/conf
165 @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
166
167oldconfig: $(CONFIG)/conf
168 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
169
170randconfig: $(CONFIG)/conf
171 @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
172
173allyesconfig: $(CONFIG)/conf
174 #@$(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
175 #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
176 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
177
178allnoconfig: $(CONFIG)/conf
179 @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
180
181defconfig: $(CONFIG)/conf
182 @$(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
183
0c1e709e
SH
184%_defconfig: $(CONFIG)/conf
185 cp $(shell find . -name $@) .config
186 @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
187
2d523c23
EA
188#############################################################
189#
190# Cleanup and misc junk
191#
192#############################################################
193clean:
194 rm -f .config .config.old .config.cmd .tmpconfig.h
195 - $(MAKE) -C $(CONFIG) clean
196
197distclean: clean
198 rm -rf sources/*
199
200endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
201
202.PHONY: dummy subdirs release distclean clean config oldconfig \
f3ccf319 203 menuconfig tags check test depend defconfig
2d523c23
EA
204
205
This page took 0.116755 seconds and 4 git commands to generate.