# Makefile for busybox
#
# Copyright (C) 1999-2005 by Erik Andersen <andersen@codepoet.org>
#
# Licensed under the GPL v2, see the file LICENSE in this tarball.

obj-y:= \
	ask_confirmation.o change_identity.o chomp.o \
	compare_string_array.o concat_path_file.o copy_file.o copyfd.o \
	crc32.o create_icmp_socket.o create_icmp6_socket.o \
	device_open.o dump.o error_msg.o error_msg_and_die.o \
	find_pid_by_name.o find_root_device.o fgets_str.o full_read.o \
	full_write.o get_last_path_component.o get_line_from_file.o \
	herror_msg.o herror_msg_and_die.o \
	human_readable.o inet_common.o inode_hash.o isdirectory.o \
	kernel_version.o last_char_is.o login.o \
	make_directory.o md5.o mode_string.o mtab_file.o \
	obscure.o parse_mode.o parse_number.o perror_msg.o \
	perror_msg_and_die.o get_console.o \
	process_escape_sequence.o procps.o \
	recursive_action.o remove_file.o \
	restricted_shell.o run_parts.o run_shell.o safe_read.o safe_write.o \
	safe_strncpy.o setup_environment.o sha1.o simplify_path.o \
	trim.o u_signal_names.o vdprintf.o verror_msg.o \
	vherror_msg.o vperror_msg.o wfopen.o xconnect.o xgetcwd.o \
	xgethostbyname.o xgethostbyname2.o xreadlink.o xgetlarg.o \
	fclose_nonstdin.o fflush_stdout_and_exit.o \
	getopt32.o default_error_retval.o wfopen_input.o speed_table.o \
	perror_nomsg_and_die.o perror_nomsg.o skip_whitespace.o bb_askpass.o \
	warn_ignoring_args.o concat_subpath_file.o vfork_daemon_rexec.o \
	bb_do_delay.o uuencode.o info_msg.o vinfo_msg.o

# conditionally compiled objects:
obj-$(CONFIG_FEATURE_MOUNT_LOOP) += loop.o
obj-$(CONFIG_LOSETUP) += loop.o
obj-$(CONFIG_FEATURE_MTAB_SUPPORT) += mtab.o
obj-$(CONFIG_PASSWD) += pw_encrypt.o
obj-$(CONFIG_SULOGIN) += pw_encrypt.o
obj-$(CONFIG_FEATURE_HTTPD_AUTH_MD5) += pw_encrypt.o
obj-$(CONFIG_VLOCK) += correct_password.o
obj-$(CONFIG_SU) += correct_password.o
obj-$(CONFIG_LOGIN) += correct_password.o
obj-$(CONFIG_DF) += find_mount_point.o
obj-$(CONFIG_EJECT) += find_mount_point.o

# We shouldn't build xregcomp.c if we don't need it - this ensures we don't
# require regex.h to be in the include dir even if we don't need it thereby
# allowing us to build busybox even if uclibc regex support is disabled.

obj-$(CONFIG_AWK) += xregcomp.o
obj-$(CONFIG_SED) += xregcomp.o
obj-$(CONFIG_LESS) += xregcomp.o
obj-$(CONFIG_DEVFSD) += xregcomp.o

obj-y += messages.o
obj-y += xfuncs.o
obj-y += printf.o
obj-y += xgetularg.o
obj-y += safe_strtol.o
obj-y += bb_pwd.o
obj-y += llist.o

###needcrypt-y:=
###ifneq ($(filter $(srcdir)/pw_encrypt.o,$(obj-y)),)
###needcrypt-y:=y
###else
###ifneq ($(filter $(srcdir)/correct_password.o,$(obj-y)),)
###needcrypt-y:=y
###endif
###endif
###
###ifeq ($(needcrypt-y),y)
###  LIBRARIES := -lcrypt $(filter-out -lcrypt,$(LIBRARIES))
###endif

CFLAGS_bb_pwd.o = \
-DL_bb_getgrgid \
-DL_bb_getpwuid \
-DL_bb_getug \
-DL_bb_xgetgrnam \
-DL_bb_xgetpwnam \
-DL_get_ug_id \

CFLAGS_llist.o = \
-DL_llist_add_to \
-DL_llist_add_to_end \
-DL_llist_free \
-DL_llist_pop \

CFLAGS_messages.o = \
-DL_bb_common_bufsiz1 \
-DL_bb_dev_null \
-DL_bb_path_wtmp_file \
-DL_can_not_create_raw_socket \
-DL_full_version \
-DL_group_file \
-DL_gshadow_file \
-DL_invalid_date \
-DL_io_error \
-DL_memory_exhausted \
-DL_motd_file \
-DL_msg_invalid_arg \
-DL_msg_requires_arg \
-DL_msg_standard_input \
-DL_msg_standard_output \
-DL_name_longer_than_foo \
-DL_nologin_file \
-DL_passwd_file \
-DL_perm_denied_are_you_root \
-DL_read_error \
-DL_securetty_file \
-DL_shadow_file \
-DL_shell_file \
-DL_unknown \
-DL_write_error \

CFLAGS_printf.o = \
-DL_bb_fprintf \
-DL_bb_printf \
-DL_bb_vfprintf \
-DL_bb_vprintf \

CFLAGS_safe_strtol.o = \
-DL_safe_strtod \
-DL_safe_strtoi \
-DL_safe_strtol \
-DL_safe_strtoll \
-DL_safe_strtoul \
-DL_safe_strtoull \

CFLAGS_xfuncs.o = \
-DL_fdlength \
-DL_itoa \
-DL_setuid \
-DL_spawn \
-DL_wait4 \
-DL_warn_opendir \
-DL_xasprintf \
-DL_xbind \
-DL_xchdir \
-DL_xdaemon \
-DL_xferror \
-DL_xferror_stdout \
-DL_xfflush_stdout \
-DL_xfopen \
-DL_xlisten \
-DL_xlseek \
-DL_xmalloc \
-DL_xopen \
-DL_xopen3 \
-DL_xopendir \
-DL_xprint_and_close_file \
-DL_xread \
-DL_xread_char \
-DL_xrealloc \
-DL_xsocket \
-DL_xspawn \
-DL_xstrdup \
-DL_xstrndup \
-DL_xwrite \
-DL_xzalloc \
-DL_xstat \
-DL_get_terminal_width_height \
-DL_xsetenv \

CFLAGS_xgetularg.o = \
-DL_getlarg10_sfx \
-DL_xgetlarg_bnd_sfx \
-DL_xgetularg10 \
-DL_xgetularg10_bnd \
-DL_xgetularg_bnd \
-DL_xgetularg_bnd_sfx \
