source: floppyfw/Makefile @ 259

Revision 259, 7.3 KB checked in by root, 5 years ago (diff)

About time to commit.

Line 
1# Makefile for buildroot2
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
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# Two of the same kind..
25TOPDIR=./
26BASE_DIR:=${shell pwd}
27
28CONFIG_CONFIG_IN = Config.in
29CONFIG_DEFCONFIG = .defconfig
30CONFIG = scripts/kconfig
31
32# Which version of floppyfw is this?
33FLOPPYFW_VERSION=3.1.0
34
35# Old gruff, need to put somewhere else later.
36SCRIPTS_DIR           = $(BASE_DIR)/scripts
37PATCH_DIR             = $(BASE_DIR)/patches
38CONFIG_DIR            = $(BASE_DIR)/configs
39FILES_DIR             = $(BASE_DIR)/files
40TMP_DIR               = $(BASE_DIR)/tmp
41MODULES_DIR           = $(BUILD_DIR)/modules
42PACKAGES_SKELETON_DIR = $(BASE_DIR)/skeletons/packages
43
44
45SED=/usr/bin/perl -p -i -e
46LZMAD=lzmacat
47# LZMAC=lzma -c
48LZMAC=lzmacomp
49RM=rm -f
50# For now, it's only this anyway:
51BR2_ARCH="i386"
52
53noconfig_targets := menuconfig config oldconfig randconfig \
54        defconfig allyesconfig allnoconfig release tags    \
55        $(shell find . -name *_defconfig |sed 's/.*\///')
56
57# Pull in the user's configuration file
58ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
59-include $(TOPDIR).config
60endif
61
62ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
63
64#############################################################
65#
66# The list of stuff to build for the target toolchain
67# along with the packages to build for the target.
68#
69##############################################################
70# We need these so we just put them here.
71TARGETS:=uclibc linux busybox
72include package/Makefile.in
73# include target/Makefile.in
74
75#############################################################
76#
77# You should probably leave this stuff alone unless you know
78# what you are doing.
79#
80#############################################################
81
82all:   world
83
84echotarg:
85        echo $(TARGETS)
86
87# In this section, we need .config
88include .config.cmd
89
90# We also need the various per-package makefiles, which also add
91# each selected package to TARGETS if that package was selected
92# in the .config file.
93include package/*/*.mk
94include target/*/*.mk
95
96# target stuff is last so it can override anything else
97include target/Makefile.in
98
99TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))
100TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS))
101TARGETS_SOURCE_CONFIGURED:=$(patsubst %,%-source-configured,$(TARGETS))
102TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS))
103TARGETS_MENUCONFIG:=$(patsubst %,%-menuconfig,$(TARGETS))
104
105world: echotarg $(TMP_DIR) $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) \
106        $(TARGET_DIR) $(TARGET_PACKAGES_DIR) $(TARGETS) floppy
107
108
109.PHONY: all world clean dirclean distclean source veryclean $(TARGETS) \
110        $(TARGETS_CLEAN) $(TARGETS_DIRCLEAN) $(TARGETS_SOURCE) \
111        $(TARGETS_SOURCE_CONFIGURED) $(TARGETS_MENUCONFIG) \
112        $(DL_DIR) $(BUILD_DIR) $(TOOL_BUILD_DIR) $(STAGING_DIR) \
113        floppy
114
115#############################################################
116#
117# staging and target directories do NOT list these as
118# dependencies anywhere else
119#
120#############################################################
121$(TMP_DIR):
122        mkdir -p $(TMP_DIR)
123
124$(DL_DIR):
125        mkdir -p $(DL_DIR)
126
127$(BUILD_DIR):
128        mkdir -p $(BUILD_DIR)
129        # Can put it here anyway.
130        mkdir -p $(MODULES_DIR)/modules
131
132$(TOOL_BUILD_DIR):
133        mkdir -p $(TOOL_BUILD_DIR)
134
135$(STAGING_DIR):
136        mkdir -p $(STAGING_DIR)/lib
137        mkdir -p $(STAGING_DIR)/include
138        # mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)
139        # ln -snf ../lib $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/lib
140
141# TARGET_DIR and INITRD_MASTER are created in initrd.mk and add.mk
142
143#$(TARGET_DIR): $(TMP_DIR) $(DL_DIR) $(BUILD_DIR) $(STAGING_DIR) \
144#       $(TARGET_PACKAGES_DIR)
145#       if [ -f "$(TARGET_SKELETON)" ] ; then \
146#               $(ZCAT) $(TARGET_SKELETON) | tar -C $(BUILD_DIR) -xf -; \
147#       fi;
148#       if [ -d "$(TARGET_SKEL_DIR)" ] ; then \
149#               cp -fa $(TARGET_SKEL_DIR)/* $(TARGET_DIR)/; \
150#       fi;
151#       touch $(STAGING_DIR)/.fakeroot.00000
152#       -find $(TARGET_DIR) -type d -name CVS | xargs rm -rf
153#       -find $(TARGET_DIR) -type d -name .svn | xargs rm -rf
154
155$(TARGET_PACKAGES_DIR):
156        mkdir -p $(TARGET_PACKAGES_DIR)
157
158source: $(TARGETS_SOURCE)
159
160#############################################################
161#
162# Cleanup and misc junk
163#
164#############################################################
165clean: $(TARGETS_CLEAN)
166        rm -rf $(STAGING_DIR) $(TARGET_PACKAGES_DIR) $(TARGET_DIR) $(IMAGE)
167
168dirclean: $(TARGETS_DIRCLEAN)
169        rm -rf $(STAGING_DIR) $(TARGET_PACKAGES_DIR) $(TARGET_DIR) $(IMAGE)
170
171distclean:
172ifeq ($(DL_DIR),$(BASE_DIR)/dl)
173        rm -rf $(DL_DIR)
174endif
175        rm -rf $(BUILD_DIR) $(LINUX_KERNEL) $(IMAGE)
176
177veryclean:
178        $(RM) -r $(BUILD_DIR)
179        # Dangerous..
180        $(RM) -r floppy*
181
182sourceball:
183        rm -rf $(BUILD_DIR)
184        set -e; \
185        cd ..; \
186        rm -f buildroot.tar.bz2; \
187        tar -cvf buildroot.tar buildroot; \
188        bzip2 -9 buildroot.tar; \
189
190
191else # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
192
193all: menuconfig
194
195# configuration
196# ---------------------------------------------------------------------------
197
198HOSTCC=/bin/gcc
199export HOSTCC
200$(CONFIG)/conf:
201        @mkdir -p $(CONFIG)/buildroot-config
202        $(MAKE) CC=$(HOSTCC) -C $(CONFIG) conf
203        -if [ ! -f .config ] ; then \
204                cp $(CONFIG_DEFCONFIG) .config; \
205        fi
206$(CONFIG)/mconf:
207        @mkdir -p $(CONFIG)/buildroot-config
208        $(MAKE) CC=$(HOSTCC) -C $(CONFIG) conf mconf
209        -if [ ! -f .config ] ; then \
210                cp $(CONFIG_DEFCONFIG) .config; \
211        fi
212
213menuconfig: $(CONFIG)/mconf
214        $(CONFIG)/mconf $(CONFIG_CONFIG_IN)
215
216config: $(CONFIG)/conf
217        $(CONFIG)/conf $(CONFIG_CONFIG_IN)
218
219oldconfig: $(CONFIG)/conf
220        $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
221
222randconfig: $(CONFIG)/conf
223        $(CONFIG)/conf -r $(CONFIG_CONFIG_IN)
224
225allyesconfig: $(CONFIG)/conf
226        #$(CONFIG)/conf -y $(CONFIG_CONFIG_IN)
227        #sed -i -e "s/^CONFIG_DEBUG.*/# CONFIG_DEBUG is not set/" .config
228        $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
229
230allnoconfig: $(CONFIG)/conf
231        $(CONFIG)/conf -n $(CONFIG_CONFIG_IN)
232
233defconfig: $(CONFIG)/conf
234        $(CONFIG)/conf -d $(CONFIG_CONFIG_IN)
235
236%_defconfig: $(CONFIG)/conf
237        cp $(shell find . -name $@) .config
238        $(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
239
240#############################################################
241#
242# Cleanup and misc junk
243#
244#############################################################
245clean:
246        rm -f .config .config.old .config.cmd .tmpconfig.h
247        - $(MAKE) -C $(CONFIG) clean
248
249distclean: clean
250        rm -rf sources/*
251
252veryclean:
253        $(RM) -r $(BUILD_DIR)
254        # Dangerous..
255        $(RM) -r floppy*
256
257sourceball:
258        $(RM) -r $(BUILD_DIR)
259        set -e; \
260        cd ..; \
261        $(RM) buildroot.tar.bz2; \
262        tar -cvf buildroot.tar buildroot; \
263        bzip2 -9 buildroot.tar
264
265endif # ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
266
267.PHONY: dummy subdirs release distclean clean config oldconfig \
268        menuconfig tags check test depend defconfig veryclean
269
270
Note: See TracBrowser for help on using the repository browser.