#
# $Id: Makefile.in,v 1.2 1999/05/17 14:52:10 lha Exp $
#

SHELL	= /bin/sh

srcdir	= @srcdir@
VPATH	= @srcdir@

CC	= @CC@
AR	= ar
RANLIB	= @RANLIB@
INCLUDES = -I.					\
	   -I../../../include			\
	   -I$(srcdir)				\
	   $(KRB_INC_FLAGS)			\
	   -I$(srcdir)/../../../include

CFLAGS	= @CFLAGS@
KRB_INC_FLAGS= @KRB_INC_FLAGS@

INSTALL = @INSTALL@
INSTALL_DATA	= @INSTALL_DATA@
MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
YDR		= ../../../ydr/ydr

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


#PICFLAGS = @PICFLAGS@
 
LIBNAME = $(LIBPREFIX)vstatus
#LIBEXT = @LIBEXT@
LIBEXT = a
#SHLIBEXT = @SHLIBEXT@
#LIBPREFIX = @LIBPREFIX@
LIBPREFIX = lib
#LDSHARED = @LDSHARED@
LIB = $(LIBNAME).$(LIBEXT)

DEFS	= @DEFS@

LIB_SOURCES = vstatus.c vstat.ydr.o

SOURCES = $(LIB_SOURCES)

LIB_OBJECTS = vstatus.o vstat.ydr.o

OBJECTS = $(LIB_OBJECTS) 

all: $(LIB)

vstat.ydr.c vstat.cs.c vstat.ss.c vstat.h vstat.ss.h vstat.cs.h: vstat.xg
	$(YDR) $(srcdir)/vstat.xg

vstatus.c: vstatus.h vstat.xg
vstatus.h: vstat.h

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

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<

install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)

uninstall:
	rm -f $(DESTDIR)$(libdir)/$(LIB)

TAGS: $(SOURCES)
	etags $(SOURCES)

check:

clean:
	rm -f $(LIB) $(PROGS) *.o *.a vstat.h vstat.ydr.c vstat.ss.h vstat.ss.c vstat.cs.h vstat.cs.c

mostlyclean: clean

distclean: clean
	rm -f Makefile *~

realclean: distclean
	rm -f TAGS

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

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

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

Makefile:	Makefile.in ../../../config.status
	cd ../../..; CONFIG_FILES=milko/lib/vstatus/Makefile CONFIG_HEADERS= $(SHELL) config.status

.PHONY: all install uninstall check clean mostlyclean distclean realclean
