#
#  Makefile.sub.in - Common rules and definitions
#
#  $Id: Makefile.comm.in 1.2 1998/10/11 11:06:49 jjc Exp $
#
#  Copyright (C) 1998 Cees de Groot <cg@sgmltools.org>
#

TOP=@TOP@
prefix=@prefix@
exec_prefix=@exec_prefix@
srcdir=@srcdir@
bindir=@bindir@
libdir=@libdir@

CXX=@CXX@
CC=@CC@
M4=@M4@
PERL=@PERL@
LIBTOOL=@LIBTOOL@
INSTALL=@INSTALL@

LIBOBJS=@LIBOBJS@
LIBS=@LIBS@
DEFS=@DEFS@
INCS=-I$(srcdir) -I$(srcdir)/../include $(INCLUDE)
CXXFLAGS=@CXXFLAGS@ $(INCS) $(DEBUG) $(DEFS)
CFLAGS=@CFLAGS@ $(DEBUG) $(DEFS)
LDFLAGS=@LDFLAGS@
MSGGENFLAGS=
CXXDEPGENFLAGS=-MM

.SUFFIXES: .cxx .c .o .m4 .msg .lo

.cxx.o:
	$(CXX) $(CXXFLAGS) -c $<

.cxx.lo:
	@$(LIBTOOL) --mode=compile $(CXX) $(CXXFLAGS) -c $<

.c.o:
	$(CC) $(CFLAGS) -c $<

.c.lo:
	@$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $<

.m4.cxx:
	rm -f $@
	$(M4) $(srcdir)/../lib/instmac.m4 $< >$@
	chmod -w $@

.msg.h:
	$(PERL) -w $(srcdir)/../msggen.pl $(MSGGENFLAGS) $<

depend_src: depend.temp
	mv depend.temp Makefile.dep

depend.temp: FORCE
	$(CXX) -MM $(CXXFLAGS) $(CXXDEPGENFLAGS) $(OBJS:.o=.cxx) \
	  | sed -e 's; \([^/ ][^/ ]*\)/; $$(srcdir)/\1/;g' >depend.temp

clean: FORCE
	-rm -f $(CLEANFILES)

FORCE:

%: RCS/%,v
	test -w $@ || co -u $@
