#
# $Id: Makefile.in,v 1.1 1998/01/13 16:25:15 lha Exp $
#

SHELL = /bin/sh

srcdir = @srcdir@
VPATH = @srcdir@

CC	= @CC@
CPP	= @CPP@
AR	= ar
RANLIB	= @RANLIB@
DEFS	= @DEFS@
CFLAGS	= @CFLAGS@

INSTALL = @INSTALL@
INSTALL_DATA	= @INSTALL_DATA@
MKINSTALLDIRS = @top_srcdir@/mkinstalldirs

prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@

#PICFLAGS = # @PICFLAGS@
 
LIBNAME = $(LIBPREFIX)roken
#LIBEXT = @LIBEXT@ Always build archive library and don't install!
LIBEXT = a
#LIBPREFIX = @LIBPREFIX@
LIBPREFIX = lib
#SHLIBEXT = @SHLIBEXT@
#LDSHARED = @LDSHARED@
LIB = $(LIBNAME).$(LIBEXT)

SOURCES = \
	base64.c chown.c daemon.c err.c errx.c fchown.c flock.c \
	get_window_size.c \
	getcwd.c getdtablesize.c getarg.c getopt.c getusershell.c \
	hstrerror.c inaddr2str.c inet_aton.c \
	initgroups.c k_getpwnam.c k_getpwuid.c lstat.c \
	memmove.c mini_inetd.c mkstemp.c putenv.c rcmd.c readv.c setegid.c \
	setenv.c seteuid.c signal.c snprintf.c \
	strcasecmp.c strdup.c strerror.c strftime.c \
	strlwr.c strnlen.c strsep.c strtok_r.c strupr.c tm2time.c \
	unsetenv.c verify.c verr.c verrx.c vsyslog.c vwarn.c \
	vwarnx.c warn.c warnerr.c warnx.c

OBJECTS = base64.o getarg.o k_getpwuid.o k_getpwnam.o signal.o tm2time.o \
	  verify.o inaddr2str.o mini_inetd.o get_window_size.o \
	  warnerr.o snprintf.o @LIBOBJS@

all: $(LIB)

Wall:
	make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

install: all

uninstall:

TAGS: $(SOURCES)
	etags $(SOURCES)

check:

clean:
	rm -f $(LIB) *.o *.a

mostlyclean: clean

distclean: clean
	rm -f Makefile *.tab.c *~

realclean: distclean
	rm -f TAGS

dist: $(DISTFILES)
	for file in $(DISTFILES); do \
	  ln $$file ../`cat ../.fname`/lib \
	    || cp -p $$file ../`cat ../.fname`/lib; \
	done

$(LIBNAME).a: $(OBJECTS)
	rm -f $@
	$(AR) cr $@ $(OBJECTS)
	-$(RANLIB) $@

#$(LIBNAME).$(SHLIBEXT): $(OBJECTS)
#	rm -f $@
#	$(LDSHARED) -o $@ $(OBJECTS)

$(OBJECTS): ../../include/config.h
