# ----------------------------------------------------------------------------
# - Makefile                                                                 -
# - acme engine test makefile                                                -
# ----------------------------------------------------------------------------
# - This program is  free software;  you can  redistribute it and/or  modify -
# - it provided that this copyright notice is kept intact.                   -
# -                                                                          -
# - This  program  is  distributed in the hope  that it  will be useful, but -
# - without  any   warranty;  without  even   the   implied    warranty   of -
# - merchantability  or fitness for a particular purpose. In not event shall -
# - the copyright holder be  liable for  any direct, indirect, incidental or -
# - special damages arising in any way out of the use of this software.      -
# ----------------------------------------------------------------------------
# - copyright (c) 1999-2000 amaury darsch                                    -
# ----------------------------------------------------------------------------

TOPDIR		= ../..
CNFDIR		= $(TOPDIR)/cnf
SITEFILE	= $(CNFDIR)/site.mak
RULEFILE	= $(CNFDIR)/rule.mak
include		  $(SITEFILE)

# ----------------------------------------------------------------------------
# source file generation                                                     -
# ----------------------------------------------------------------------------

INCLUDE		= -I. -I$(AENGINC) -I$(ASTDINC)

CPPSRCS		= t_token.cpp     \
		  t_symbol.cpp    \
		  t_lexical.cpp   \
		  t_localset.cpp  \
		  t_globalset.cpp \
		  t_qualified.cpp

TESTERS		= $(basename $(CPPSRCS))

# ----------------------------------------------------------------------------
# - project rules                                                            -
# ----------------------------------------------------------------------------

# rule: all
# this rule is the default rule which call the test rule

all: test
.PHONY: all

# include: rule.mak
# this rule includes the platform dependant rules

include $(RULEFILE)

# rule: testers
# build the test files

testers: $(TESTERS)
.PHONY: testers

$(TESTERS) : $(OBJECTS)
	$(LD) $(PPFLAGS) -o $@ $@.o $(LIBAENG) $(STDLIBS)

# rule: test
# build and run the test program

test: $(TESTERS)
	@(for t in $(TESTERS); do ($(BTEST) $(LIBREL) $$t); done)
.PHONY: test

# rule: clean
# clean only the test file and depends file

clean::
	@$(RM) $(TESTERS)
.PHONY: clean
