source: branches/stable/mindi-busybox/libbb/Makefile.in @ 902

Last change on this file since 902 was 902, checked in by Bruno Cornec, 14 years ago

mindi-busybox now uses busybox 1.2.2 (Thanks Rob for that last update and good lucck for your future projects).

File size: 5.7 KB
Line 
1# Makefile for busybox
2#
3# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
4#
5# Licensed under the GPL v2, see the file LICENSE in this tarball.
6
7ifndef $(LIBBB_DIR)
8LIBBB_DIR:=$(top_builddir)/libbb
9endif
10srcdir=$(top_srcdir)/libbb
11
12LIBBB-n:=
13LIBBB-y:= \
14    bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
15    compare_string_array.c concat_path_file.c copy_file.c copyfd.c \
16    crc32.c create_icmp_socket.c create_icmp6_socket.c \
17    device_open.c dump.c error_msg.c error_msg_and_die.c \
18    find_pid_by_name.c find_root_device.c fgets_str.c full_read.c \
19    full_write.c get_last_path_component.c get_line_from_file.c \
20    herror_msg.c herror_msg_and_die.c \
21    human_readable.c inet_common.c inode_hash.c isdirectory.c \
22    kernel_version.c last_char_is.c login.c \
23    make_directory.c md5.c mode_string.c mtab_file.c \
24    obscure.c parse_mode.c parse_number.c perror_msg.c \
25    perror_msg_and_die.c print_file.c get_console.c \
26    process_escape_sequence.c procps.c qmodule.c \
27    read_package_field.c recursive_action.c remove_file.c \
28    restricted_shell.c run_parts.c run_shell.c safe_read.c safe_write.c \
29    safe_strncpy.c setup_environment.c sha1.c simplify_path.c \
30    trim.c u_signal_names.c vdprintf.c verror_msg.c \
31    vherror_msg.c vperror_msg.c wfopen.c xconnect.c xgetcwd.c xstat.c \
32    xgethostbyname.c xgethostbyname2.c xreadlink.c xgetlarg.c \
33    bb_xsocket.c bb_xdaemon.c bb_xbind.c bb_xlisten.c bb_xchdir.c \
34    get_terminal_width_height.c fclose_nonstdin.c fflush_stdout_and_exit.c \
35    getopt_ulflags.c default_error_retval.c wfopen_input.c speed_table.c \
36    perror_nomsg_and_die.c perror_nomsg.c skip_whitespace.c bb_askpass.c \
37    warn_ignoring_args.c concat_subpath_file.c vfork_daemon_rexec.c \
38    bb_do_delay.c
39
40# conditionally compiled objects:
41LIBBB-$(CONFIG_FEATURE_SHADOWPASSWDS)+=pwd2spwd.c
42LIBBB-$(CONFIG_FEATURE_MOUNT_LOOP)+= loop.c
43LIBBB-$(CONFIG_LOSETUP)+= loop.c
44LIBBB-$(CONFIG_FEATURE_MTAB_SUPPORT)+= mtab.c
45LIBBB-$(CONFIG_PASSWD)+= pw_encrypt.c
46LIBBB-$(CONFIG_SULOGIN)+= pw_encrypt.c
47LIBBB-$(CONFIG_FEATURE_HTTPD_AUTH_MD5)+= pw_encrypt.c
48LIBBB-$(CONFIG_VLOCK)+= correct_password.c
49LIBBB-$(CONFIG_SU)+= correct_password.c
50LIBBB-$(CONFIG_LOGIN)+= correct_password.c
51LIBBB-$(CONFIG_DF)+= find_mount_point.c
52LIBBB-$(CONFIG_EJECT)+= find_mount_point.c
53
54# We shouldn't build xregcomp.c if we don't need it - this ensures we don't
55# require regex.h to be in the include dir even if we don't need it thereby
56# allowing us to build busybox even if uclibc regex support is disabled.
57
58regex-y:=
59regex-$(CONFIG_AWK) += xregcomp.c
60regex-$(CONFIG_SED) += xregcomp.c
61regex-$(CONFIG_LESS) += xregcomp.c
62regex-$(CONFIG_DEVFSD) += xregcomp.c
63regex-$(CONFIG_MDEV) += xregcomp.c
64regex-$(CONFIG_GREP) += xregcomp.c
65
66# Sort has the happy side efect of returning a unique list
67LIBBB-y += $(sort $(regex-y))
68
69LIBBB-y:=$(patsubst %,$(srcdir)/%,$(LIBBB-y))
70
71get-file-subparts = $(addsuffix .o,$(shell sed -n -e "s/^\#ifdef L_//p" ${1}))
72
73# 1:N objects
74LIBBB_MSRC0:=$(srcdir)/messages.c
75LIBBB_MOBJ0:=$(call get-file-subparts, ${LIBBB_MSRC0})
76LIBBB_MOBJ0:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ0))
77$(LIBBB_MOBJ0):$(LIBBB_MSRC0)
78    $(compile.c) -DL_$(notdir $*)
79
80LIBBB_MSRC1:=$(srcdir)/xfuncs.c
81LIBBB_MOBJ1:=$(call get-file-subparts, ${LIBBB_MSRC1})
82LIBBB_MOBJ1:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ1))
83$(LIBBB_MOBJ1):$(LIBBB_MSRC1)
84    $(compile.c) -DL_$(notdir $*)
85
86LIBBB_MSRC2:=$(srcdir)/printf.c
87LIBBB_MOBJ2:=$(call get-file-subparts, ${LIBBB_MSRC2})
88LIBBB_MOBJ2:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ2))
89$(LIBBB_MOBJ2):$(LIBBB_MSRC2)
90    $(compile.c) -DL_$(notdir $*)
91
92LIBBB_MSRC3:=$(srcdir)/xgetularg.c
93LIBBB_MOBJ3:=$(call get-file-subparts, ${LIBBB_MSRC3})
94LIBBB_MOBJ3:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ3))
95$(LIBBB_MOBJ3):$(LIBBB_MSRC3)
96    $(compile.c) -DL_$(notdir $*)
97
98LIBBB_MSRC4:=$(srcdir)/safe_strtol.c
99LIBBB_MOBJ4:=$(call get-file-subparts, ${LIBBB_MSRC4})
100LIBBB_MOBJ4:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ4))
101$(LIBBB_MOBJ4):$(LIBBB_MSRC4)
102    $(compile.c) -DL_$(notdir $*)
103
104LIBBB_MSRC5:=$(srcdir)/bb_pwd.c
105LIBBB_MOBJ5:=$(call get-file-subparts, ${LIBBB_MSRC5})
106LIBBB_MOBJ5:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ5))
107$(LIBBB_MOBJ5):$(LIBBB_MSRC5)
108    $(compile.c) -DL_$(notdir $*)
109
110LIBBB_MSRC6:=$(srcdir)/llist.c
111LIBBB_MOBJ6:=$(call get-file-subparts, ${LIBBB_MSRC6})
112LIBBB_MOBJ6:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ6))
113$(LIBBB_MOBJ6):$(LIBBB_MSRC6)
114    $(compile.c) -DL_$(notdir $*)
115
116LIBBB_MSRC7:=$(srcdir)/opendir.c
117LIBBB_MOBJ7:=$(call get-file-subparts, ${LIBBB_MSRC7})
118LIBBB_MOBJ7:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ7))
119$(LIBBB_MOBJ7):$(LIBBB_MSRC7)
120    $(compile.c) -DL_$(notdir $*)
121
122# We need the names of the object files built from MSRC for the L_ defines
123LIBBB_ALL_MOBJ:=$(LIBBB_MOBJ0) $(LIBBB_MOBJ1) $(LIBBB_MOBJ2) $(LIBBB_MOBJ3) \
124    $(LIBBB_MOBJ4) $(LIBBB_MOBJ5) $(LIBBB_MOBJ6) $(LIBBB_MOBJ7)
125
126LIBBB_ALL_MSRC:=$(LIBBB_MSRC0) $(LIBBB_MSRC1) $(LIBBB_MSRC2) $(LIBBB_MSRC3) \
127    $(LIBBB_MSRC4) $(LIBBB_MSRC5) $(LIBBB_MSRC6) $(LIBBB_MSRC7)
128
129LIBBB-y:=$(sort $(LIBBB-y) $(LIBBB_ALL_MSRC))
130
131LIBBB_AR:=$(LIBBB_DIR)/libbb.a
132libraries-y+=$(LIBBB_AR)
133
134needcrypt-y:=
135ifneq ($(filter $(srcdir)/pw_encrypt.c,$(LIBBB-y)),)
136needcrypt-y:=y
137else
138ifneq ($(filter $(srcdir)/correct_password.c,$(LIBBB-y)),)
139needcrypt-y:=y
140endif
141endif
142
143ifeq ($(needcrypt-y),y)
144  LIBRARIES := -lcrypt $(filter-out -lcrypt,$(LIBRARIES))
145endif
146
147# all 1:1 objects
148LIBBB_OBJS:=$(patsubst $(srcdir)/%.c,$(LIBBB_DIR)/%.o, $(LIBBB-y))
149$(LIBBB_DIR)/%.o: $(srcdir)/%.c
150    $(compile.c)
151
152LIBBB_SRC-a:=$(wildcard $(srcdir)/*.c)
153LIBRARY_SRC-y+=$(LIBBB-y)
154LIBRARY_SRC-a+=$(LIBBB_SRC-a)
155
156# all defines needed for 1:N objects
157LIBBB_DEFINE-y:=$(patsubst %,-DL_%,$(subst .o,,$(notdir $(LIBBB_ALL_MOBJ))))
158LIBRARY_DEFINE-y+=$(LIBBB_DEFINE-y)
159LIBRARY_DEFINE-a+=$(LIBBB_DEFINE-y)
160
161$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_ALL_MOBJ)
162    $(do_ar)
Note: See TracBrowser for help on using the repository browser.