aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2005-10-05 07:40:46 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2005-10-05 07:40:46 +0000
commit5c071bcf2f6bc923b5d6779b3563d08b80a8949d (patch)
tree2f116d1bedfb7bddc5d9be9c9d1829944703f388
parentdc2510327b43ab5ce18c1752304015fad4663bad (diff)
downloadbusybox-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--INSTALL48
-rw-r--r--Makefile145
-rw-r--r--README26
-rw-r--r--Rules.mak18
-rw-r--r--e2fsprogs/Makefile2
-rw-r--r--e2fsprogs/Makefile.in16
6 files changed, 149 insertions, 106 deletions
diff --git a/INSTALL b/INSTALL
index 921477209..00ba6633a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,14 +1,50 @@
1Building:
2=========
3
4You will usually build in the source-tree.
5
6Alternatively you can build out-of-tree to have the object files separated
7from the source. This allows for building several different configurations
8from the same set of sources.
9
10A) Building in the source-tree:
11-------------------------------
12
11) Run 'make config' or 'make menuconfig' and select the 131) 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
42) Run 'make' 162) Run 'make'
5 17
63) Go get a drink of water, drink a soda, visit the bathroom, 183) 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
114) 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
23B) Building out-of-tree:
24------------------------
25
261) 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
39Installation:
40=============
41
42After the build is complete, a busybox.links file is generated. This is
43used by 'make install' to create symlinks to the BusyBox binary for all
44compiled in functions. By default, 'make install' will place the symlink
45forest into `pwd`/_install unless you have defined the PREFIX environment
46variable (i.e., 'make PREFIX=/tmp/foo install')
47
48If you wish to install hard links, rather than symlinks, you can use
49'make PREFIX=/tmp/foo install-hardlinks' instead.
50
diff --git a/Makefile b/Makefile
index f71c53694..7f29037f5 100644
--- a/Makefile
+++ b/Makefile
@@ -24,8 +24,6 @@ endif
24export srctree=$(top_srcdir) 24export srctree=$(top_srcdir)
25vpath %/Config.in $(srctree) 25vpath %/Config.in $(srctree)
26 26
27include $(top_srcdir)/Rules.mak
28
29DIRS:=applets archival archival/libunarchive coreutils console-tools \ 27DIRS:=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
34SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS)) 32SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS))
35 33
36ifeq ($(strip $(CONFIG_SELINUX)),y) 34# That's our default target when none is given on the command line
37LIBRARIES += -lselinux 35.PHONY: _all
38endif 36_all:
37
38# All object directories.
39OBJ_DIRS = scripts/config include $(DIRS)
40$(OBJ_DIRS):
41 mkdir -p "$(patsubst %,$(top_builddir)/%,$@)"
42
43scripts/config/Makefile: $(top_srcdir)/scripts/config/Makefile
44 cp -v $< $@
45
46include $(top_srcdir)/Rules.mak
39 47
40CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in 48CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in
41CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig 49CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig
42 50
43ALL_DIRS:= $(DIRS) scripts/config
44ALL_MAKEFILES:=$(patsubst %,%/Makefile,$(ALL_DIRS))
45
46ifeq ($(KBUILD_SRC),) 51ifeq ($(KBUILD_SRC),)
47 52
48ifdef O 53ifdef 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
57else
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)
52endif 62endif
53 63
54# That's our default target when none is given on the command line
55.PHONY: _all
56_all:
57
58ifneq ($(KBUILD_OUTPUT),) 64ifneq ($(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.
74all_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
127ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
128 138
129all: busybox busybox.links doc 139ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
140
141all: menuconfig
130 142
131all_tree: $(ALL_MAKEFILES) 143# configuration
144# ---------------------------------------------------------------------------
132 145
133$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile 146scripts/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
152scripts/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
158menuconfig: scripts/config/mconf
159 @./scripts/config/mconf $(CONFIG_CONFIG_IN)
160
161config: scripts/config/conf
162 @./scripts/config/conf $(CONFIG_CONFIG_IN)
163
164oldconfig: scripts/config/conf
165 @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
166
167randconfig: scripts/config/conf
168 @./scripts/config/conf -r $(CONFIG_CONFIG_IN)
169
170allyesconfig: 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
175allnoconfig: scripts/config/conf
176 @./scripts/config/conf -n $(CONFIG_CONFIG_IN)
177
178defconfig: scripts/config/conf
179 @./scripts/config/conf -d $(CONFIG_CONFIG_IN)
180
181else # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
182
183all: 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
138include $(patsubst %,%/Makefile.in, $(SRC_DIRS)) 187include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
139-include $(top_builddir)/.depend 188-include $(top_builddir)/.depend
140 189
141busybox: $(ALL_MAKEFILES) .depend $(libraries-y) 190endif # ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
191
192busybox: .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)
217DEP_INCLUDES += include/bbconfigopts.h 268DEP_INCLUDES += include/bbconfigopts.h
218 269
219include/bbconfigopts.h: .config 270include/bbconfigopts.h: .config
220 scripts/config/mkconfigs > $@ 271 $(top_srcdir)/scripts/config/mkconfigs > $@
221endif 272endif
222 273
223depend dep $(top_builddir)/.depend: .depend 274depend dep $(top_builddir)/.depend: .depend
@@ -245,48 +296,6 @@ finished2:
245 $(SECHO) Finished installing... 296 $(SECHO) Finished installing...
246 $(SECHO) 297 $(SECHO)
247 298
248else # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
249
250all: menuconfig
251
252# configuration
253# ---------------------------------------------------------------------------
254
255scripts/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
261scripts/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
267menuconfig: scripts/config/mconf
268 @./scripts/config/mconf $(CONFIG_CONFIG_IN)
269
270config: scripts/config/conf
271 @./scripts/config/conf $(CONFIG_CONFIG_IN)
272
273oldconfig: scripts/config/conf
274 @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
275
276randconfig: scripts/config/conf
277 @./scripts/config/conf -r $(CONFIG_CONFIG_IN)
278
279allyesconfig: 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
284allnoconfig: scripts/config/conf
285 @./scripts/config/conf -n $(CONFIG_CONFIG_IN)
286
287defconfig: scripts/config/conf
288 @./scripts/config/conf -d $(CONFIG_CONFIG_IN)
289
290clean: 299clean:
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
330endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
331
332endif # ifeq ($(skip-makefile),) 339endif # ifeq ($(skip-makefile),)
333 340
334.PHONY: dummy subdirs release distclean clean config oldconfig \ 341.PHONY: dummy subdirs release distclean clean config oldconfig \
diff --git a/README b/README
index bf2ae6f3f..d9bac59cf 100644
--- a/README
+++ b/README
@@ -1,4 +1,5 @@
1Please see the LICENSE file for details on copying and usage. 1Please see the LICENSE file for details on copying and usage.
2Please refer to the INSTALL file for instructions on how to build.
2 3
3BusyBox combines tiny versions of many common UNIX utilities into a single 4BusyBox combines tiny versions of many common UNIX utilities into a single
4small executable. It provides minimalist replacements for most of the utilities 5small 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
15system. 16system.
16 17
17BusyBox is extremely configurable. This allows you to include only the 18BusyBox is extremely configurable. This allows you to include only the
18components you need, thereby reducing binary size. Run 'make config' or 19components you need, thereby reducing binary size. See the file INSTALL
19'make menuconfig' to select the functionality that you wish to enable. 20for details.
20
21After the build is complete, a busybox.links file is generated. This is
22used by 'make install' to create symlinks to the BusyBox binary for all
23compiled in functions. By default, 'make install' will place the symlink
24forest into `pwd`/_install unless you have defined the PREFIX environment
25variable (i.e., 'make PREFIX=/tmp/foo install')
26
27If 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
111CVS: 103CVS:
112 104
113BusyBox now has its own publicly browsable CVS tree at: 105BusyBox 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
116Anonymous CVS access is available. For instructions, check out: 108Anonymous SVN access is available. For instructions, check out:
117 http://busybox.net/cvs_anon.html 109 http://busybox.net/subversion.html
118 110
119For those that are actively contributing there is even CVS write access: 111For 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
diff --git a/Rules.mak b/Rules.mak
index b18d09b96..1e519fbf1 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -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.
61CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS))) 61CFLAGS_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.
66BB_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
177endif 172endif
178 173
174ifeq ($(strip $(CONFIG_SELINUX)),y)
175 LIBRARIES += -lselinux
176endif
177
179ifeq ($(strip $(PREFIX)),) 178ifeq ($(strip $(PREFIX)),)
180 PREFIX:=`pwd`/_install 179 PREFIX:=`pwd`/_install
181endif 180endif
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
189ifneq ($(strip $(BB_SRC_DIR)),)
190 VPATH:=$(BB_SRC_DIR)
191endif
192 188
193OBJECTS:=$(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o 189OBJECTS:=$(APPLET_SOURCES:.c=.o) busybox.o usage.o applets.o
194CFLAGS += $(CROSS_CFLAGS) 190CFLAGS += $(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=..
8top_builddir=.. 8top_builddir=..
9srcdir=$(top_srcdir)/e2fsprogs 9srcdir=$(top_srcdir)/e2fsprogs
10E2FSPROGS_DIR:=./ 10E2FSPROGS_DIR:=./
11include $(top_builddir)/Rules.mak
12include $(top_builddir)/.config 11include $(top_builddir)/.config
12include $(top_builddir)/Rules.mak
13include Makefile.in 13include Makefile.in
14all: $(libraries-y) 14all: $(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 \
39UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC)) 39UUID_SRCS := $(patsubst %,uuid/%, $(UUID_SRC))
40UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS)) 40UUID_OBJS := $(patsubst %.c,%.o, $(UUID_SRCS))
41 41
42E2FSPROGS-:= 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
53E2FSPROGS-y:=
43E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS) 54E2FSPROGS-$(CONFIG_CHATTR) += chattr.o $(E2P_OBJS)
44E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS) 55E2FSPROGS-$(CONFIG_E2FSCK) += e2fsck.o util.o $(BLKID_OBJS) $(EXT2FS_OBJS) $(UUID_OBJS)
45E2FSPROGS-$(CONFIG_FSCK) += fsck.o base_device.o $(BLKID_OBJS) $(UUID_OBJS) 56E2FSPROGS-$(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