SHELL		= /bin/sh
#
# STD* make up some of the functions from the ANSI-C standard and BSD libraries.
# If you've got them already, comment out the definitions
#
NEEDED		= strtod strtol strtoul strerror strsignal memmove \
		  random utimes setenv
STDOBJS		= $(NEEDEDOBJS) getopt.o
STDSRCS		= strtod.c strtol.c strtoul.c strerror.c strsignal.c \
		  memove.c random.o utimes.c getopt.c setenv.c
OBJS 		= buf.o hash.o list.o option.o sys.o \
		  emalloc.o enomem.o $(STDOBJS) 
SRCS 		= buf.c hash.c list.c option.c sys.c \
		  emalloc.c enomem.c $(STDSRCS)

MACHFLAGS	= 
INCLUDES	= -I../include
CFLAGS 		= $(MACHFLAGS) $(INCLUDES)

all:
	NEEDEDOBJS=`../../etc/needed.sh '$(CC)' $(NEEDED)`; \
	$(MAKE) "NEEDEDOBJS=`echo $$NEEDEDOBJS`" libsprite.a

libsprite.a	: $(OBJS)
	rm -f $@
	ar cr $@ $(OBJS)
	if [ -f /bin/ranlib -o -f /usr/bin/ranlib ]; \
		then ranlib $@; else true; fi

install		: libsprite.a

clean		::
	rm -f *.o *.po libsprite.a libsprite_p.a

package		: 
	-mkdir $(PKGDIR)
	cp $(SRCS) Makefile makefile $(PKGDIR)
