diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2005-10-05 07:40:46 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2005-10-05 07:40:46 +0000 |
commit | 5c071bcf2f6bc923b5d6779b3563d08b80a8949d (patch) | |
tree | 2f116d1bedfb7bddc5d9be9c9d1829944703f388 | |
parent | dc2510327b43ab5ce18c1752304015fad4663bad (diff) | |
download | busybox-w32-5c071bcf2f6bc923b5d6779b3563d08b80a8949d.tar.gz busybox-w32-5c071bcf2f6bc923b5d6779b3563d08b80a8949d.tar.bz2 busybox-w32-5c071bcf2f6bc923b5d6779b3563d08b80a8949d.zip |
- fix building out-of-tree;
to test, checkout the source (let's assume /scratch/src/busybox), then
mkdir /tmp/bb ; cd /tmp/bb
make top_srcdir=/scratch/src/busybox O="$(pwd)" -f /scratch/src/busybox/Makefile allyesconfig check
- default to O=$(pwd) if no O was specified. Now you can just specify
the top_srcdir (without O=/somewhere) to create the obj-tree in pwd.
- make "make configtarget buildtarget" work. Previously this didn't
work due to how HAVE_DOT_CONFIG was evaluated. Two separate steps were
needed before, e.g. make config ; make busybox.
- remove some unneeded variables from Rules.mak (BB_SRC_DIR from Mr.
ldoolitt@recycle.lbl) which suggest that the stuff fixed above
didn't work before.
- move selinux libraries to where they belong (from Makefile to Rules.mak)
- update the docs to mention svn instead of cvs and provide an example
for building out-of-tree in INSTALL.
-rw-r--r-- | INSTALL | 48 | ||||
-rw-r--r-- | Makefile | 145 | ||||
-rw-r--r-- | README | 26 | ||||
-rw-r--r-- | Rules.mak | 18 | ||||
-rw-r--r-- | e2fsprogs/Makefile | 2 | ||||
-rw-r--r-- | e2fsprogs/Makefile.in | 16 |
6 files changed, 149 insertions, 106 deletions
@@ -1,14 +1,50 @@ | |||
1 | Building: | ||
2 | ========= | ||
3 | |||
4 | You will usually build in the source-tree. | ||
5 | |||
6 | Alternatively you can build out-of-tree to have the object files separated | ||
7 | from the source. This allows for building several different configurations | ||
8 | from the same set of sources. | ||
9 | |||
10 | A) Building in the source-tree: | ||
11 | ------------------------------- | ||
12 | |||
1 | 1) Run 'make config' or 'make menuconfig' and select the | 13 | 1) Run 'make config' or 'make menuconfig' and select the |
2 | functionality that you wish to enable. | 14 | functionality that you wish to enable. |
3 | 15 | ||
4 | 2) Run 'make' | 16 | 2) Run 'make' |
5 | 17 | ||
6 | 3) Go get a drink of water, drink a soda, visit the bathroom, | 18 | 3) Run 'make install' or 'make PREFIX=/target install' to |
7 | or whatever while it compiles. It doesn't take very | ||
8 | long to compile, so you don't really need to waste too | ||
9 | much time waiting... | ||
10 | |||
11 | 4) Run 'make install' or 'make PREFIX=/target install' to | ||
12 | install busybox and all the needed links. Some people | 19 | install busybox and all the needed links. Some people |
13 | will prefer to install using hardlinks and will instead | 20 | will prefer to install using hardlinks and will instead |
14 | want to run 'make install-hardlinks'.... | 21 | want to run 'make install-hardlinks'.... |
22 | |||
23 | B) Building out-of-tree: | ||
24 | ------------------------ | ||
25 | |||
26 | 1) make the directory to hold the object files and chdir to it: | ||
27 | 'mkdir /tmp/bb ; cd /tmp/bb' | ||
28 | Then prepare the config giving the full path to the source in top_srcdir: | ||
29 | make top_srcdir=/path/busybox -f /path/busybox/Makefile O=/tmp/b allyesconfig | ||
30 | |||
31 | Note that O=$(pwd) is the default if no O= was specified. | ||
32 | |||
33 | You now have a buildable tree in $O and can run 'make' without the need | ||
34 | to specify any paths. | ||
35 | |||
36 | Proceed with step #A2 above. | ||
37 | |||
38 | |||
39 | Installation: | ||
40 | ============= | ||
41 | |||
42 | After the build is complete, a busybox.links file is generated. This is | ||
43 | used by 'make install' to create symlinks to the BusyBox binary for all | ||
44 | compiled in functions. By default, 'make install' will place the symlink | ||
45 | forest into `pwd`/_install unless you have defined the PREFIX environment | ||
46 | variable (i.e., 'make PREFIX=/tmp/foo install') | ||
47 | |||
48 | If you wish to install hard links, rather than symlinks, you can use | ||
49 | 'make PREFIX=/tmp/foo install-hardlinks' instead. | ||
50 | |||
@@ -24,8 +24,6 @@ endif | |||
24 | export srctree=$(top_srcdir) | 24 | export srctree=$(top_srcdir) |
25 | vpath %/Config.in $(srctree) | 25 | vpath %/Config.in $(srctree) |
26 | 26 | ||
27 | include $(top_srcdir)/Rules.mak | ||
28 | |||
29 | DIRS:=applets archival archival/libunarchive coreutils console-tools \ | 27 | DIRS:=applets archival archival/libunarchive coreutils console-tools \ |
30 | debianutils editors findutils init miscutils modutils networking \ | 28 | debianutils editors findutils init miscutils modutils networking \ |
31 | networking/libiproute networking/udhcp procps loginutils shell \ | 29 | networking/libiproute networking/udhcp procps loginutils shell \ |
@@ -33,28 +31,36 @@ DIRS:=applets archival archival/libunarchive coreutils console-tools \ | |||
33 | 31 | ||
34 | SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS)) | 32 | SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS)) |
35 | 33 | ||
36 | ifeq ($(strip $(CONFIG_SELINUX)),y) | 34 | # That's our default target when none is given on the command line |
37 | LIBRARIES += -lselinux | 35 | .PHONY: _all |
38 | endif | 36 | _all: |
37 | |||
38 | # All object directories. | ||
39 | OBJ_DIRS = scripts/config include $(DIRS) | ||
40 | $(OBJ_DIRS): | ||
41 | mkdir -p "$(patsubst %,$(top_builddir)/%,$@)" | ||
42 | |||
43 | scripts/config/Makefile: $(top_srcdir)/scripts/config/Makefile | ||
44 | cp -v $< $@ | ||
45 | |||
46 | include $(top_srcdir)/Rules.mak | ||
39 | 47 | ||
40 | CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in | 48 | CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in |
41 | CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig | 49 | CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig |
42 | 50 | ||
43 | ALL_DIRS:= $(DIRS) scripts/config | ||
44 | ALL_MAKEFILES:=$(patsubst %,%/Makefile,$(ALL_DIRS)) | ||
45 | |||
46 | ifeq ($(KBUILD_SRC),) | 51 | ifeq ($(KBUILD_SRC),) |
47 | 52 | ||
48 | ifdef O | 53 | ifdef O |
49 | ifeq ("$(origin O)", "command line") | 54 | ifeq ("$(origin O)", "command line") |
50 | KBUILD_OUTPUT := $(O) | 55 | KBUILD_OUTPUT := $(O) |
51 | endif | 56 | endif |
57 | else | ||
58 | # If no alternate output-dir was specified, we build in cwd | ||
59 | # We are using KBUILD_OUTPUT nevertheless to make sure that we create | ||
60 | # Rules.mak and the toplevel Makefile, in case they don't exist. | ||
61 | KBUILD_OUTPUT := $(top_builddir) | ||
52 | endif | 62 | endif |
53 | 63 | ||
54 | # That's our default target when none is given on the command line | ||
55 | .PHONY: _all | ||
56 | _all: | ||
57 | |||
58 | ifneq ($(KBUILD_OUTPUT),) | 64 | ifneq ($(KBUILD_OUTPUT),) |
59 | # Invoke a second make in the output directory, passing relevant variables | 65 | # Invoke a second make in the output directory, passing relevant variables |
60 | # check that the output directory actually exists | 66 | # check that the output directory actually exists |
@@ -63,24 +69,29 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd) | |||
63 | $(if $(wildcard $(KBUILD_OUTPUT)),, \ | 69 | $(if $(wildcard $(KBUILD_OUTPUT)),, \ |
64 | $(error output directory "$(saved-output)" does not exist)) | 70 | $(error output directory "$(saved-output)" does not exist)) |
65 | 71 | ||
72 | # We only need a copy of the Makefile for the config targets and reuse | ||
73 | # the rest from the source directory, i.e. we do not cp ALL_MAKEFILES. | ||
74 | all_tree: $(OBJ_DIRS) $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile scripts/config/Makefile | ||
75 | |||
66 | .PHONY: $(MAKECMDGOALS) | 76 | .PHONY: $(MAKECMDGOALS) |
67 | 77 | ||
68 | $(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile | 78 | $(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile all_tree |
79 | #all: | ||
69 | $(MAKE) -C $(KBUILD_OUTPUT) \ | 80 | $(MAKE) -C $(KBUILD_OUTPUT) \ |
70 | top_srcdir=$(CURDIR) \ | 81 | top_srcdir=$(top_srcdir) \ |
71 | top_builddir=$(KBUILD_OUTPUT) \ | 82 | top_builddir=$(top_builddir) \ |
72 | KBUILD_SRC=$(CURDIR) \ | 83 | KBUILD_SRC=$(top_srcdir) \ |
73 | -f $(CURDIR)/Makefile $@ | 84 | -f $(CURDIR)/Makefile $@ |
74 | 85 | ||
75 | $(KBUILD_OUTPUT)/Rules.mak: | 86 | $(KBUILD_OUTPUT)/Rules.mak: |
76 | @echo > $@ | 87 | @echo > $@ |
77 | @echo top_srcdir=$(CURDIR) >> $@ | 88 | @echo top_srcdir=$(top_srcdir) >> $@ |
78 | @echo top_builddir=$(KBUILD_OUTPUT) >> $@ | 89 | @echo top_builddir=$(KBUILD_OUTPUT) >> $@ |
79 | @echo include $(top_srcdir)/Rules.mak >> $@ | 90 | @echo include $(top_srcdir)/Rules.mak >> $@ |
80 | 91 | ||
81 | $(KBUILD_OUTPUT)/Makefile: | 92 | $(KBUILD_OUTPUT)/Makefile: |
82 | @echo > $@ | 93 | @echo > $@ |
83 | @echo top_srcdir=$(CURDIR) >> $@ | 94 | @echo top_srcdir=$(top_srcdir) >> $@ |
84 | @echo top_builddir=$(KBUILD_OUTPUT) >> $@ | 95 | @echo top_builddir=$(KBUILD_OUTPUT) >> $@ |
85 | @echo KBUILD_SRC='$$(top_srcdir)' >> $@ | 96 | @echo KBUILD_SRC='$$(top_srcdir)' >> $@ |
86 | @echo include '$$(KBUILD_SRC)'/Makefile >> $@ | 97 | @echo include '$$(KBUILD_SRC)'/Makefile >> $@ |
@@ -124,21 +135,61 @@ help: | |||
124 | @echo ' sizes - show size of all enabled busybox symbols' | 135 | @echo ' sizes - show size of all enabled busybox symbols' |
125 | @echo | 136 | @echo |
126 | 137 | ||
127 | ifeq ($(strip $(HAVE_DOT_CONFIG)),y) | ||
128 | 138 | ||
129 | all: busybox busybox.links doc | 139 | ifneq ($(strip $(HAVE_DOT_CONFIG)),y) |
140 | |||
141 | all: menuconfig | ||
130 | 142 | ||
131 | all_tree: $(ALL_MAKEFILES) | 143 | # configuration |
144 | # --------------------------------------------------------------------------- | ||
132 | 145 | ||
133 | $(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile | 146 | scripts/config/conf: scripts/config/Makefile |
134 | [ -d $(@D) ] || mkdir -p $(@D); cp $< $@ | 147 | $(MAKE) -C scripts/config conf |
148 | -@if [ ! -f .config ] ; then \ | ||
149 | cp $(CONFIG_DEFCONFIG) .config; \ | ||
150 | fi | ||
151 | |||
152 | scripts/config/mconf: scripts/config/Makefile | ||
153 | $(MAKE) -C scripts/config ncurses conf mconf | ||
154 | -@if [ ! -f .config ] ; then \ | ||
155 | cp $(CONFIG_DEFCONFIG) .config; \ | ||
156 | fi | ||
157 | |||
158 | menuconfig: scripts/config/mconf | ||
159 | @./scripts/config/mconf $(CONFIG_CONFIG_IN) | ||
160 | |||
161 | config: scripts/config/conf | ||
162 | @./scripts/config/conf $(CONFIG_CONFIG_IN) | ||
163 | |||
164 | oldconfig: scripts/config/conf | ||
165 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) | ||
166 | |||
167 | randconfig: scripts/config/conf | ||
168 | @./scripts/config/conf -r $(CONFIG_CONFIG_IN) | ||
169 | |||
170 | allyesconfig: scripts/config/conf | ||
171 | @./scripts/config/conf -y $(CONFIG_CONFIG_IN) | ||
172 | sed -i -r -e "s/^(CONFIG_DEBUG|USING_CROSS_COMPILER|CONFIG_STATIC|CONFIG_SELINUX).*/# \1 is not set/" .config | ||
173 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) | ||
174 | |||
175 | allnoconfig: scripts/config/conf | ||
176 | @./scripts/config/conf -n $(CONFIG_CONFIG_IN) | ||
177 | |||
178 | defconfig: scripts/config/conf | ||
179 | @./scripts/config/conf -d $(CONFIG_CONFIG_IN) | ||
180 | |||
181 | else # ifneq ($(strip $(HAVE_DOT_CONFIG)),y) | ||
182 | |||
183 | all: busybox busybox.links doc | ||
135 | 184 | ||
136 | # In this section, we need .config | 185 | # In this section, we need .config |
137 | -include $(top_builddir)/.config.cmd | 186 | -include $(top_builddir)/.config.cmd |
138 | include $(patsubst %,%/Makefile.in, $(SRC_DIRS)) | 187 | include $(patsubst %,%/Makefile.in, $(SRC_DIRS)) |
139 | -include $(top_builddir)/.depend | 188 | -include $(top_builddir)/.depend |
140 | 189 | ||
141 | busybox: $(ALL_MAKEFILES) .depend $(libraries-y) | 190 | endif # ifneq ($(strip $(HAVE_DOT_CONFIG)),y) |
191 | |||
192 | busybox: .depend $(libraries-y) | ||
142 | $(CC) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group | 193 | $(CC) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group |
143 | $(STRIPCMD) $@ | 194 | $(STRIPCMD) $@ |
144 | 195 | ||
@@ -217,7 +268,7 @@ ifeq ($(strip $(CONFIG_BBCONFIG)),y) | |||
217 | DEP_INCLUDES += include/bbconfigopts.h | 268 | DEP_INCLUDES += include/bbconfigopts.h |
218 | 269 | ||
219 | include/bbconfigopts.h: .config | 270 | include/bbconfigopts.h: .config |
220 | scripts/config/mkconfigs > $@ | 271 | $(top_srcdir)/scripts/config/mkconfigs > $@ |
221 | endif | 272 | endif |
222 | 273 | ||
223 | depend dep $(top_builddir)/.depend: .depend | 274 | depend dep $(top_builddir)/.depend: .depend |
@@ -245,48 +296,6 @@ finished2: | |||
245 | $(SECHO) Finished installing... | 296 | $(SECHO) Finished installing... |
246 | $(SECHO) | 297 | $(SECHO) |
247 | 298 | ||
248 | else # ifeq ($(strip $(HAVE_DOT_CONFIG)),y) | ||
249 | |||
250 | all: menuconfig | ||
251 | |||
252 | # configuration | ||
253 | # --------------------------------------------------------------------------- | ||
254 | |||
255 | scripts/config/conf: scripts/config/Makefile $(top_srcdir)/Rules.mak | ||
256 | $(MAKE) -C scripts/config conf | ||
257 | -@if [ ! -f .config ] ; then \ | ||
258 | cp $(CONFIG_DEFCONFIG) .config; \ | ||
259 | fi | ||
260 | |||
261 | scripts/config/mconf: scripts/config/Makefile $(top_srcdir)/Rules.mak | ||
262 | $(MAKE) -C scripts/config ncurses conf mconf | ||
263 | -@if [ ! -f .config ] ; then \ | ||
264 | cp $(CONFIG_DEFCONFIG) .config; \ | ||
265 | fi | ||
266 | |||
267 | menuconfig: scripts/config/mconf | ||
268 | @./scripts/config/mconf $(CONFIG_CONFIG_IN) | ||
269 | |||
270 | config: scripts/config/conf | ||
271 | @./scripts/config/conf $(CONFIG_CONFIG_IN) | ||
272 | |||
273 | oldconfig: scripts/config/conf | ||
274 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) | ||
275 | |||
276 | randconfig: scripts/config/conf | ||
277 | @./scripts/config/conf -r $(CONFIG_CONFIG_IN) | ||
278 | |||
279 | allyesconfig: scripts/config/conf | ||
280 | @./scripts/config/conf -y $(CONFIG_CONFIG_IN) | ||
281 | sed -i -r -e "s/^(CONFIG_DEBUG|USING_CROSS_COMPILER|CONFIG_STATIC|CONFIG_SELINUX).*/# \1 is not set/" .config | ||
282 | @./scripts/config/conf -o $(CONFIG_CONFIG_IN) | ||
283 | |||
284 | allnoconfig: scripts/config/conf | ||
285 | @./scripts/config/conf -n $(CONFIG_CONFIG_IN) | ||
286 | |||
287 | defconfig: scripts/config/conf | ||
288 | @./scripts/config/conf -d $(CONFIG_CONFIG_IN) | ||
289 | |||
290 | clean: | 299 | clean: |
291 | - $(MAKE) -C scripts/config $@ | 300 | - $(MAKE) -C scripts/config $@ |
292 | - rm -f docs/busybox.dvi docs/busybox.ps \ | 301 | - rm -f docs/busybox.dvi docs/busybox.ps \ |
@@ -327,8 +336,6 @@ tags: | |||
327 | ctags -R . | 336 | ctags -R . |
328 | 337 | ||
329 | 338 | ||
330 | endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y) | ||
331 | |||
332 | endif # ifeq ($(skip-makefile),) | 339 | endif # ifeq ($(skip-makefile),) |
333 | 340 | ||
334 | .PHONY: dummy subdirs release distclean clean config oldconfig \ | 341 | .PHONY: dummy subdirs release distclean clean config oldconfig \ |
@@ -1,4 +1,5 @@ | |||
1 | Please see the LICENSE file for details on copying and usage. | 1 | Please see the LICENSE file for details on copying and usage. |
2 | Please refer to the INSTALL file for instructions on how to build. | ||
2 | 3 | ||
3 | BusyBox combines tiny versions of many common UNIX utilities into a single | 4 | BusyBox combines tiny versions of many common UNIX utilities into a single |
4 | small executable. It provides minimalist replacements for most of the utilities | 5 | small executable. It provides minimalist replacements for most of the utilities |
@@ -15,17 +16,8 @@ BusyBox provides a fairly complete POSIX environment for any small or embedded | |||
15 | system. | 16 | system. |
16 | 17 | ||
17 | BusyBox is extremely configurable. This allows you to include only the | 18 | BusyBox is extremely configurable. This allows you to include only the |
18 | components you need, thereby reducing binary size. Run 'make config' or | 19 | components you need, thereby reducing binary size. See the file INSTALL |
19 | 'make menuconfig' to select the functionality that you wish to enable. | 20 | for details. |
20 | |||
21 | After the build is complete, a busybox.links file is generated. This is | ||
22 | used by 'make install' to create symlinks to the BusyBox binary for all | ||
23 | compiled in functions. By default, 'make install' will place the symlink | ||
24 | forest into `pwd`/_install unless you have defined the PREFIX environment | ||
25 | variable (i.e., 'make PREFIX=/tmp/foo install') | ||
26 | |||
27 | If you wish to install hard links, rather than symlinks, you can use | ||
28 | 'make PREFIX=/tmp/foo install-hardlinks' instead. | ||
29 | 21 | ||
30 | ---------------- | 22 | ---------------- |
31 | 23 | ||
@@ -110,14 +102,14 @@ be downloaded from | |||
110 | 102 | ||
111 | CVS: | 103 | CVS: |
112 | 104 | ||
113 | BusyBox now has its own publicly browsable CVS tree at: | 105 | BusyBox now has its own publicly browsable SVN tree at: |
114 | http://busybox.net/cgi-bin/cvsweb/busybox/ | 106 | http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/ |
115 | 107 | ||
116 | Anonymous CVS access is available. For instructions, check out: | 108 | Anonymous SVN access is available. For instructions, check out: |
117 | http://busybox.net/cvs_anon.html | 109 | http://busybox.net/subversion.html |
118 | 110 | ||
119 | For those that are actively contributing there is even CVS write access: | 111 | For those that are actively contributing there is even SVN write access: |
120 | http://busybox.net/cvs_write.html | 112 | http://busybox.net/developer.html |
121 | 113 | ||
122 | ---------------- | 114 | ---------------- |
123 | 115 | ||
@@ -27,7 +27,7 @@ BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z") | |||
27 | # With a modern GNU make(1) (highly recommended, that's what all the | 27 | # With a modern GNU make(1) (highly recommended, that's what all the |
28 | # developers use), all of the following configuration values can be | 28 | # developers use), all of the following configuration values can be |
29 | # overridden at the command line. For example: | 29 | # overridden at the command line. For example: |
30 | # make CROSS=powerpc-linux- BB_SRC_DIR=$HOME/busybox PREFIX=/mnt/app | 30 | # make CROSS=powerpc-linux- top_srcdir="$HOME/busybox" PREFIX=/mnt/app |
31 | #-------------------------------------------------------- | 31 | #-------------------------------------------------------- |
32 | 32 | ||
33 | # If you are running a cross compiler, you will want to set 'CROSS' | 33 | # If you are running a cross compiler, you will want to set 'CROSS' |
@@ -60,11 +60,6 @@ LC_ALL:= C | |||
60 | # For optimization overrides, it's better still to set OPTIMIZATION. | 60 | # For optimization overrides, it's better still to set OPTIMIZATION. |
61 | CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS))) | 61 | CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS))) |
62 | 62 | ||
63 | # If you have a "pristine" source directory, point BB_SRC_DIR to it. | ||
64 | # Experimental and incomplete; tell the mailing list | ||
65 | # <busybox@busybox.net> if you do or don't like it so far. | ||
66 | BB_SRC_DIR= | ||
67 | |||
68 | # To compile vs some other alternative libc, you may need to use/adjust | 63 | # To compile vs some other alternative libc, you may need to use/adjust |
69 | # the following lines to meet your needs... | 64 | # the following lines to meet your needs... |
70 | # | 65 | # |
@@ -176,19 +171,20 @@ ifeq ($(strip $(CONFIG_STATIC)),y) | |||
176 | LDFLAGS += --static | 171 | LDFLAGS += --static |
177 | endif | 172 | endif |
178 | 173 | ||
174 | ifeq ($(strip $(CONFIG_SELINUX)),y) | ||
175 | LIBRARIES += -lselinux | ||
176 | endif | ||
177 | |||
179 | ifeq ($(strip $(PREFIX)),) | 178 | ifeq ($(strip $(PREFIX)),) |
180 | PREFIX:=`pwd`/_install | 179 | PREFIX:=`pwd`/_install |
181 | endif | 180 | endif |
182 | 181 | ||
183 | # Additional complications due to support for pristine source dir. | 182 | # Additional complications due to support for pristine source dir. |
184 | # Include files in the build directory should take precedence over | 183 | # Include files in the build directory should take precedence over |
185 | # the copy in BB_SRC_DIR, both during the compilation phase and the | 184 | # the copy in top_srcdir, both during the compilation phase and the |
186 | # shell script that finds the list of object files. | 185 | # shell script that finds the list of object files. |
187 | # Work in progress by <ldoolitt@recycle.lbl.gov>. | 186 | # Work in progress by <ldoolitt@recycle.lbl.gov>. |
188 | # | 187 | |
189 | ifneq ($(strip $(BB_SRC_DIR)),) | ||
190 | VPATH:=$(BB_SRC_DIR) | ||
191 | endif | ||
192 | 188 | ||
193 | OBJECTS:=$(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o | 189 | OBJECTS:=$(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o |
194 | CFLAGS += $(CROSS_CFLAGS) | 190 | CFLAGS += $(CROSS_CFLAGS) |
diff --git a/e2fsprogs/Makefile b/e2fsprogs/Makefile index a4b0b785f..e6299e6dd 100644 --- a/e2fsprogs/Makefile +++ b/e2fsprogs/Makefile | |||
@@ -8,8 +8,8 @@ top_srcdir=.. | |||
8 | top_builddir=.. | 8 | top_builddir=.. |
9 | srcdir=$(top_srcdir)/e2fsprogs | 9 | srcdir=$(top_srcdir)/e2fsprogs |
10 | E2FSPROGS_DIR:=./ | 10 | E2FSPROGS_DIR:=./ |
11 | include $(top_builddir)/Rules.mak | ||
12 | include $(top_builddir)/.config | 11 | include $(top_builddir)/.config |
12 | include $(top_builddir)/Rules.mak | ||
13 | include Makefile.in | 13 | include Makefile.in |
14 | all: $(libraries-y) | 14 | all: $(libraries-y) |
15 | -include $(top_builddir)/.depend | 15 | -include $(top_builddir)/.depend |
diff --git a/e2fsprogs/Makefile.in b/e2fsprogs/Makefile.in index 0353a161f..46a684ee7 100644 --- a/e2fsprogs/Makefile.in +++ b/e2fsprogs/Makefile.in | |||
@@ -39,7 +39,18 @@ UUID_SRC := compare.c gen_uuid.c pack.c parse.c unpack.c unparse.c \ | |||
39 | UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC)) | 39 | UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC)) |
40 | UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS)) | 40 | UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS)) |
41 | 41 | ||
42 | E2FSPROGS-:= | 42 | # for building out-of-tree we need to make sure that the directories to hold |
43 | # the object tree are created | ||
44 | $(patsubst %,$(E2FSPROGS_DIR)/%, blkid e2fsck e2p ext2fs uuid): | ||
45 | mkdir -p "$@" | ||
46 | |||
47 | $(patsubst %,$(E2FSPROGS_DIR)/%, $(BLKID_OBJS)):$(E2FSPROGS_DIR)/blkid | ||
48 | $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSCK_OBJS)):$(E2FSPROGS_DIR)/e2fsck | ||
49 | $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2P_OBJS)):$(E2FSPROGS_DIR)/e2p | ||
50 | $(patsubst %,$(E2FSPROGS_DIR)/%, $(EXT2FS_OBJS)):$(E2FSPROGS_DIR)/ext2fs | ||
51 | $(patsubst %,$(E2FSPROGS_DIR)/%, $(UUID_OBJS)):$(E2FSPROGS_DIR)/uuid | ||
52 | |||
53 | E2FSPROGS-y:= | ||
43 | E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS) | 54 | E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS) |
44 | E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS) | 55 | E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS) |
45 | E2FSPROGS-$(CONFIG_FSCK) += fsck.o base_device.o $(BLKID_OBJS) $(UUID_OBJS) | 56 | E2FSPROGS-$(CONFIG_FSCK) += fsck.o base_device.o $(BLKID_OBJS) $(UUID_OBJS) |
@@ -53,5 +64,6 @@ libraries-y+=$(E2FSPROGS_DIR)/$(E2FSPROGS_AR) | |||
53 | $(E2FSPROGS_DIR)/$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y)) | 64 | $(E2FSPROGS_DIR)/$(E2FSPROGS_AR): $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y)) |
54 | $(AR) $(ARFLAGS) $@ $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y)) | 65 | $(AR) $(ARFLAGS) $@ $(patsubst %,$(E2FSPROGS_DIR)/%, $(E2FSPROGS-y)) |
55 | 66 | ||
56 | $(E2FSPROGS_DIR)/%.o: $(E2FSPROGS_DIR)/%.c | 67 | $(E2FSPROGS_DIR)/%.o: $(subst $(top_builddir),$(top_srcdir),$(E2FSPROGS_DIR)/%.c) |
57 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(E2FSPROGS_CFLAGS) -c -o $@ $< | 68 | $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(E2FSPROGS_CFLAGS) -c -o $@ $< |
69 | |||