# $Id: Makefile.in,v 1.46 2000/03/27 21:46:29 map Exp $

srcdir		= @srcdir@
VPATH		= @srcdir@

SHELL		= /bin/sh

CC		= @CC@
DEFS		= @DEFS@ -DHOST=\"@CANONICAL_HOST@\"
CFLAGS		= @CFLAGS@ $(DEFS) -I. -I$(srcdir)

LN_S		= @LN_S@
RM_F		= rm -f
MKDIR		= mkdir

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

prefix 		= @prefix@
exec_prefix	= @exec_prefix@
includedir	= @includedir@

LOCL_HEADERS	= roken.h ko.h sl.h part.h list.h  \
		  bool.h log.h \
		  hash.h \
		  lwp.h lock.h getarg.h err.h parse_units.h \
		  resolve.h rxkad.h service.h mmaptime.h ports.h \
		  heap.h fbuf.h fdir.h afs_dir.h parse_time.h parse_bytes.h \
		  acl.h

BUILDHEADERS	= atypes.h fs_errors.h 

HEADERS		= $(BUILDHEADERS)

BITS_OBJECTS	= bits.o

SOURCES		= bits.c

all:	$(LOCL_HEADERS) $(HEADERS)

install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
	for x in $(HEADERS); \
	  do \
	  b=`basename $$x`; \
	  if test -f $$b; then \
	    $(INSTALL_DATA) $$b $(DESTDIR)$(includedir)/$$b; \
	  else \
	    $(INSTALL_DATA) $(srcdir)/$$b $(DESTDIR)$(includedir)/$$b; \
	  fi; \
	done

uninstall:
	for x in $(HEADERS); do \
		$(RM_F) $(DESTDIR)$(includedir)/$$x; \
	done

bits:	$(BITS_OBJECTS)
	$(CC) -o $@ $(BITS_OBJECTS)

bits.o: bits.c

atypes.h: bits
	./bits $@

clean:
	rm -f bits *.o $(BUILDHEADERS) $(LOCL_HEADERS)

distclean: clean
	rm -f Makefile

Makefile: Makefile.in ../config.status
	cd ..; CONFIG_FILES=include/Makefile CONFIG_HEADERS= ./config.status

roken.h:
	$(LN_S) $(srcdir)/../lib/roken/roken.h .
sl.h:
	$(LN_S) $(srcdir)/../lib/sl/sl.h .
ko.h:
	$(LN_S) $(srcdir)/../lib/ko/ko.h .
part.h:
	$(LN_S) $(srcdir)/../lib/ko/part.h .
ports.h:
	$(LN_S) $(srcdir)/../lib/ko/ports.h .
atom.h:
	$(LN_S) $(srcdir)/../util/atom.h .
list.h:
	$(LN_S) $(srcdir)/../util/list.h .
bool.h:
	$(LN_S) $(srcdir)/../util/bool.h .
log.h:
	$(LN_S) $(srcdir)/../util/log.h .
hash.h:
	$(LN_S) $(srcdir)/../util/hash.h .
mmaptime.h:
	$(LN_S) $(srcdir)/../util/mmaptime.h .
lock.h:
	$(LN_S) $(srcdir)/../lwp/lock.h .
lwp.h:
	$(LN_S) $(srcdir)/../lwp/@LWP_H@ ./lwp.h
getarg.h:
	$(LN_S) $(srcdir)/../lib/roken/getarg.h .
parse_units.h:
	$(LN_S) $(srcdir)/../lib/roken/parse_units.h .
err.h:
	$(LN_S) $(srcdir)/../lib/roken/err.h .
resolve.h:
	$(LN_S) $(srcdir)/../lib/roken/resolve.h .
parse_time.h:
	$(LN_S) $(srcdir)/../lib/roken/parse_time.h .
parse_bytes.h:
	$(LN_S) $(srcdir)/../lib/roken/parse_bytes.h .
rxkad.h:
	$(LN_S) $(srcdir)/../rxkad/rxkad.h .
service.h:
	$(LN_S) $(srcdir)/../arlad/service.h .
heap.h:
	$(LN_S) $(srcdir)/../util/heap.h .
fs_errors.h:
	$(LN_S) $(srcdir)/../arlad/fs_errors.h .
fbuf.h:
	$(LN_S) $(srcdir)/../lib/bufdir/fbuf.h .
fdir.h:
	$(LN_S) $(srcdir)/../lib/bufdir/fdir.h .
afs_dir.h:
	$(LN_S) $(srcdir)/../lib/bufdir/afs_dir.h .
acl.h:
	$(LN_S) $(srcdir)/../lib/acl/acl.h .

.PHONY: all install uninstall clean distclean
