SHELL = /bin/sh

###
include $(BUILDHOME)/buildprefs/make.pre
###

TARGET		= $(OBJ_DIR)/libsu.a

# On ppc, libroot doesn't have re_search, for example.
# Use our package local version of regexp for now.
# FIXME: Why is this?
ifeq ($(CPU), ppc)
REGEX = regex.c
GETLINE = getline.c
STRTOUMAX = strtoumax.c
endif

SRCS	=	argmatch.c \
			basename.c \
			canon-host.c \
			chown.c \
			closeout.c \
			error.c \
			full-write.c \
			getdate.c \
			$(GETLINE) \
			getloadavg.c \
			getugroups.c \
			getusershell.c \
			group-member.c \
			human.c \
			lchown.c \
			long-options.c \
			mktime.c \
			posixtm.c \
			putenv.c \
			quotearg.c \
			readtokens.c \
			$(REGEX) \
			strftime.c \
			stripslash.c \
			strtoumax.c \
			version-etc.c \
			xgetcwd.c \
			xgethostname.c \
			xmalloc.c \
			xstrdup.c \
			xstrtod.c \
			xstrtol.c \
			xstrtoul.c \
			xstrtoumax.o

OBJS		= $(SRCS_LIST_TO_OBJS)

CFLAGS		+= -DHAVE_CONFIG_H

INCLUDES 	+= -I. -I.. -I../intl

MY_INSTALL_DIR	= $(BELIBRARIES)

$(TARGET):	$(OBJ_DIR) $(OBJS)
	$(AR) $(ARFLAGS) $@ $(OBJS)

clean::
			rm -f getdate.c

###
include $(BUILDHOME)/buildprefs/make.post
###
