aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 29 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 8af079062..5f5c80e6d 100644
--- a/Makefile
+++ b/Makefile
@@ -200,7 +200,7 @@ endif
200# And option 4: 200# And option 4:
201-include applet_source_list 201-include applet_source_list
202 202
203OBJECTS = $(APPLET_SOURCES:.c=.o) busybox.o messages.o usage.o utility.o 203OBJECTS = $(APPLET_SOURCES:.c=.o) busybox.o messages.o usage.o applets.o mtab_file.o
204CFLAGS += $(CROSS_CFLAGS) 204CFLAGS += $(CROSS_CFLAGS)
205CFLAGS += -DBB_VER='"$(VERSION)"' 205CFLAGS += -DBB_VER='"$(VERSION)"'
206CFLAGS += -DBB_BT='"$(BUILDTIME)"' 206CFLAGS += -DBB_BT='"$(BUILDTIME)"'
@@ -220,6 +220,21 @@ ifneq ($(strip $(USE_SYSTEM_PWD_GRP)),true)
220else 220else
221 CFLAGS += -DUSE_SYSTEM_PWD_GRP 221 CFLAGS += -DUSE_SYSTEM_PWD_GRP
222endif 222endif
223
224LIBBB = libbb
225LIBBB_DIR = $(BB_SRC_DIR:=/)$(LIBBB)
226LIBBB_LIB = libbb.a
227LIBBB_CSRC= ask_confirmation.c check_wildcard_match.c chomp.c copy_file.c \
228copy_file_chunk.c create_path.c device_open.c error_msg.c \
229find_mount_point.c find_pid_by_name.c find_root_device.c full_read.c \
230full_write.c get_console.c get_last_path_component.c get_line_from_file.c \
231human_readable.c inode_hash.c isdirectory.c kernel_version.c loop.c \
232mode_string.c parse_mode.c parse_number.c print_file.c process_escape_sequence.c \
233pwd_grp_wrappers.c recursive_action.c safe_read.c safe_strncpy.c syscalls.c \
234syslog_msg_with_name.c time_string.c trim.c vdprintf.c wfopen.c xfuncs.c \
235xregcomp.c
236LIBBB_OBJS=$(patsubst %.c,$(LIBBB)/%.o, $(LIBBB_CSRC))
237LIBBB_CFLAGS = -I$(LIBBB_DIR)
223 238
224# Put user-supplied flags at the end, where they 239# Put user-supplied flags at the end, where they
225# have a chance of winning. 240# have a chance of winning.
@@ -288,8 +303,8 @@ docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
288 (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml) 303 (cd docs/busybox.lineo.com; sgmltools -b html ../busybox.sgml)
289 304
290 305
291busybox: $(PWD_LIB) $(OBJECTS) 306busybox: $(PWD_LIB) $(LIBBB_LIB) $(OBJECTS)
292 $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBRARIES) $(PWD_LIB) 307 $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBRARIES) $(PWD_LIB) $(LIBBB_LIB)
293 $(STRIP) 308 $(STRIP)
294 309
295# Without VPATH, rule expands to "/bin/sh busybox.mkll Config.h applets.h" 310# Without VPATH, rule expands to "/bin/sh busybox.mkll Config.h applets.h"
@@ -307,14 +322,21 @@ $(PWD_OBJS): %.o: %.c Config.h busybox.h applets.h Makefile
307 - mkdir -p $(PWD_GRP) 322 - mkdir -p $(PWD_GRP)
308 $(CC) $(CFLAGS) $(PWD_CFLAGS) -c $< -o $*.o 323 $(CC) $(CFLAGS) $(PWD_CFLAGS) -c $< -o $*.o
309 324
325$(LIBBB_OBJS): %.o: %.c Config.h busybox.h applets.h Makefile
326 - mkdir -p $(LIBBB)
327 $(CC) $(CFLAGS) $(LIBBB_CFLAGS) -c $< -o $*.o
328
310libpwd.a: $(PWD_OBJS) 329libpwd.a: $(PWD_OBJS)
311 $(AR) $(ARFLAGS) $@ $^ 330 $(AR) $(ARFLAGS) $@ $^
312 331
332libbb.a: $(LIBBB_OBJS)
333 $(AR) $(ARFLAGS) $@ $^
334
313usage.o: usage.h 335usage.o: usage.h
314 336
315utility.o: loop.h 337libbb/loop.o: libbb/loop.h
316 338
317loop.h: mk_loop_h.sh 339libbb/loop.h: mk_loop_h.sh
318 @ $(SHELL) $< > $@ 340 @ $(SHELL) $< > $@
319 341
320test tests: 342test tests:
@@ -330,8 +352,8 @@ clean:
330 - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \ 352 - rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
331 docs/busybox.pdf docs/busybox.lineo.com/busybox.html 353 docs/busybox.pdf docs/busybox.lineo.com/busybox.html
332 - rm -f multibuild.log Config.h.orig 354 - rm -f multibuild.log Config.h.orig
333 - rm -rf docs/busybox _install libpwd.a 355 - rm -rf docs/busybox _install libpwd.a libbb.a
334 - rm -f busybox.links loop.h *~ slist.mk core applet_source_list 356 - rm -f busybox.links libbb/loop.h *~ slist.mk core applet_source_list
335 - find -name \*.o -exec rm -f {} \; 357 - find -name \*.o -exec rm -f {} \;
336 358
337distclean: clean 359distclean: clean