Eric Andersen | c499601 | 1999-10-20 22:08:37 +0000 | [diff] [blame] | 1 | # Makefile for busybox |
| 2 | # |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 3 | # Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
Erik Andersen | 9ffdaa6 | 2000-02-11 21:55:04 +0000 | [diff] [blame] | 4 | # |
Rob Landley | a7e14db | 2005-09-11 01:16:47 +0000 | [diff] [blame] | 5 | # Licensed under GPLv2, see the file LICENSE in this tarball for details. |
Eric Andersen | c499601 | 1999-10-20 22:08:37 +0000 | [diff] [blame] | 6 | # |
| 7 | |
Eric Andersen | c9f20d9 | 2002-12-05 08:41:41 +0000 | [diff] [blame] | 8 | #-------------------------------------------------------------- |
| 9 | # You shouldn't need to mess with anything beyond this point... |
| 10 | #-------------------------------------------------------------- |
| 11 | noconfig_targets := menuconfig config oldconfig randconfig \ |
Bernhard Reutner-Fischer | be5c103 | 2005-10-08 11:08:28 +0000 | [diff] [blame] | 12 | defconfig allyesconfig allnoconfig allbareconfig \ |
Bernhard Reutner-Fischer | a597211 | 2006-03-06 14:19:15 +0000 | [diff] [blame] | 13 | clean distclean \ |
Eric Andersen | bcf2724 | 2005-02-13 22:15:59 +0000 | [diff] [blame] | 14 | release tags |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 15 | |
Bernhard Reutner-Fischer | 1c943eb | 2005-09-26 16:01:43 +0000 | [diff] [blame] | 16 | # the toplevel sourcedir |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 17 | ifndef top_srcdir |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 18 | # make-3.79.1 didn't support MAKEFILE_LIST |
| 19 | # for building out-of-tree, users of make-3.79.1 still have to pass top_srcdir= |
| 20 | # to make: make -f /srcs/busybox/Makefile top_srcdir=/srcs/busybox |
| 21 | ifdef MAKEFILE_LIST |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 22 | top_srcdir:=$(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd) |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 23 | else |
| 24 | top_srcdir:=$(CURDIR) |
| 25 | endif |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 26 | endif |
Bernhard Reutner-Fischer | 1c943eb | 2005-09-26 16:01:43 +0000 | [diff] [blame] | 27 | # toplevel directory of the object-tree |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 28 | ifndef top_builddir |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 29 | top_builddir:=$(CURDIR) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 30 | endif |
| 31 | |
Mike Frysinger | 9d6e083 | 2005-07-31 22:50:17 +0000 | [diff] [blame] | 32 | export srctree=$(top_srcdir) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 33 | vpath %/Config.in $(srctree) |
| 34 | |
Glenn L McGrath | 3238ea1 | 2003-02-15 10:53:40 +0000 | [diff] [blame] | 35 | DIRS:=applets archival archival/libunarchive coreutils console-tools \ |
| 36 | debianutils editors findutils init miscutils modutils networking \ |
Glenn L McGrath | 9a2d272 | 2002-11-10 01:33:55 +0000 | [diff] [blame] | 37 | networking/libiproute networking/udhcp procps loginutils shell \ |
Mike Frysinger | d89e629 | 2005-04-24 05:07:59 +0000 | [diff] [blame] | 38 | sysklogd util-linux e2fsprogs libpwdgrp coreutils/libcoreutils libbb |
Eric Andersen | ab050f5 | 2001-01-27 06:01:43 +0000 | [diff] [blame] | 39 | |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 40 | SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS)) |
| 41 | |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 42 | # That's our default target when none is given on the command line |
| 43 | .PHONY: _all |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 44 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 45 | _all: all |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 46 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 47 | # see if we are in verbose mode |
| 48 | ifdef VERBOSE |
| 49 | CHECK_VERBOSE := -v |
| 50 | PACKAGE_BE_VERBOSE := $(VERBOSE) |
| 51 | endif |
| 52 | ifdef V |
| 53 | CHECK_VERBOSE := -v |
| 54 | PACKAGE_BE_VERBOSE := $(V) |
| 55 | endif |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 56 | |
| 57 | ifdef O |
| 58 | ifeq ("$(origin O)", "command line") |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 59 | PACKAGE_OUTPUTDIR := $(shell cd $(O) && pwd) |
| 60 | top_builddir := $(PACKAGE_OUTPUTDIR) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 61 | endif |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 62 | else |
| 63 | # If no alternate output-dir was specified, we build in cwd |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 64 | PACKAGE_OUTPUTDIR := $(top_builddir) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 65 | endif |
| 66 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 67 | define check_gcc |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 68 | $(if $(2),$(if $(shell $(CC) $(2) -S -o /dev/null -xc /dev/null > /dev/null 2>&1 && echo y),$(2),$(if $(3),$(3))),$(if $(3),$(3))) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 69 | endef |
| 70 | |
| 71 | define check_ld |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 72 | $(if $(2),$(if $(shell $(LD) $(2) -o /dev/null -b binary /dev/null > /dev/null 2>&1 && echo y),$(shell echo \-Wl,$(2)),$(if $(3),$(3))),$(if $(3),$(3))) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 73 | endef |
| 74 | |
| 75 | ####################################################################### |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 76 | # make-3.79.1 doesn't support order-only prerequisites.. |
| 77 | ifeq ($(MAKE_VERSION),3.79.1) |
| 78 | |: $(^) ; |
| 79 | endif |
| 80 | ####################################################################### |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 81 | |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 82 | |
Bernhard Reutner-Fischer | 8c7a7e6 | 2005-10-13 10:40:18 +0000 | [diff] [blame] | 83 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 84 | # Handle building out of tree |
| 85 | ifneq ($(top_builddir),$(top_srcdir)) |
| 86 | all_tree := $(patsubst %,$(top_builddir)/%,$(DIRS) scripts scripts/config include include/config) |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 87 | $(all_tree): |
| 88 | @mkdir -p "$@" |
| 89 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 90 | saved-output := $(PACKAGE_OUTPUTDIR) |
| 91 | |
| 92 | $(if $(wildcard $(PACKAGE_OUTPUTDIR)),, \ |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 93 | $(error output directory "$(saved-output)" does not exist)) |
| 94 | |
Bernhard Reutner-Fischer | 9b6b894 | 2006-03-02 17:38:15 +0000 | [diff] [blame] | 95 | .PHONY: $(filter $(noconfig_targets),$(MAKECMDGOALS)) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 96 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 97 | $(PACKAGE_OUTPUTDIR)/Rules.mak: |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 98 | @echo > $@ |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 99 | @echo top_srcdir=$(top_srcdir) >> $@ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 100 | @echo top_builddir=$(PACKAGE_OUTPUTDIR) >> $@ |
| 101 | @echo include $$\(top_srcdir\)/Rules.mak >> $@ |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 102 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 103 | $(PACKAGE_OUTPUTDIR)/Makefile: |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 104 | @echo > $@ |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 105 | @echo top_srcdir=$(top_srcdir) >> $@ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 106 | @echo top_builddir=$(PACKAGE_OUTPUTDIR) >> $@ |
| 107 | @echo PACKAGE_SOURCEDIR='$$(top_srcdir)' >> $@ |
| 108 | @echo include '$$(PACKAGE_SOURCEDIR)'/Makefile >> $@ |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 109 | |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 110 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 111 | buildtree := $(all_tree) $(PACKAGE_OUTPUTDIR)/Rules.mak $(PACKAGE_OUTPUTDIR)/Makefile |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 112 | |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 113 | # We only need a copy of the Makefile for the config targets and reuse |
| 114 | # the rest from the source directory, i.e. we do not cp ALL_MAKEFILES. |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 115 | scripts/config/Makefile: $(top_srcdir)/scripts/config/Makefile | $(buildtree) |
| 116 | @cp $(top_srcdir)/scripts/config/Makefile $@ |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 117 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 118 | else |
| 119 | all_tree := include/config |
| 120 | $(all_tree): |
| 121 | @mkdir -p "$@" |
| 122 | buildtree := $(all_tree) |
| 123 | endif # ifneq ($(PACKAGE_OUTPUTDIR),$(top_srcdir)) |
Glenn L McGrath | 6376b58 | 2003-09-24 15:48:29 +0000 | [diff] [blame] | 124 | |
Rob Landley | d24eaac | 2005-09-26 15:49:41 +0000 | [diff] [blame] | 125 | help: |
| 126 | @echo 'Cleaning:' |
"Vladimir N. Oleynik" | b757699 | 2006-01-23 11:39:05 +0000 | [diff] [blame] | 127 | @echo ' clean - delete temporary files created by build' |
| 128 | @echo ' distclean - delete all non-source files (including .config)' |
Rob Landley | d24eaac | 2005-09-26 15:49:41 +0000 | [diff] [blame] | 129 | @echo |
| 130 | @echo 'Build:' |
"Vladimir N. Oleynik" | b757699 | 2006-01-23 11:39:05 +0000 | [diff] [blame] | 131 | @echo ' all - Executable and documentation' |
| 132 | @echo ' busybox - the swiss-army executable' |
| 133 | @echo ' doc - docs/BusyBox.{txt,html,1}' |
Rob Landley | d24eaac | 2005-09-26 15:49:41 +0000 | [diff] [blame] | 134 | @echo |
| 135 | @echo 'Configuration:' |
"Vladimir N. Oleynik" | b757699 | 2006-01-23 11:39:05 +0000 | [diff] [blame] | 136 | @echo ' allnoconfig - disable all symbols in .config' |
Rob Landley | 1ab4c3d | 2006-02-08 18:50:17 +0000 | [diff] [blame] | 137 | @echo ' allyesconfig - enable all symbols in .config (see defconfig)' |
| 138 | @echo ' allbareconfig - enable all applets without any sub-features' |
"Vladimir N. Oleynik" | b757699 | 2006-01-23 11:39:05 +0000 | [diff] [blame] | 139 | @echo ' config - text based configurator (of last resort)' |
Rob Landley | 1ab4c3d | 2006-02-08 18:50:17 +0000 | [diff] [blame] | 140 | @echo ' defconfig - set .config to largest generic configuration' |
"Vladimir N. Oleynik" | b757699 | 2006-01-23 11:39:05 +0000 | [diff] [blame] | 141 | @echo ' menuconfig - interactive curses-based configurator' |
| 142 | @echo ' oldconfig - resolve any unresolved symbols in .config' |
Rob Landley | d24eaac | 2005-09-26 15:49:41 +0000 | [diff] [blame] | 143 | @echo |
| 144 | @echo 'Installation:' |
"Vladimir N. Oleynik" | b757699 | 2006-01-23 11:39:05 +0000 | [diff] [blame] | 145 | @echo ' install - install busybox into $prefix' |
Rob Landley | d24eaac | 2005-09-26 15:49:41 +0000 | [diff] [blame] | 146 | @echo ' uninstall' |
| 147 | @echo |
| 148 | @echo 'Development:' |
"Vladimir N. Oleynik" | b757699 | 2006-01-23 11:39:05 +0000 | [diff] [blame] | 149 | @echo ' check - run the test suite for all applets' |
| 150 | @echo ' randconfig - generate a random configuration' |
| 151 | @echo ' release - create a distribution tarball' |
| 152 | @echo ' sizes - show size of all enabled busybox symbols' |
Rob Landley | d24eaac | 2005-09-26 15:49:41 +0000 | [diff] [blame] | 153 | @echo |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 154 | @echo 'Make flags:' |
| 155 | @echo ' V=<number> - print verbose make output (default: unset)' |
| 156 | @echo ' 0 print CC invocations' |
| 157 | @echo ' 1' |
| 158 | @echo ' 2 also print when make enters a directory' |
| 159 | @echo ' 3 also verbosely print shell invocations' |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 160 | |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 161 | -include $(top_srcdir)/Rules.mak |
| 162 | |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 163 | ifneq ($(strip $(HAVE_DOT_CONFIG)),y) |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 164 | # Default target if none was requested explicitly |
Rob Landley | 9dc6913 | 2006-03-13 02:52:23 +0000 | [diff] [blame^] | 165 | all: menuconfig ; |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 166 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 167 | ifneq ($(filter-out $(noconfig_targets),$(MAKECMDGOALS)),) |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 168 | # warn if no configuration exists and we are asked to build a non-config target |
| 169 | .config: |
| 170 | @echo "" |
| 171 | @echo "No $(top_builddir)/$@ found!" |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 172 | @echo "Please refer to 'make help', section Configuration." |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 173 | @echo "" |
| 174 | @exit 1 |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 175 | else |
| 176 | # Avoid implicit rule to kick in by using an empty command |
| 177 | .config: $(buildtree) ; |
| 178 | endif |
| 179 | endif # ifneq ($(strip $(HAVE_DOT_CONFIG)),y) |
| 180 | |
Bernhard Reutner-Fischer | 4d63525 | 2005-10-07 10:53:15 +0000 | [diff] [blame] | 181 | |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 182 | # configuration |
| 183 | # --------------------------------------------------------------------------- |
| 184 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 185 | CONFIG_CONFIG_IN = $(top_srcdir)/Config.in |
| 186 | |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 187 | scripts/config/conf: scripts/config/Makefile |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 188 | $(Q)$(MAKE) -C scripts/config conf |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 189 | |
| 190 | scripts/config/mconf: scripts/config/Makefile |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 191 | $(Q)$(MAKE) -C scripts/config ncurses conf mconf |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 192 | |
| 193 | menuconfig: scripts/config/mconf |
Rob Landley | 9dc6913 | 2006-03-13 02:52:23 +0000 | [diff] [blame^] | 194 | @[ -f .config ] || make $(MAKEFLAGS) defconfig |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 195 | @./scripts/config/mconf $(CONFIG_CONFIG_IN) |
| 196 | |
| 197 | config: scripts/config/conf |
| 198 | @./scripts/config/conf $(CONFIG_CONFIG_IN) |
| 199 | |
| 200 | oldconfig: scripts/config/conf |
| 201 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) |
| 202 | |
| 203 | randconfig: scripts/config/conf |
| 204 | @./scripts/config/conf -r $(CONFIG_CONFIG_IN) |
| 205 | |
| 206 | allyesconfig: scripts/config/conf |
| 207 | @./scripts/config/conf -y $(CONFIG_CONFIG_IN) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 208 | @$(SED) -i -r -e "s/^(USING_CROSS_COMPILER)=.*/# \1 is not set/" .config |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 209 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) |
| 210 | |
| 211 | allnoconfig: scripts/config/conf |
| 212 | @./scripts/config/conf -n $(CONFIG_CONFIG_IN) |
| 213 | |
Rob Landley | 1ab4c3d | 2006-02-08 18:50:17 +0000 | [diff] [blame] | 214 | # defconfig is allyesconfig minus any features that are specialized enough |
| 215 | # or cause enough behavior change that the user really should switch them on |
| 216 | # manually if that's what they want. Sort of "maximum sane config". |
Rob Landley | a167ec5 | 2006-01-31 02:42:50 +0000 | [diff] [blame] | 217 | |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 218 | defconfig: scripts/config/conf |
Rob Landley | a167ec5 | 2006-01-31 02:42:50 +0000 | [diff] [blame] | 219 | @./scripts/config/conf -y $(CONFIG_CONFIG_IN) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 220 | @$(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 |
Rob Landley | a167ec5 | 2006-01-31 02:42:50 +0000 | [diff] [blame] | 221 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) |
| 222 | |
Bernhard Reutner-Fischer | be5c103 | 2005-10-08 11:08:28 +0000 | [diff] [blame] | 223 | allbareconfig: scripts/config/conf |
| 224 | @./scripts/config/conf -y $(CONFIG_CONFIG_IN) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 225 | @$(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 |
| 226 | @$(SED) -i -e "/FEATURE/s/=.*//;/^[^#]/s/.*FEATURE.*/# \0 is not set/;" .config |
Bernhard Reutner-Fischer | be5c103 | 2005-10-08 11:08:28 +0000 | [diff] [blame] | 227 | @echo "CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y" >> .config |
| 228 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) |
Bernhard Reutner-Fischer | a9d8913 | 2005-10-07 18:45:03 +0000 | [diff] [blame] | 229 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 230 | ifeq ($(strip $(HAVE_DOT_CONFIG)),y) |
Eric Andersen | 0081466 | 2001-04-26 23:29:10 +0000 | [diff] [blame] | 231 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 232 | # Load all Config.in |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 233 | -include $(top_builddir)/.config.cmd |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 234 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 235 | endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y) |
Bernhard Reutner-Fischer | 5c071bc | 2005-10-05 07:40:46 +0000 | [diff] [blame] | 236 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 237 | include $(patsubst %,%/Makefile.in,$(SRC_DIRS)) |
| 238 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 239 | ifeq ($(strip $(HAVE_DOT_CONFIG)),y) |
| 240 | # Finally pull in the dependencies (headers and other includes) of the |
| 241 | # individual object files |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 242 | -include $(top_builddir)/.depend |
| 243 | |
Bernhard Reutner-Fischer | c8e278f | 2006-03-02 18:13:05 +0000 | [diff] [blame] | 244 | $(top_builddir)/applets/applets.o: $(top_builddir)/.config |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 245 | # Everything is set. |
| 246 | |
| 247 | all: busybox busybox.links doc ; |
| 248 | |
| 249 | # Two modes of operation: legacy and IMA |
| 250 | # Legacy mode builds each object through an individual invocation of CC |
| 251 | # IMA compiles all sources at once (aka IPO aka IPA etc.) |
| 252 | |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 253 | ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y) |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 254 | libraries-y:= |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 255 | # Which parts of the internal libs are requested? |
| 256 | # Per default we only want what was actually selected. |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 257 | # -a denotes all while -y denotes the selected ones. |
| 258 | ifeq ($(strip $(CONFIG_FEATURE_FULL_LIBBUSYBOX)),y) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 259 | LIBRARY_DEFINE:=$(LIBRARY_DEFINE-a) |
| 260 | LIBRARY_SRC :=$(LIBRARY_SRC-a) |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 261 | else # CONFIG_FEATURE_FULL_LIBBUSYBOX |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 262 | LIBRARY_DEFINE:=$(LIBRARY_DEFINE-y) |
| 263 | LIBRARY_SRC :=$(LIBRARY_SRC-y) |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 264 | endif # CONFIG_FEATURE_FULL_LIBBUSYBOX |
| 265 | APPLET_SRC:=$(APPLET_SRC-y) |
| 266 | APPLETS_DEFINE:=$(APPLETS_DEFINE-y) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 267 | else # CONFIG_BUILD_AT_ONCE |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 268 | # no --combine, build archives out of the individual .o |
| 269 | # This was the old way the binary was built. |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 270 | libbusybox-obj:=archival/libunarchive/libunarchive.a \ |
| 271 | networking/libiproute/libiproute.a \ |
| 272 | libpwdgrp/libpwdgrp.a coreutils/libcoreutils/libcoreutils.a \ |
| 273 | libbb/libbb.a |
| 274 | libbusybox-obj:=$(patsubst %,$(top_builddir)/%,$(libbusybox-obj)) |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 275 | ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y) |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 276 | # linking against libbusybox, so don't build the .a already contained in the .so |
| 277 | libraries-y:=$(filter-out $(libbusybox-obj),$(libraries-y)) |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 278 | endif # CONFIG_FEATURE_SHARED_BUSYBOX |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 279 | |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 280 | endif # CONFIG_BUILD_AT_ONCE |
| 281 | |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 282 | ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) |
| 283 | LD_LIBBUSYBOX:=libbusybox.so |
| 284 | LIBBUSYBOX_SONAME:=$(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL_VERSION) |
| 285 | DO_INSTALL_LIBS:=$(LD_LIBBUSYBOX) \ |
| 286 | $(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ |
| 287 | $(LD_LIBBUSYBOX).$(MAJOR_VERSION).$(MINOR_VERSION) |
| 288 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 289 | endif # CONFIG_BUILD_LIBBUSYBOX |
| 290 | |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 291 | ifeq ($(strip $(CONFIG_BUILD_AT_ONCE)),y) |
| 292 | ifneq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 293 | # --combine but not linking against libbusybox, so compile lib*.c |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 294 | BUSYBOX_SRC := $(LIBRARY_SRC) |
| 295 | BUSYBOX_DEFINE:= $(LIBRARY_DEFINE) |
| 296 | endif # !CONFIG_FEATURE_SHARED_BUSYBOX |
| 297 | $(LIBBUSYBOX_SONAME): $(LIBRARY_SRC) |
| 298 | else # CONFIG_BUILD_AT_ONCE |
| 299 | $(LIBBUSYBOX_SONAME): $(libbusybox-obj) |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 300 | AR_INTRO:=-Wl,--whole-archive |
| 301 | AR_EXTRO:=-Wl,--no-whole-archive |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 302 | endif # CONFIG_BUILD_AT_ONCE |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 303 | |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 304 | |
| 305 | ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y) |
| 306 | LDBUSYBOX:=-L$(top_builddir) -lbusybox |
| 307 | endif |
| 308 | |
| 309 | ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 310 | $(LIBBUSYBOX_SONAME): |
| 311 | ifndef MAJOR_VERSION |
| 312 | $(error MAJOR_VERSION needed for $@ is not defined) |
| 313 | endif |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 314 | $(do_link) $(LIB_CFLAGS) $(CFLAGS_COMBINE) \ |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 315 | -Wl,-soname=$(LD_LIBBUSYBOX).$(MAJOR_VERSION) \ |
Bernhard Reutner-Fischer | 08a1b50 | 2006-01-27 15:45:56 +0000 | [diff] [blame] | 316 | -Wl,-z,combreloc $(LIB_LDFLAGS) \ |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 317 | -o $(@) \ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 318 | -Wl,--start-group \ |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 319 | $(LIBRARY_DEFINE) $(AR_INTRO) $(^) $(AR_EXTRO) \ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 320 | -Wl,--end-group |
| 321 | @rm -f $(DO_INSTALL_LIBS) |
| 322 | @for i in $(DO_INSTALL_LIBS); do ln -s $(@) $$i ; done |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 323 | $(do_strip) |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 324 | |
| 325 | endif # ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) |
| 326 | |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 327 | busybox_unstripped: $(top_builddir)/.depend $(LIBBUSYBOX_SONAME) $(BUSYBOX_SRC) $(APPLET_SRC) $(libraries-y) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 328 | $(do_link) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) \ |
| 329 | $(foreach f,$(^:.o=.c),$(CFLAGS-$(notdir $(patsubst %/$,%,$(dir $(f))))-$(notdir $(f)))) \ |
| 330 | $(CFLAGS-$(@)) \ |
| 331 | -o $@ -Wl,--start-group \ |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 332 | $(APPLETS_DEFINE) $(APPLET_SRC) \ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 333 | $(BUSYBOX_DEFINE) $(BUSYBOX_SRC) \ |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 334 | $(libraries-y) \ |
Bernhard Reutner-Fischer | 08c5a17 | 2006-01-25 15:58:04 +0000 | [diff] [blame] | 335 | $(LDBUSYBOX) $(LIBRARIES) \ |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 336 | -Wl,--end-group |
Bernhard Reutner-Fischer | cfc5d86 | 2006-03-02 09:44:32 +0000 | [diff] [blame] | 337 | |
| 338 | busybox: busybox_unstripped |
| 339 | $(Q)cp busybox_unstripped busybox |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 340 | $(do_strip) |
Eric Andersen | bdfd0d7 | 2001-10-24 05:00:29 +0000 | [diff] [blame] | 341 | |
Rob Landley | a930bd3 | 2005-12-16 06:12:46 +0000 | [diff] [blame] | 342 | busybox.links: $(top_srcdir)/applets/busybox.mkll include/bb_config.h $(top_srcdir)/include/applets.h |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 343 | $(Q)-$(SHELL) $^ >$@ |
Eric Andersen | bdfd0d7 | 2001-10-24 05:00:29 +0000 | [diff] [blame] | 344 | |
Eric Andersen | 6302486 | 2004-10-13 17:45:57 +0000 | [diff] [blame] | 345 | install: $(top_srcdir)/applets/install.sh busybox busybox.links |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 346 | $(Q)DO_INSTALL_LIBS="$(strip $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS))" \ |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 347 | $(SHELL) $< $(PREFIX) $(INSTALL_OPTS) |
Eric Andersen | 1387910 | 2004-08-26 23:13:00 +0000 | [diff] [blame] | 348 | ifeq ($(strip $(CONFIG_FEATURE_SUID)),y) |
| 349 | @echo |
| 350 | @echo |
| 351 | @echo -------------------------------------------------- |
| 352 | @echo You will probably need to make your busybox binary |
| 353 | @echo setuid root to ensure all configured applets will |
| 354 | @echo work properly. |
| 355 | @echo -------------------------------------------------- |
| 356 | @echo |
| 357 | endif |
Eric Andersen | bdfd0d7 | 2001-10-24 05:00:29 +0000 | [diff] [blame] | 358 | |
Glenn L McGrath | 87470de | 2003-08-29 12:20:31 +0000 | [diff] [blame] | 359 | uninstall: busybox.links |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 360 | rm -f $(PREFIX)/bin/busybox |
| 361 | for i in `cat busybox.links` ; do rm -f $(PREFIX)$$i; done |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 362 | ifneq ($(strip $(DO_INSTALL_LIBS)),n) |
| 363 | for i in $(LIBBUSYBOX_SONAME) $(DO_INSTALL_LIBS); do \ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 364 | rm -f $(PREFIX)$$i; \ |
Bernhard Reutner-Fischer | 7ca61b6 | 2006-01-15 14:04:57 +0000 | [diff] [blame] | 365 | done |
| 366 | endif |
Eric Andersen | 1f30a41 | 2002-04-13 13:39:48 +0000 | [diff] [blame] | 367 | |
Mike Frysinger | ce0cf1d | 2005-09-24 05:47:52 +0000 | [diff] [blame] | 368 | check test: busybox |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 369 | bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \ |
Bernhard Reutner-Fischer | e34e878 | 2005-10-06 12:48:03 +0000 | [diff] [blame] | 370 | $(top_srcdir)/testsuite/runtest $(CHECK_VERBOSE) |
Eric Andersen | bdfd0d7 | 2001-10-24 05:00:29 +0000 | [diff] [blame] | 371 | |
Bernhard Reutner-Fischer | cfc5d86 | 2006-03-02 09:44:32 +0000 | [diff] [blame] | 372 | sizes: busybox_unstripped |
| 373 | $(NM) --size-sort $(<) |
Rob Landley | 1689075 | 2005-09-02 00:41:53 +0000 | [diff] [blame] | 374 | |
Eric Andersen | bdfd0d7 | 2001-10-24 05:00:29 +0000 | [diff] [blame] | 375 | # Documentation Targets |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 376 | doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html ; |
John Beppu | 94e5054 | 2001-04-05 19:42:03 +0000 | [diff] [blame] | 377 | |
Mike Frysinger | f37529d | 2006-02-05 22:15:39 +0000 | [diff] [blame] | 378 | docs/busybox.pod : $(top_srcdir)/docs/busybox_header.pod $(top_srcdir)/include/usage.h $(top_srcdir)/docs/busybox_footer.pod $(top_srcdir)/docs/autodocifier.pl |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 379 | $(disp_doc) |
| 380 | $(Q)-mkdir -p docs |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 381 | $(Q)-( cat $(top_srcdir)/docs/busybox_header.pod ; \ |
| 382 | $(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h ; \ |
| 383 | cat $(top_srcdir)/docs/busybox_footer.pod ; ) > docs/busybox.pod |
Eric Andersen | 5331025 | 2000-07-04 19:42:23 +0000 | [diff] [blame] | 384 | |
Eric Andersen | 67536ff | 2000-07-06 22:53:22 +0000 | [diff] [blame] | 385 | docs/BusyBox.txt: docs/busybox.pod |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 386 | $(disp_doc) |
| 387 | $(Q)-mkdir -p docs |
| 388 | $(Q)-pod2text $< > $@ |
Eric Andersen | 5331025 | 2000-07-04 19:42:23 +0000 | [diff] [blame] | 389 | |
Eric Andersen | 67536ff | 2000-07-06 22:53:22 +0000 | [diff] [blame] | 390 | docs/BusyBox.1: docs/busybox.pod |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 391 | $(disp_doc) |
| 392 | $(Q)-mkdir -p docs |
| 393 | $(Q)-pod2man --center=BusyBox --release="version $(VERSION)" \ |
Eric Andersen | 19f8620 | 2001-02-17 00:42:47 +0000 | [diff] [blame] | 394 | $< > $@ |
Eric Andersen | 5331025 | 2000-07-04 19:42:23 +0000 | [diff] [blame] | 395 | |
Eric Andersen | 2423b12 | 2001-12-08 01:56:15 +0000 | [diff] [blame] | 396 | docs/BusyBox.html: docs/busybox.net/BusyBox.html |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 397 | $(disp_doc) |
| 398 | $(Q)-mkdir -p docs |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 399 | $(Q)-rm -f docs/BusyBox.html |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 400 | $(Q)-cp docs/busybox.net/BusyBox.html docs/BusyBox.html |
Eric Andersen | 5331025 | 2000-07-04 19:42:23 +0000 | [diff] [blame] | 401 | |
Eric Andersen | 2423b12 | 2001-12-08 01:56:15 +0000 | [diff] [blame] | 402 | docs/busybox.net/BusyBox.html: docs/busybox.pod |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 403 | $(Q)-mkdir -p docs/busybox.net |
| 404 | $(Q)-pod2html --noindex $< > \ |
Eric Andersen | 2423b12 | 2001-12-08 01:56:15 +0000 | [diff] [blame] | 405 | docs/busybox.net/BusyBox.html |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 406 | $(Q)-rm -f pod2htm* |
Erik Andersen | 0a704e8 | 2000-05-03 03:19:06 +0000 | [diff] [blame] | 407 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 408 | # The nifty new dependency stuff |
"Vladimir N. Oleynik" | 5e60dc4 | 2005-09-12 12:33:27 +0000 | [diff] [blame] | 409 | scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 410 | $(do_link.h) |
Erik Andersen | 1d1d950 | 2000-04-21 01:26:49 +0000 | [diff] [blame] | 411 | |
"Vladimir N. Oleynik" | 6732af2 | 2006-02-15 12:29:37 +0000 | [diff] [blame] | 412 | DEP_INCLUDES := include/bb_config.h |
"Vladimir N. Oleynik" | cef737f | 2005-09-21 07:49:34 +0000 | [diff] [blame] | 413 | |
"Vladimir N. Oleynik" | cef737f | 2005-09-21 07:49:34 +0000 | [diff] [blame] | 414 | ifeq ($(strip $(CONFIG_BBCONFIG)),y) |
| 415 | DEP_INCLUDES += include/bbconfigopts.h |
| 416 | |
| 417 | include/bbconfigopts.h: .config |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 418 | $(disp_gen) |
| 419 | $(Q)$(top_srcdir)/scripts/config/mkconfigs > $@ |
"Vladimir N. Oleynik" | cef737f | 2005-09-21 07:49:34 +0000 | [diff] [blame] | 420 | endif |
| 421 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 422 | depend dep: $(top_builddir)/.depend ; |
| 423 | $(top_builddir)/.depend: $(buildtree) scripts/bb_mkdep $(DEP_INCLUDES) |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 424 | $(disp_gen) |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 425 | $(Q)rm -f .depend |
| 426 | $(Q)scripts/bb_mkdep $(MKDEP_ARGS) \ |
| 427 | -I $(top_srcdir)/include $(top_srcdir) > $@.tmp |
Mike Frysinger | b38673f | 2006-02-02 01:41:53 +0000 | [diff] [blame] | 428 | $(Q)mv $@.tmp $@ |
Eric Andersen | bdfd0d7 | 2001-10-24 05:00:29 +0000 | [diff] [blame] | 429 | |
"Vladimir N. Oleynik" | 6732af2 | 2006-02-15 12:29:37 +0000 | [diff] [blame] | 430 | include/bb_config.h: .config |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 431 | $(disp_gen) |
Eric Andersen | 7daa076 | 2004-10-08 07:46:08 +0000 | [diff] [blame] | 432 | @$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN) |
Eric Andersen | 85208e2 | 2002-04-12 12:05:57 +0000 | [diff] [blame] | 433 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 434 | endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y) |
| 435 | |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 436 | clean: |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 437 | - rm -f docs/busybox.dvi docs/busybox.ps \ |
Eric Andersen | f730088 | 2004-04-06 15:26:25 +0000 | [diff] [blame] | 438 | docs/busybox.pod docs/busybox.net/busybox.html \ |
Eric Andersen | 24e098a | 2003-08-22 20:53:38 +0000 | [diff] [blame] | 439 | docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \ |
| 440 | docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \ |
"Vladimir N. Oleynik" | 9394b23 | 2006-01-23 11:24:58 +0000 | [diff] [blame] | 441 | docs/busybox.net/BusyBox.html busybox.links \ |
Bernhard Reutner-Fischer | a597211 | 2006-03-06 14:19:15 +0000 | [diff] [blame] | 442 | libbusybox.so* \ |
Mike Frysinger | 33b45a0 | 2006-03-05 16:25:19 +0000 | [diff] [blame] | 443 | .config.old busybox busybox_unstripped |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 444 | - rm -r -f _install testsuite/links |
Rob Landley | 31e3610 | 2006-03-09 22:01:05 +0000 | [diff] [blame] | 445 | - find . -name .\*.flags -o -name \*.o -o -name \*.om \ |
| 446 | -o -name \*.os -o -name \*.osm -o -name \*.a | xargs rm -f |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 447 | |
| 448 | distclean: clean |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 449 | - $(MAKE) -C scripts/config clean |
| 450 | - rm -f scripts/bb_mkdep |
| 451 | - rm -r -f include/config $(DEP_INCLUDES) |
Rob Landley | 31e3610 | 2006-03-09 22:01:05 +0000 | [diff] [blame] | 452 | - find . -name .depend'*' | xargs rm -f |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 453 | rm -f .config .config.old .config.cmd |
Eric Andersen | cc8ed39 | 1999-10-05 16:24:54 +0000 | [diff] [blame] | 454 | |
Eric Andersen | c9f20d9 | 2002-12-05 08:41:41 +0000 | [diff] [blame] | 455 | release: distclean #doc |
Mike Frysinger | fcafa4b | 2005-08-01 20:48:00 +0000 | [diff] [blame] | 456 | cd ..; \ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 457 | rm -r -f $(PROG)-$(VERSION); \ |
Mike Frysinger | fcafa4b | 2005-08-01 20:48:00 +0000 | [diff] [blame] | 458 | cp -a busybox $(PROG)-$(VERSION); \ |
| 459 | \ |
| 460 | find $(PROG)-$(VERSION)/ -type d \ |
Eric Andersen | 4306bb1 | 2005-08-17 00:03:23 +0000 | [diff] [blame] | 461 | -name .svn \ |
Mike Frysinger | fcafa4b | 2005-08-01 20:48:00 +0000 | [diff] [blame] | 462 | -print \ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 463 | -exec rm -r -f {} \; ; \ |
Mike Frysinger | fcafa4b | 2005-08-01 20:48:00 +0000 | [diff] [blame] | 464 | \ |
| 465 | find $(PROG)-$(VERSION)/ -type f \ |
| 466 | -name .\#* \ |
| 467 | -print \ |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 468 | -exec rm -f {} \; ; \ |
Mike Frysinger | fcafa4b | 2005-08-01 20:48:00 +0000 | [diff] [blame] | 469 | \ |
Glenn L McGrath | 0874a61 | 2003-11-17 10:26:43 +0000 | [diff] [blame] | 470 | tar -cvzf $(PROG)-$(VERSION).tar.gz $(PROG)-$(VERSION)/; |
Mark Whitley | dd23b8b | 2000-07-10 23:00:47 +0000 | [diff] [blame] | 471 | |
Mark Whitley | dd23b8b | 2000-07-10 23:00:47 +0000 | [diff] [blame] | 472 | tags: |
| 473 | ctags -R . |
Matt Kraai | 4e05da8 | 2001-11-19 19:47:56 +0000 | [diff] [blame] | 474 | |
Bernhard Reutner-Fischer | 5d26126 | 2006-03-01 22:54:48 +0000 | [diff] [blame] | 475 | # keep these in sync with noconfig_targets above! |
| 476 | .PHONY: dummy subdirs check test depend dep buildtree \ |
| 477 | menuconfig config oldconfig randconfig \ |
| 478 | defconfig allyesconfig allnoconfig allbareconfig \ |
| 479 | clean distclean \ |
| 480 | release tags |
Bernhard Reutner-Fischer | 07a79e7 | 2006-03-09 09:03:37 +0000 | [diff] [blame] | 481 | |