]> Git Repo - buildroot-mgba.git/blob - Makefile
- vtun depends on lzo and openssl just like openvpn
[buildroot-mgba.git] / Makefile
1 # Makefile for buildroot2
2 #
3 # Copyright (C) 1999-2005 by Erik Andersen <[email protected]>
4 #
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.
9 #
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.
14 #
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
18 #
19
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
28
29 noconfig_targets := menuconfig config oldconfig randconfig \
30         defconfig allyesconfig allnoconfig clean distclean \
31         release tags
32
33 # Pull in the user's configuration file
34 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
35 -include $(TOPDIR).config
36 endif
37
38 TAR_OPTIONS=$(subst ",, $(BR2_TAR_OPTIONS)) -xf
39 #"
40
41 ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
42
43 #############################################################
44 #
45 # The list of stuff to build for the target toolchain
46 # along with the packages to build for the target.
47 #
48 ##############################################################
49 TARGETS:=host-sed kernel-headers uclibc-configured binutils gcc uclibc-target-utils
50 include toolchain/Makefile.in
51 include package/Makefile.in
52
53 #############################################################
54 #
55 # You should probably leave this stuff alone unless you know
56 # what you are doing.
57 #
58 #############################################################
59
60
61
62 all:   world
63
64 # In this section, we need .config
65 include .config.cmd
66
67 # We also need the various per-package makefiles, which also add
68 # each selected package to TARGETS if that package was selected
69 # in the .config file.
70 include toolchain/*/*.mk
71 include package/*/*.mk
72 include target/*/*.mk
73
74 # target stuff is last so it can override anything else
75 include target/Makefile.in
76
77 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
78 TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
79 TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
80
81 world: $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) $(TARGETS)
82
83 .PHONY: all world clean dirclean distclean source $(TARGETS) \
84         $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
85         $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR)
86
87 #############################################################
88 #
89 # staging and target directories do NOT list these as
90 # dependancies anywhere else
91 #
92 #############################################################
93 $(DL_DIR):
94         @mkdir -p $(DL_DIR)
95
96 $(BUILD_DIR):
97         @mkdir -p $(BUILD_DIR)
98
99 $(TOOL_BUILD_DIR):
100         @mkdir -p $(TOOL_BUILD_DIR)
101
102 $(STAGING_DIR):
103         @mkdir -p $(STAGING_DIR)/lib
104         @mkdir -p $(STAGING_DIR)/include
105         @mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)
106         @ln -snf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
107
108 $(TARGET_DIR):
109         if [ -f "$(TARGET_SKELETON)" ] ; then \
110                 zcat $(TARGET_SKELETON) | tar -C $(BUILD_DIR) -xf -; \
111         fi;
112         if [ -d "$(TARGET_SKEL_DIR)" ] ; then \
113                 cp -a $(TARGET_SKEL_DIR)/* $(TARGET_DIR)/; \
114         fi;
115         touch $(STAGING_DIR)/fakeroot.env
116         -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf
117         -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf
118
119 source: $(TARGETS_SOURCE)
120
121 #############################################################
122 #
123 # Cleanup and misc junk
124 #
125 #############################################################
126 clean: $(TARGETS_CLEAN)
127         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
128
129 dirclean: $(TARGETS_DIRCLEAN)
130         rm -rf $(STAGING_DIR) $(TARGET_DIR) $(IMAGE)
131
132 distclean:
133 ifeq ($(DL_DIR),$(BASE_DIR)/dl)
134         rm -rf $(DL_DIR)
135 endif
136         rm -rf $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
137
138 sourceball:
139         rm -rf $(BUILD_DIR)
140         set -e; \
141         cd ..; \
142         rm -f buildroot.tar.bz2; \
143         tar -cvf buildroot.tar buildroot; \
144         bzip2 -9 buildroot.tar; \
145
146
147 else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
148
149 all: menuconfig
150
151 # configuration
152 # ---------------------------------------------------------------------------
153
154 $(CONFIG)/conf:
155         $(MAKE) -C $(CONFIG) conf
156         -@if [ ! -f .config ] ; then \
157                 cp $(CONFIG_DEFCONFIG) .config; \
158         fi
159 $(CONFIG)/mconf:
160         $(MAKE) -C $(CONFIG) ncurses conf mconf
161         -@if [ ! -f .config ] ; then \
162                 cp $(CONFIG_DEFCONFIG) .config; \
163         fi
164
165 menuconfig: $(CONFIG)/mconf
166         @$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
167
168 config: $(CONFIG)/conf
169         @$(CONFIG)/conf $(CONFIG_CONFIG_IN)
170
171 oldconfig: $(CONFIG)/conf
172         @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
173
174 randconfig: $(CONFIG)/conf
175         @$(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
176
177 allyesconfig: $(CONFIG)/conf
178         #@$(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
179         #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
180         @$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
181
182 allnoconfig: $(CONFIG)/conf
183         @$(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
184
185 defconfig: $(CONFIG)/conf
186         @$(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
187
188 #############################################################
189 #
190 # Cleanup and misc junk
191 #
192 #############################################################
193 clean:
194         rm -f .config .config.old .config.cmd .tmpconfig.h
195         - $(MAKE) -C $(CONFIG) clean
196
197 distclean: clean
198         rm -rf sources/*
199
200 endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
201
202 .PHONY: dummy subdirs release distclean clean config oldconfig \
203         menuconfig tags check test depend defconfig
204
205
This page took 0.034953 seconds and 4 git commands to generate.