fpc/tests/Makefile.fpc
2000-11-29 23:14:10 +00:00

104 lines
2.2 KiB
Makefile

#
# Makefile.fpc for Free Pascal Tests directory
#
[defaults]
defaultrule=alltests
[rules]
.PHONY: all units tests cont_tests
# Unix like OS ?
ifeq ($(OS_TARGET),linux)
INUNIX=1
endif
ifeq ($(OS_TARGET),freebsd)
INUNIX=1
endif
# For linux by default no graph tests
ifdef INUNIX
NOGRAPH=1
endif
#
# Tools
#
ifndef LONGLOG
export LONGLOG:=longlog
endif
ifndef LOG
export LOG:=log
endif
units : units/$(FPCMADE)
units/$(FPCMADE):
$(MAKE) -C units
DOTEST=dotest$(EXEEXT)
$(DOTEST) : utils/dotest.pp utils/redir.pp
$(FPC) -Fu../units -FE. utils/dotest
testcheck: units $(DOTEST)
#
# Test run targets
#
DIRS=webtbs webtbf tbs tbf test testopt
all : alltests
tests : clean all_compilations
cont_tests : all_compilations
%.log : %.pp
$(DOTEST) $<
%.elg : %.pp
$(DOTEST) -e $<
alltbs : testcheck $(patsubst %.pp,%.log,$(wildcard tbs/*.pp))
alltbf : testcheck $(patsubst %.pp,%.log,$(wildcard tbf/*.pp))
allwebtbs : testcheck $(patsubst %.pp,%.log,$(wildcard webtbs/*.pp))
allwebtbf : testcheck $(patsubst %.pp,%.log,$(wildcard webtbs/*.pp))
alltest : testcheck $(patsubst %.pp,%.log,$(wildcard test/*.pp))
alltestopt : testcheck $(patsubst %.pp,%.log,$(wildcard testopt/*.pp))
alltests: alltest alltbs alltbf allwebtbs allwebtbf
clean:
-rm -f $(addsuffix /*$(PPUEXT),$(DIRS))
-rm -f $(addsuffix /*$(OEXT),$(DIRS))
-rm -f $(addsuffix /*.rst,$(DIRS))
-rm -f $(addsuffix /*$(SHAREDLIBEXT),$(DIRS))
-rm -f $(addsuffix /*.log,$(DIRS))
-rm -f $(addsuffix /*.elg,$(DIRS))
ifdef INUNIX
-rm -f $(wildcard $(patsubst %.pp,%$(EXEEXT),$(wildcard $(addsuffix /t*.pp,$(DIRS)))))
else
-rm -f $(addsuffix /*$(EXEEXT),$(DIRS))
endif
-rm -f *.tmp
-rm -f $(LOG) $(LONGLOG) fail
-rm -f ppas.sh ppas.bat
full : clean all_compilations allexec
info :
@echo This Makefile allows to test the compiler
@echo compilation of 'ts*.pp' should succeed
@echo compilation of 'tf*.pp' should fail
@echo compilation of 'test*.pp' should succeed
@echo 'to*.pp' files should also compile
@echo simply run \'make tests\' to test all compilation
@echo run \'make allexec\' to test also if the executables
@echo created behave like the should
@echo run \'make tesiexec\' to test executables
@echo that require interactive mode