1 # Makefile for buildroot2
3 # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
5 # This program is free software; you can redistribute it and/or modify
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.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
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
20 #--------------------------------------------------------------
21 # Just run 'make menuconfig', configure stuff, then run 'make'.
22 # You shouldn't need to mess with anything beyond this point...
23 #--------------------------------------------------------------
25 CONFIG_CONFIG_IN
= Config.in
26 CONFIG_DEFCONFIG
= .defconfig
27 CONFIG
= package
/config
29 noconfig_targets
:= menuconfig config oldconfig randconfig \
30 defconfig allyesconfig allnoconfig release
tags
32 # Pull in the user's configuration file
33 ifeq ($(filter $(noconfig_targets
),$(MAKECMDGOALS
)),)
34 -include $(TOPDIR
).config
37 ifeq ($(BR2_TAR_VERBOSITY
),y
)
43 ifeq ($(strip $(BR2_HAVE_DOT_CONFIG
)),y
)
45 #############################################################
47 # The list of stuff to build for the target toolchain
48 # along with the packages to build for the target.
50 ##############################################################
51 TARGETS
:=host-sed linux-headers uclibc-configured binutils gcc uclibc-target-utils
52 include toolchain
/Makefile.in
53 include toolchain
/*/Makefile.in
54 include package
/Makefile.in
55 include package
/*/Makefile.in
56 include target
/Makefile.in
57 include target
/*/Makefile.in
59 #############################################################
61 # You should probably leave this stuff alone unless you know
64 #############################################################
70 # In this section, we need .config
73 TARGETS_CLEAN
:=$(patsubst %,%-clean,$(TARGETS
))
74 TARGETS_SOURCE
:=$(patsubst %,%-source
,$(TARGETS
))
76 world
: $(DL_DIR
) $(BUILD_DIR
) $(STAGING_DIR
) $(TARGET_DIR
) $(TARGETS
)
78 .PHONY
: all world
clean distclean source
$(TARGETS
) \
79 $(TARGETS_CLEAN
) $(TARGETS_DIRCLEAN
) $(TARGETS_SOURCE
) \
80 $(DL_DIR
) $(BUILD_DIR
) $(TOOL_BUILD_DIR
) $(STAGING_DIR
)
82 include toolchain
/*/*.mk
83 include package
/*/*.mk
86 #############################################################
88 # staging and target directories do NOT list these as
89 # dependancies anywhere else
91 #############################################################
96 @mkdir
-p
$(BUILD_DIR
)
99 @mkdir
-p
$(TOOL_BUILD_DIR
)
102 @mkdir
-p
$(STAGING_DIR
)/lib
103 @mkdir
-p
$(STAGING_DIR
)/include
104 @mkdir
-p
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)
105 @ln
-sf ..
/lib
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
108 @mkdir
-p
$(TARGET_DIR
)
109 cp
-a target
/default
/target_skeleton
/* $(TARGET_DIR
)/
110 mkdir
-p
$(TARGET_DIR
)/{proc
,dev
,jffs
,tmp
,usr
/sbin
}
111 chmod
1777 $(TARGET_DIR
)/tmp
112 -find
$(TARGET_DIR
) -type d
-name CVS
-exec
rm -rf
{} \
; > /dev
/null
2>&1
114 source
: $(TARGETS_SOURCE
)
116 #############################################################
118 # Cleanup and misc junk
120 #############################################################
122 rm -rf
$(BUILD_DIR
) $(IMAGE
).
*
124 @
$(MAKE
) -C
$(CONFIG
) clean
127 rm -rf
$(DL_DIR
) $(TOOL_BUILD_DIR
) .config
133 rm -f buildroot.
tar.bz2
; \
134 tar -cvf buildroot.
tar buildroot
; \
135 bzip2
-9 buildroot.
tar; \
138 else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
143 # ---------------------------------------------------------------------------
146 $(MAKE
) -C
$(CONFIG
) conf
147 -@if
[ ! -f .config
] ; then \
148 cp
$(CONFIG_DEFCONFIG
) .config
; \
151 $(MAKE
) -C
$(CONFIG
) ncurses conf mconf
152 -@if
[ ! -f .config
] ; then \
153 cp
$(CONFIG_DEFCONFIG
) .config
; \
156 menuconfig
: $(CONFIG
)/mconf
157 @
$(CONFIG
)/mconf
$(CONFIG_CONFIG_IN
)
159 config
: $(CONFIG
)/conf
160 @
$(CONFIG
)/conf
$(CONFIG_CONFIG_IN
)
162 oldconfig
: $(CONFIG
)/conf
163 @
$(CONFIG
)/conf
-o
$(CONFIG_CONFIG_IN
)
165 randconfig
: $(CONFIG
)/conf
166 @
$(CONFIG
)/conf
-r
$(CONFIG_CONFIG_IN
)
168 allyesconfig
: $(CONFIG
)/conf
169 #@$(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
170 #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
171 @
$(CONFIG
)/conf
-o
$(CONFIG_CONFIG_IN
)
173 allnoconfig
: $(CONFIG
)/conf
174 @
$(CONFIG
)/conf
-n
$(CONFIG_CONFIG_IN
)
176 defconfig
: $(CONFIG
)/conf
177 @
$(CONFIG
)/conf
-d
$(CONFIG_CONFIG_IN
)
179 #############################################################
181 # Cleanup and misc junk
183 #############################################################
185 @
$(MAKE
) -C
$(CONFIG
) clean
189 endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
191 .PHONY
: dummy subdirs release
distclean clean config oldconfig \
192 menuconfig
tags check test depend