srcdir = @srcdir@
topdir = @topdir@
VPATH = $(srcdir)

include ../Makefile.inc
topdir=..
topincdir=../../include

CC = @CC@
CXX = @CXX@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@

DO_DEBUG = @DO_DEBUG@
LIBTAR = uinfile.a

LOPT=-DSWBISBINDIR=\"${prefix}/bin\"

ifeq ($(DO_DEBUG),)
.c.o:
	$(CC) $(CFLAGS) $(LOPT) -c -o $*.o  $<
DEBUGLIBOBJECTS =
else
.c.o:
	$(CC) $(CFLAGS) $(LOPT) -c -o $*.o  $<; $(CC) $(CFLAGS) $(LOPT) -S -gstabs+ -o $*.S $<
DEBUGLIBOBJECTS = uinfile_debug.o
endif

LIBOBJECTS = $(DEBUGLIBOBJECTS) uinfile.o 

ifeq (.depend,$(wildcard .depend))
TARGET=everything
else
TARGET=depend everything
endif

all: $(TARGET)

everything: $(LIBTAR)

$(LIBTAR): $(LIBOBJECTS) 
	$(AR) r $@ $(LIBOBJECTS)
	$(RANLIB) $@

$(PROGS): $(LIBOBJECTS)

distdir:
install-data:
install-exec:
install-html:
install-dvi:
install-pdf:
install-ps:
install-strip:
install-info:
installdirs:
installcheck:
install:
uninstall:
info:
dvi:
html:
pdf:
ps:
dist:
check:
tags:
ctags:
maintainer-clean: distclean
mostlyclean: clean

clean:
	rm -f *.S *.a *.o *~ $(PROGS)

distclean: clean
	rm -f .depend Makefile

depend:
	( > .depend )

#	($(CPP) $(CFLAGS) -M $(srcdir)/*.c > .depend; exit 0)

ifeq (.depend,$(wildcard .depend))
include .depend
endif
