| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562 |
- #
- # Makefile generated by fpcmake v0.99.13 on 1999-12-21 00:34
- #
- defaultrule: info
- #####################################################################
- # Autodetect OS (Linux or Dos or Windows NT)
- # define inlinux when running under linux
- # define inWinNT when running under WinNT
- #####################################################################
- # We need only / in the path
- override PATH:=$(subst \,/,$(PATH))
- # Search for PWD and determine also if we are under linux
- PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(subst ;, ,$(PATH)))))
- ifeq ($(PWD),)
- PWD:=$(strip $(wildcard $(addsuffix /pwd,$(subst :, ,$(PATH)))))
- ifeq ($(PWD),)
- nopwd:
- @echo You need the GNU utils package to use this Makefile!
- @echo Get ftp://ftp.freepascal.org/pub/fpc/dist/go32v2/utilgo32.zip
- @exit
- else
- inlinux=1
- endif
- else
- PWD:=$(firstword $(PWD))
- endif
- # Detect NT - NT sets OS to Windows_NT
- ifndef inlinux
- ifeq ($(OS),Windows_NT)
- inWinNT=1
- endif
- endif
- # Detect OS/2 - OS/2 has OS2_SHELL defined
- ifndef inlinux
- ifndef inWinNT
- ifdef OS2_SHELL
- inOS2=1
- endif
- endif
- endif
- # The extension of executables
- ifdef inlinux
- EXEEXT=
- else
- EXEEXT=.exe
- endif
- # The path which is search separated by spaces
- ifdef inlinux
- SEARCHPATH=$(subst :, ,$(PATH))
- else
- SEARCHPATH=$(subst ;, ,$(PATH))
- endif
- #####################################################################
- # FPC version/target Detection
- #####################################################################
- # What compiler to use ?
- ifndef FPC
- # Compatibility with old makefiles
- ifdef PP
- export FPC=$(PP)
- else
- ifdef inOS2
- export FPC=ppos2$(EXEEXT)
- else
- export FPC=ppc386$(EXEEXT)
- endif
- endif
- endif
- # Target OS
- ifndef OS_TARGET
- export OS_TARGET:=$(shell $(FPC) -iTO)
- endif
- # Source OS
- ifndef OS_SOURCE
- export OS_SOURCE:=$(shell $(FPC) -iSO)
- endif
- # Target CPU
- ifndef CPU_TARGET
- export CPU_TARGET:=$(shell $(FPC) -iTP)
- endif
- # Source CPU
- ifndef CPU_SOURCE
- export CPU_SOURCE:=$(shell $(FPC) -iSP)
- endif
- # FPC version
- ifndef FPC_VERSION
- export FPC_VERSION:=$(shell $(FPC) -iV)
- endif
- #####################################################################
- # Default Settings
- #####################################################################
- # Release ? Then force OPT and don't use extra opts via commandline
- ifndef REDIRFILE
- REDIRFILE=log
- endif
- ifdef RELEASE
- override OPT:=-Xs -OG2p3 -n
- endif
- # Verbose settings (warning,note,info)
- ifdef VERBOSE
- override OPT+=-vwni
- endif
- ifdef REDIR
- ifndef inlinux
- override FPC=redir -eo $(FPC)
- endif
- # set the verbosity to max
- override OPT+=-va
- override REDIR:= >> $(REDIRFILE)
- endif
- #####################################################################
- # User Settings
- #####################################################################
- # Targets
- # Clean
- # Install
- ZIPTARGET=install
- # Defaults
- # Directories
- ifndef PACKAGEDIR
- PACKAGEDIR=$(FPCDIR)/packages
- endif
- ifndef COMPONENTDIR
- COMPONENTDIR=$(FPCDIR)/components
- endif
- # Packages
- # Libraries
- #####################################################################
- # Default extensions
- #####################################################################
- # Default needed extensions (Go32v2,Linux)
- LOADEREXT=.as
- PPLEXT=.ppl
- PPUEXT=.ppu
- OEXT=.o
- ASMEXT=.s
- SMARTEXT=.sl
- STATICLIBEXT=.a
- SHAREDLIBEXT=.so
- PACKAGESUFFIX=
- FPCMADE=fpcmade
- # Go32v1
- ifeq ($(OS_TARGET),go32v1)
- PPUEXT=.pp1
- OEXT=.o1
- ASMEXT=.s1
- SMARTEXT=.sl1
- STATICLIBEXT=.a1
- SHAREDLIBEXT=.so1
- PACKAGESUFFIX=v1
- FPCMADE=fpcmade.v1
- endif
- # Go32v2
- ifeq ($(OS_TARGET),go32v2)
- PACKAGESUFFIX=go32
- FPCMADE=fpcmade.dos
- endif
- # Linux
- ifeq ($(OS_TARGET),linux)
- PACKAGESUFFIX=linux
- FPCMADE=fpcmade.lnx
- endif
- # Win32
- ifeq ($(OS_TARGET),win32)
- PPUEXT=.ppw
- OEXT=.ow
- ASMEXT=.sw
- SMARTEXT=.slw
- STATICLIBEXT=.aw
- SHAREDLIBEXT=.dll
- PACKAGESUFFIX=win32
- FPCMADE=fpcmade.w32
- endif
- # OS/2
- ifeq ($(OS_TARGET),os2)
- PPUEXT=.ppo
- ASMEXT=.so2
- OEXT=.oo2
- SMARTEXT=.so
- STATICLIBEXT=.ao2
- SHAREDLIBEXT=.dll
- PACKAGESUFFIX=os2
- FPCMADE=fpcmade.os2
- endif
- # library prefix
- LIBPREFIX=lib
- ifeq ($(OS_TARGET),go32v2)
- LIBPREFIX=
- endif
- ifeq ($(OS_TARGET),go32v1)
- LIBPREFIX=
- endif
- # determine which .pas extension is used
- ifndef PASEXT
- ifdef EXEOBJECTS
- override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(EXEOBJECTS)))))
- else
- override TESTPAS:=$(strip $(wildcard $(addsuffix .pas,$(firstword $(UNITOBJECTS)))))
- endif
- ifeq ($(TESTPAS),)
- PASEXT=.pp
- else
- PASEXT=.pas
- endif
- endif
- #####################################################################
- # Standard rules
- #####################################################################
- #####################################################################
- # Package depends
- #####################################################################
- ifneq ($(wildcard $(RTLDIR)),)
- ifeq ($(wildcard $(RTLDIR)/$(FPCMADE)),)
- override COMPILEPACKAGES+=rtl
- rtl_package:
- $(MAKE) -C $(RTLDIR) all
- endif
- endif
- .PHONY: rtl_package
- #####################################################################
- # Users rules
- #####################################################################
- DIRS=tf ts tbs tbf test tesi to webtbs webtbf
- all : info
- tests : clean all_compilations
- cont_tests : all_compilations
- getret$(EXEEXT) : getret.pp
- $(FPC) getret
- getreturncode : getret$(EXEEXT)
- ifndef inlinux
- redir -ea $(FILE).log -oa $(FILE).log getret $(COMMAND)
- cp retcode $(FILE).$(RESEXT)
- else
- getret $(COMMAND) > $(FILE).log 2>$(FILE).log
- cp retcode $(FILE).$(RESEXT)
- # @echo "Return code of $(FILE) is $(cat retcode)"
- endif
- # retcode should be between 0 and 255
- # 256 is for halt
- # 512+doserror if doserror<>0
- # 1024 RESFILE does not exist
- # 2048 RESFILE is not set
- ifndef RESFILE
- RETVAL=2048
- else
- ifeq ($(wildcard $(RESFILE)*),$(RESFILE))
- RETVAL=$(shell cat $(RESFILE))
- else
- RETVAL=1024
- endif
- endif
- ifeq ($(RETVAL),0)
- testsuccess:
- @echo "Test for $(FILE) success (compiles)"
- @echo "Test for $(FILE) success (compiles)" >>$(LOG)
- else
- testsuccess:
- @echo "Test for $(FILE) fails (does not compile) error $(RETVAL)"
- @echo "Test for $(FILE) fails (does not compile) error $(RETVAL)" >>$(LOG)
- ifdef LONGLOG
- @echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" >> $(LONGLOG)
- @echo "Test for $(FILE) fails (does not compile) error $(RETVAL)" >> $(LONGLOG)
- @echo "" >> $(LONGLOG)
- cat $(FILE).log >> $(LONGLOG)
- @echo "" >> $(LONGLOG)
- endif
- @echo $(FILE) >> ts_fail
- @echo $(FILE) >> faillist
- endif
- ifdef EXCFILE
- ifeq ($(wildcard $(EXCFILE)*),$(EXCFILE))
- EXERETVAL:=$(shell cat $(EXCFILE))
- else
- EXERETVAL=$(EXCFILE) does not exist
- endif
- else
- EXERETVAL=No EXCFILE variable defined
- endif
- ifeq ($(EXERETVAL),0)
- testexecsuccess:
- @echo "Test for exec $(FILE) success (runs without error)"
- @echo "Test for $(FILE) success (runs without error)" >> $(LOG)
- else
- testexecsuccess:
- @echo "Test for exec $(FILE) fails exec error $(EXERETVAL)"
- @echo "Test for exec $(FILE) fails exec error $(EXERETVAL)" >> $(LOG)
- ifdef LONGLOG
- @echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" >> $(LONGLOG)
- @echo "Test for exec $(FILE) fails exec error $(EXERETVAL)" >> $(LONGLOG)
- @echo "" >> $(LONGLOG)
- cat $(FILE).elg >> $(LONGLOG)
- @echo $(FILE) >> ex_fail
- endif
- endif
- ifeq ($(wildcard $(FILE)$(EXEEXT)),$(FILE)$(EXEEXT))
- testexec:
- @echo "Testing $(FILE)$(EXEEXT)"
- ifdef NOREDIR
- getret $(FILE)$(EXEEXT)
- else
- ifndef inlinux
- redir -e $(FILE).elg -o $(FILE).elg getret $(FILE)$(EXEEXT)
- else
- getret $(FILE)$(EXEEXT) > $(FILE).elg 2>$(FILE).elg
- endif
- endif
- cp -f retcode $(FILE).exc
- $(MAKE) testexecsuccess 'FILE=$(FILE)' 'EXCFILE=$(FILE).exc'
- else
- testexec:
- ifeq ($(wildcard $(FILE)$(PPUEXT)),$(FILE)$(PPUEXT))
- @echo "file is a unit $(FILE)$(PPUEXT)"
- else
- @echo "No exefile $(FILE)$(EXEEXT)"
- @echo $(FILE) >> faillist
- ifdef LONGLOG
- @echo "No exefile $(FILE)$(EXEEXT) was generated" >> $(LONGLOG)
- endif
- endif
- endif
- test_exc :
- @echo $(wildcard $(FILE).exc*)
- @echo xx$(wildcard $(EXCFILE)*)xx xx$(EXCFILE)xx
- cat $(FILE).exc
- ifneq ($(RETVAL),0)
- testfail:
- @echo "Test for $(FILE) success (does not compile) error $(RETVAL)"
- @echo "Test for $(FILE) success (does not compile) error $(RETVAL)" >> $(LOG)
- else
- testfail:
- @echo "Test for $(FILE) fails (does compile and should not)"
- @echo "Test for $(FILE) fails (does compile and should not)" >> $(LOG)
- ifdef LONGLOG
- @echo "Test for $(FILE) fails (does compile and should not)" >> $(LONGLOG)
- endif
- @echo $(FILE) >> tf_fail
- @echo $(FILE) >> faillist
- endif
- ifndef LONGLOG
- export LONGLOG:=longlog
- endif
- ifndef LOG
- export LOG:=log
- endif
- ifdef FILE
- OPTFILE=$(wildcard $(FILE).opt)
- endif
- ifdef OPTFILE
- override OPT+=$(OPTFILE)
- endif
- ifndef FILE
- FILE=ts/ts00001.pp
- endif
- testone :
- $(MAKE) getreturncode 'COMMAND=$(FPC) $(OPT) $(FILE).pp' 'RESEXT=$(RESEXT)' 'FILE=$(FILE)'
- %.res : %.pp
- $(MAKE) testone 'FILE=$*' 'RESEXT=res'
- $(MAKE) testsuccess 'FILE=$*' 'RESFILE=$*.res'
- %.ref : %.pp
- $(MAKE) testone 'FILE=$*' 'RESEXT=ref'
- $(MAKE) testfail 'FILE=$*' 'RESFILE=$*.ref'
- # exec log files
- # creates two files
- # *.elg log file
- # *.exc exicode of program
- %.elg : %.res
- $(MAKE) testexec 'FILE=$*'
- %.eli : %.res
- $(MAKE) testexec 'FILE=$*' 'NOREDIR=YES'
- allts : $(patsubst %.pp,%.res,$(wildcard ts/ts*.pp))
- alltbs : $(patsubst %.pp,%.res,$(wildcard tbs/tbs*.pp))
- allwebtbs : $(patsubst %.pp,%.res,$(wildcard webtbs/tbug*.pp))
- tbs0to99 : $(patsubst %.pp,%.res,$(wildcard tbs/tbs00*.pp))
- tbs100to199 : $(patsubst %.pp,%.res,$(wildcard tbs/tbs01*.pp))
- tbs200to299 : $(patsubst %.pp,%.res,$(wildcard tbs/tbs02*.pp))
- tbs300to399 : $(patsubst %.pp,%.res,$(wildcard tbs/tbs03*.pp))
- alltest : $(patsubst %.pp,%.res,$(wildcard test/test*.pp))
- alltesi : $(patsubst %.pp,%.res,$(wildcard tesi/tesi*.pp))
- alltis : $(patsubst %.pp,%.res,$(wildcard tis/tis*.pp))
- alltf : $(patsubst %.pp,%.ref,$(wildcard tf/tf*.pp))
- alltbf : $(patsubst %.pp,%.ref,$(wildcard tbf/tbf*.pp))
- allwebtbf : $(patsubst %.pp,%.ref,$(wildcard webtbf/tbug*.pp))
- allto : $(patsubst %.pp,%.res,$(wildcard to/to*.pp))
- ifndef TS_FAIL_LIST
- ifeq ($(wildcard ts_fail*),ts_fail)
- TS_FAIL_LIST=$(shell cat ts_fail)
- export TS_FAIL_LIST
- endif
- endif
- ifndef TF_FAIL_LIST
- ifeq ($(wildcard tf_fail*),tf_fail)
- TF_FAIL_LIST=$(shell cat tf_fail)
- export TF_FAIL_LIST
- endif
- endif
- ifndef EXEC_FAIL_LIST
- ifeq ($(wildcard ex_fail*),ex_fail)
- EXEC_FAIL_LIST=$(shell cat ex_fail)
- export EXEC_FAIL_LIST
- endif
- endif
- clean_fail :
- -rm -f $(addsuffix .res,$(TS_FAIL_LIST))
- -rm -f $(addsuffix .ref,$(TF_FAIL_LIST))
- -rm -f $(addsuffix .res,$(EXEC_FAIL_LIST))
- -rm -f $(addsuffix .elg,$(EXEC_FAIL_LIST))
- # Test all failure of last time
- # don't forget to try to run them again
- again :
- $(MAKE) internal_again LOG=again.log LONGLOG=again.llg
- internal_again : clean_fail $(addsuffix .res,$(TS_FAIL_LIST)) \
- $(addsuffix .ref,$(TF_FAIL_LIST)) \
- $(addsuffix .elg,$(EXEC_FAIL_LIST) $(TS_FAIL_LIST))
- grep fails $(LOG)
- all_compilations : allts alltbs allwebtbs alltf alltbf allwebtbf allto alltest alltesi alltis
- grep fails $(LOG)
- allexec : alltsexec alltbsexec allwebtbsexec alltestexec
- grep fails $(LOG)
- alltestexec: $(patsubst %.pp,%.elg,$(wildcard test/test*.pp))
- allfails :
- grep fails $(LOG) > fails.log
- # these test are interactive
- # no redirection !!!
- alltesiexec: $(patsubst %.pp,%.eli,$(wildcard tesi/tesi*.pp))
- alltsexec: $(patsubst %.pp,%.elg,$(wildcard ts/ts*.pp))
- alltbsexec: $(patsubst %.pp,%.elg,$(wildcard tbs/tbs*.pp))
- allwebtbsexec: $(patsubst %.pp,%.elg,$(wildcard webtbs/tbug*.pp))
- tbsexec0to99 : $(patsubst %.pp,%.elg,$(wildcard tbs/tbs00*.pp))
- tbsexec100to199 : $(patsubst %.pp,%.elg,$(wildcard tbs/tbs01*.pp))
- tbsexec200to299 : $(patsubst %.pp,%.elg,$(wildcard tbs/tbs02*.pp))
- tbsexec300to399 : $(patsubst %.pp,%.elg,$(wildcard tbs/tbs03*.pp))
- alltisexec: $(patsubst %.pp,%.eli,$(wildcard tis/tis*.pp))
- clean:
- -rm -f $(addsuffix /*.re*,$(DIRS))
- -rm -f $(addsuffix /*$(PPUEXT),$(DIRS))
- -rm -f $(addsuffix /*$(OEXT),$(DIRS))
- -rm -f $(addsuffix /*.log,$(DIRS))
- -rm -f $(addsuffix /*.elg,$(DIRS))
- -rm -f $(addsuffix /*.exc,$(DIRS))
- ifdef inlinux
- -rm -f $(patsubst %.pp,%$(EXEEXT),$(wildcard $(addsuffix /t*.pp,$(DIRS))))
- else
- -rm -f $(addsuffix /*$(EXEEXT),$(DIRS))
- endif
- -rm -f $(LOG) $(LONGLOG) faillist ts_fail tf_fail
- -rm -f fpcmaked ppas.sh ppas.bat retcode
- 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
|