|
楼主 |
发表于 2008-2-19 15:06:11
|
显示全部楼层
这是busybox-1.1.3的Makefile 感觉是这里的问题
# Makefile for busybox
#
# Copyright (C) 1999-2004 by Erik Andersen <[email protected]>
#
# Licensed under GPLv2, see the file LICENSE in this tarball for details.
#
#--------------------------------------------------------------
# You shouldn't need to mess with anything beyond this point...
#--------------------------------------------------------------
noconfig_targets := menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig allbareconfig \
clean distclean help \
release tags
# the toplevel sourcedir
ifndef top_srcdir
top_srcdir=$(CURDIR)
endif
# toplevel directory of the object-tree
ifndef top_builddir
top_builddir=$(CURDIR)
endif
export srctree=$(top_srcdir)
vpath %/Config.in $(srctree)
DIRS:=applets archival archival/libunarchive coreutils console-tools \
debianutils editors findutils init miscutils modutils networking \
networking/libiproute networking/udhcp procps loginutils shell \
sysklogd util-linux e2fsprogs libpwdgrp coreutils/libcoreutils libbb
SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS))
# That's our default target when none is given on the command line
.PHONY: _all
_all:
CONFIG_CONFIG_IN = $(top_srcdir)/Config.in
ifeq ($(KBUILD_SRC),)
ifdef O
ifeq ("$(origin O)", "command line")
KBUILD_OUTPUT := $(O)
top_builddir := $(O)
endif
else
# If no alternate output-dir was specified, we build in cwd
# We are using KBUILD_OUTPUT nevertheless to make sure that we create
# Rules.mak and the toplevel Makefile, in case they don't exist.
KBUILD_OUTPUT := $(top_builddir)
endif
ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
# pull in OS specific commands like cp, mkdir, etc. early
-include $(top_srcdir)/Rules.mak
endif
# All object directories.
OBJ_DIRS := $(DIRS)
all_tree := $(patsubst %,$(top_builddir)/%,$(OBJ_DIRS) scripts scripts/config include)
all_tree: $(all_tree)
$(all_tree):
@mkdir -p "$@"
ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# Check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
$(if $(wildcard $(KBUILD_OUTPUT)),, \
$(error output directory "$(saved-output)" does not exist))
.PHONY: $(MAKECMDGOALS)
$(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile all_tree
$(Q)$(MAKE) -C $(KBUILD_OUTPUT) \
top_srcdir=$(top_srcdir) \
top_builddir=$(top_builddir) \
KBUILD_SRC=$(top_srcdir) \
-f $(CURDIR)/Makefile $@
$(KBUILD_OUTPUT)/Rules.mak:
@echo > $@
@echo top_srcdir=$(top_srcdir) >> $@
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
@echo include $(top_srcdir)/Rules.mak >> $@
$(KBUILD_OUTPUT)/Makefile:
@echo > $@
@echo top_srcdir=$(top_srcdir) >> $@
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
@echo KBUILD_SRC='$$(top_srcdir)' >> $@
@echo include '$$(KBUILD_SRC)'/Makefile >> $@
# Leave processing to above invocation of make
skip-makefile := 1
endif # ifneq ($(KBUILD_OUTPUT),)
endif # ifeq ($(KBUILD_SRC),)
ifeq ($(skip-makefile),)
# We only need a copy of the Makefile for the config targets and reuse
# the rest from the source directory, i.e. we do not cp ALL_MAKEFILES.
scripts/config/Makefile: $(top_srcdir)/scripts/config/Makefile
cp $< $@
_all: all
help:
@echo 'Cleaning:'
@echo ' clean - delete temporary files created by build'
@echo ' distclean - delete all non-source files (including .config)'
@echo
@echo 'Build:'
@echo ' all - Executable and documentation'
@echo ' busybox - the swiss-army executable'
@echo ' doc - docs/BusyBox.{txt,html,1}'
@echo
@echo 'Configuration:'
@echo ' allnoconfig - disable all symbols in .config'
@echo ' allyesconfig - enable all symbols in .config (see defconfig)'
@echo ' allbareconfig - enable all applets without any sub-features'
@echo ' config - text based configurator (of last resort)'
@echo ' defconfig - set .config to largest generic configuration'
@echo ' menuconfig - interactive curses-based configurator'
@echo ' oldconfig - resolve any unresolved symbols in .config'
@echo
@echo 'Installation:'
@echo ' install - install busybox into $(PREFIX)'
@echo ' uninstall'
@echo
@echo 'Development:'
@echo ' check - run the test suite for all applets'
@echo ' randconfig - generate a random configuration'
@echo ' release - create a distribution tarball'
@echo ' sizes - show size of all enabled busybox symbols'
@echo
include $(top_srcdir)/Rules.mak
ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
# Default target if none was requested explicitly
all: menuconfig
# warn if no configuration exists and we are asked to build a non-config target
.config:
@echo ""
@echo "No $(top_builddir)/$@ found!"
@echo "Please refer to 'make help', section Configuration."
@echo ""
@exit 1
# configuration
# ---------------------------------------------------------------------------
scripts/config/conf: scripts/config/Makefile
$(Q)$(MAKE) -C scripts/config conf
-@if [ ! -f .config ] ; then \
touch .config; \
fi
scripts/config/mconf: scripts/config/Makefile
$(Q)$(MAKE) -C scripts/config ncurses conf mconf
-@if [ ! -f .config ] ; then \
touch .config; \
fi
menuconfig: scripts/config/mconf
@[ -f .config ] || make $(MAKEFLAGS) defconfig
@./scripts/config/mconf $(CONFIG_CONFIG_IN)
config: scripts/config/conf
@./scripts/config/conf $(CONFIG_CONFIG_IN)
oldconfig: scripts/config/conf
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
randconfig: scripts/config/conf
@./scripts/config/conf -r $(CONFIG_CONFIG_IN)
allyesconfig: scripts/config/conf
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
@$(SED) -i -r -e "s/^(USING_CROSS_COMPILER)=.*/# \1 is not set/" .config
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
allnoconfig: scripts/config/conf
@./scripts/config/conf -n $(CONFIG_CONFIG_IN)
# defconfig is allyesconfig minus any features that are specialized enough
# or cause enough behavior change that the user really should switch them on
# manually if that's what they want. Sort of "maximum sane config".
defconfig: scripts/config/conf
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
@$(SED) -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG.*|STATIC|SELINUX|BUILD_(AT_ONCE|LIBBUSYBOX)|FEATURE_(DEVFS|FULL_LIBBUSYBOX|SHARED_BUSYBOX|MTAB_SUPPORT|CLEAN_UP|UDHCP_DEBUG)|INSTALL_NO_USR))=.*/# \1 is not set/" .config
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
allbareconfig: scripts/config/conf
@./scripts/config/conf -y $(CONFIG_CONFIG_IN)
@$(SED) -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG|STATIC|SELINUX|DEVFSD|NC_GAPING_SECURITY_HOLE|BUILD_AT_ONCE)).*/# \1 is not set/" .config
@$(SED) -i -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config
@echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config
@yes n | ./scripts/config/conf -o $(CONFIG_CONFIG_IN)
else # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
all: busybox busybox.links doc
# In this section, we need .config
-include $(top_builddir)/.config.cmd
include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
endif # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
-include $(top_builddir)/.config
-include $(top_builddir)/.depend |
|