#
# $Id: Makefile.in,v 1.6 1999/12/11 02:35:46 assar Exp $
#

SHELL = /bin/sh

srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@
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)editline
#LIBEXT = @LIBEXT@
LIBEXT = a
#SHLIBEXT = @SHLIBEXT@
#LIBPREFIX = @LIBPREFIX@
LIBPREFIX = lib
#LDSHARED = @LDSHARED@
LIB = $(LIBNAME).$(LIBEXT)

SOURCES = edit_compat.c editline.c complete.c sysunix.c

OBJECTS = @editline_OBJS@

all: $(LIB)

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

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I../../include -I$(srcdir) -I$(srcdir)/../roken $(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) *.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
