## Copyright (C) 1997  Toyoda Masashi (toyoda@is.titech.ac.jp)

##
##  Set your AMULET_DIR environment variable to the top-level directory for
##  the Amulet hierarchy -- all other paths are computed from this.
##
##  Set your AMULET_VARS_FILE environment variable to the name of the file
##  that describes the compiler flags you want to use.  The value of this
##  variable is the name of a file in amulet/bin/, one of:
##    Makefile.vars.gcc.Sun   -  For gcc on a Sun
##    Makefile.vars.gcc.HP    -  For gcc on an HP
##    Makefile.vars.CC.Sun    -  For ObjectCenter's CC on a Sun
##    Makefile.vars.CC.HP     -  For ObjectCenter's CC on an HP
##

include $(AMULET_DIR)/bin/Makefile.vars

KLIEG_DEFS = -DKLIEG_BINDIR=\"$(KLIEG_BINDIR)\" -DTRACER=\"$(TRACER)\" -DKLIEG_LIBDIR=\"$(KLIEG_LIBDIR)\"

all: klieg

objects = Resources.o PovlWidgets.o Povl.o Module.o Guard.o Atom.o Message.o Port.o Binder.o  Process.o Rule.o ProcessMenu.o Pattern.o Translator.o RectangleWidgets.o ZoomWidgets.o Formulas.o PopUpMenu.o Arrow.o SaveLoad.o NewSaveLoad.o

%.o: %.cc
	$(CC) -c $(AM_CFLAGS) $(KLIEG_DEFS) $< -o $@

klieg: $(objects)
	$(CC) $(AM_CFLAGS) $(objects) -L$(LIB_DIR) -lamulet $(AM_LIBS) \
	-o klieg

install:
	@if [ ! -d $(KLIEG_BINDIR) ]; then mkdir $(KLIEG_BINDIR) ; fi
	install -c klieg $(KLIEG_BINDIR)
	@if [ ! -d $(KLIEG_LIBDIR) ]; then mkdir $(KLIEG_LIBDIR) ; fi
	install -c *.bmp $(KLIEG_LIBDIR)

clean:
	/bin/rm -f *.o core

distclean:
	/bin/rm -f klieg *.o *~ core

realclean:
	/bin/rm -f klieg *.o *~ core
