TOP_LEVEL       = @TOP_LEVEL@
TOP_LEVEL_FLAGS = @TOP_LEVEL_FLAGS@
GPLC            = @GPLC@
CFLAGS          = @CFLAGS@
HEXGPLC         = @HEXGPLC@
CC              = @CC@ @CFLAGS_MACHINE@
CFLAGS          = @CFLAGS@
LDLIBS          = @LDLIBS@

EXECS     = $(GPLC)@EXE_SUFFIX@ $(HEXGPLC)@EXE_SUFFIX@
ALL_EXECS = $(EXECS) $(TOP_LEVEL)@EXE_SUFFIX@


first: $(EXECS)

$(GPLC)@EXE_SUFFIX@: top_comp.c copying.c ../EnginePl/wam_regs.h \
         ../EnginePl/gp_config.h ../EnginePl/machine1.c decode_hexa.c copying.c prolog_path.c
	$(CC) $(CFLAGS) @CC_EXE_NAME_OPT@$(GPLC)@EXE_SUFFIX@ top_comp.c $(LDLIBS)

$(HEXGPLC)@EXE_SUFFIX@: hexfilter.c decode_hexa.c
	$(CC) $(CFLAGS) @CC_EXE_NAME_OPT@$(HEXGPLC)@EXE_SUFFIX@ hexfilter.c



all: $(ALL_EXECS)


top-level: $(TOP_LEVEL)@EXE_SUFFIX@

$(TOP_LEVEL)@EXE_SUFFIX@: ../EnginePl/gp_config.h copying.c top_level.c
	$(GPLC) $(TOP_LEVEL_FLAGS) -o $(TOP_LEVEL)@EXE_SUFFIX@ -C '$(CFLAGS)' top_level.c



clean:
	-mv $(TOP_LEVEL)@EXE_SUFFIX@ $(TOP_LEVEL)0@EXE_SUFFIX@
	rm -f *@OBJ_SUFFIX@ *.ilk *.pdb *.pch *.idb *.exp $(ALL_EXECS)

distclean:
	rm -f *@OBJ_SUFFIX@ $(ALL_EXECS) $(TOP_LEVEL)0@EXE_SUFFIX@


