Makefile revision 43b4c41fbb07705c9df321221ab9cb9832460407
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# Makefile
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder# $Header$
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# Year: 2004
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# This Makefile will compile the new hets system and provides also
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# targets for test programs during implementation phases.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# !!! Note: This makefile is written for GNU make !!!
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# (gmake on solaris)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederall: hets
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder## Some varibles, which control the compilation
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja GröningINCLUDE_PATH = ghc fgl hxt
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederCOMMONLIB_PATH = Common/Lib Common/ATerm fgl/Data/Graph \
e1905890322767ae24c4594d80e31877037f4055Klaus Luettich fgl/Data/Graph/Inductive fgl/Data/Graph/Inductive/Internal \
88c800932dd7053322501ea2039d9f234be6866cKlaus Luettich fgl/Data/Graph/Inductive/Monad fgl/Data/Graph/Inductive/Query
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederCLEAN_PATH = . utils/DrIFT-src utils/GenerateRules utils/InlineAxioms Common \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Logic CASL CASL/CCC Syntax Static GUI HasCASL Haskell Modal CoCASL COL \
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder CspCASL ATC ToHaskell Proofs Comorphisms Isabelle Driver $(INCLUDE_PATH) \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Haskell/Hatchet Hatchet Taxonomy $(PFE_PATHS)
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## set ghc imports properly for your system
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederGHC_IMPORTS =`$(HC) --print-libdir`/imports
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus LuettichDRIFT_ENV = \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder DERIVEPATH=.:ghc:$(GHC_IMPORTS):$(subst $(space),:,$(PFE_PATHS))
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder# the 'replacing spaces' example was taken from the (GNU) Make info manual
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederempty:=
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederspace:= $(empty) $(empty)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# override on commandline for other architectures
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederINSTALLDIR = \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederDRIFT_deps = utils/DrIFT-src/*hs
b0294d73dcefc502ddaa13e18b46103a5916971fTill MossakowskiGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps) Common/Utils.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs Common/ListUtils.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Common/Lib/Pretty.hs Common/Keywords.hs Common/Lib/Set.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Common/Lib/Map.hs Common/Lib/Rel.hs Common/Lib/State.hs Common/Id.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs CASL/ShowMixfix.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers CASL/Utils.hs Common/Lexer.hs Common/Token.hs Common/Anno_Parser.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Common/GlobalAnnotations.hs Common/PrettyPrint.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Common/Print_AS_Annotation.hs Common/PPUtils.hs CASL/LiteralFuns.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder CASL/Print_AS_Basic.hs Common/AnnoState.hs CASL/Formula.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder CASL/OpItem.hs CASL/SortItem.hs Common/Result.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Common/ConvertLiteral.hs Common/Earley.hs CASL/MixfixParser.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder CASL/Parse_AS_Basic.hs CASL/Sign.hs CASL/Overload.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder CASL/StaticAna.hs Modal/AS_Modal.hs Modal/Parse_AS.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersHC = ghc
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederPERL = perl
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederHAPPY = happy -sgca
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederDRIFT = utils/DrIFT
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederINLINEAXIOMS = utils/outlineAxioms
ebe517300051f765f2ed856a789dd5613d681ab0Klaus LuettichHADDOCK = haddock
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersCPPP = cpp
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus Luettich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_WARN = -Wall
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_FLAGS = $(HC_WARN) -fglasgow-exts -fno-monomorphism-restriction \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder -fallow-overlapping-instances -fallow-undecidable-instances
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# -ddump-minimal-imports
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# flags also come in via ../uni/uni-package.conf
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# but added it here in case of compilation without uni
ebe517300051f765f2ed856a789dd5613d681ab0Klaus Luettich
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersHC_INCLUDE = $(addprefix -i, $(INCLUDE_PATH))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus Luettichlogics = CASL HasCASL Modal CoCASL COL CspCASL Hatchet
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederUNI_PACKAGE_CONF := $(wildcard ../uni/uni-package.conf)
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maederifneq ($(strip $(UNI_PACKAGE_CONF)),)
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder -package uni-server -DUNI_PACKAGE
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# some modules from uni for haddock
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# if uni/server is included also HaXml sources are needed
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersuni_dirs = ../uni/davinci ../uni/graphs ../uni/events \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers ../uni/reactor ../uni/util ../uni/posixutil
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettichuni_sources = $(wildcard $(addsuffix /haddock/*.hs, $(uni_dirs))) \
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich $(wildcard ../uni/htk/haddock/*/*.hs)
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maederendif
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian MaederPFE_TOOLDIR := $(wildcard ../programatica/tools)
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maederifneq ($(strip $(PFE_TOOLDIR)),)
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian MaederPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
e8d782e6e650b71a2b0ee8461fd8d9fa31525591Christian Maeder base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder base/transforms base/transforms/Deriving property \
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder property/syntax property/AST property/transforms \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning property/TI property/defs property/parse2 property/parse2/Parser
8659594bb40eb5f3da5439692f0908300947191eSonja Gröning
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian MaederPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maederpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja GröningPFE_PATH = $(addprefix -i, $(PFE_PATHS))
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja GröningPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröninghappy_files = $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning $(PFE_TOOLDIR)/base/parse2/Lexer/HsLex.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian MaederLEX_DIR := $(PFE_TOOLDIR)/base/parse2/Lexer
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers$(LEX_DIR)/HsLex.hs: $(LEX_DIR)Gen/HsLexerGen
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder $< > $@
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder $(LEX_DIR)/HsTokens.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(HC) --make -O -package data \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers -i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder -i$(PFE_TOOLDIR)/base/lib \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder $@.hs -o $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederlogics += Haskell
0e012772df2ce0dc7e8f0fe3acf458c2871dcfbcChristian Maederderived_sources += Haskell/PreludeString.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederAPPENDPRELUDESTRING = utils/appendHaskellPreludeString \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Haskell/ProgramaticaPrelude.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## rule for appendHaskellPreludeString
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian MaederHaskell/PreludeString.hs: Haskell/PreludeString.append.hs \
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder $(APPENDPRELUDESTRING)
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder $(APPENDPRELUDESTRING) < $< > $@
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederAst_Haskell_files := HsDeclStruct HsExpStruct HsFieldsStruct \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder HsGuardsStruct HsKindStruct HsPatStruct HsTypeStruct HsAssocStruct \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers HsModule HsName HsLiteral HsIdent
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder
88c800932dd7053322501ea2039d9f234be6866cKlaus LuettichOther_PFE_files := property/AST/HsPropStruct base/defs/PNT \
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder base/defs/UniqueNames base/Modules/TypedIds \
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder base/TI/TiKinds \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder base/parse2/SourceNames base/syntax/SyntaxRec \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder property/syntax/PropSyntaxStruct
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian MaederHaskell_files = $(addsuffix .hs, \
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder $(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder $(addprefix $(PFE_TOOLDIR)/, $(Other_PFE_files)))
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder## rule for ATC generation
b49276c9f50038e0bd499ad49f7bd6444566a834Christian MaederHaskell/ATC_Haskell.der.hs: $(Haskell_files) utils/genRules
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder utils/genRules -r $(rule) -o Haskell -h ATC/Haskell.header.hs \
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder $(Haskell_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederhappy_files += Haskell/Hatchet/HsParser.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
f29371d8bd5a232c974e736b06d0d8a655d320fbKlaus Luettich### Profiling (only for debugging)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Attention every module must be compiled with profiling or the linker
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### cannot link the various .o files properly. So after switching on
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Profiling, do an 'gmake real_clean; gmake'
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### and comment out HC_PACKAGE variable definition above.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Comment in the following line for switching on profiling.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder#HC_PROF = -prof -auto-all
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_OPTS = $(HCI_OPTS) $(HC_PROF)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederDRIFT_OPTS = +RTS -K10m -RTS
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### list of directories to run checks in
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederTESTDIRS = Common CASL HasCASL Haskell/Hatchet/examples ToHaskell
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## sources for hets (semi - manually produced with a perl script)
724ecbf67db2531c73555411c57555065f12913bChristian Maeder
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich#GHCMAKE_OUTPUT = $(wildcard hetcats-make)
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich#ifneq ($(strip $(GHCMAKE_OUTPUT)),)
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich#include sources_hetcats.mk
19933e754a6a244efca3b63184fb191668e08931Klaus Luettich#else
75cda7e5b890d050d560d970af244a183f28328fKlaus Luettich
ef67402074be14deb95e4ff564737d5593144130Klaus Luettichnon_sources = Common/LaTeX_maps.svmono.hs CspCASL/Main.hs Logic/Morphism.hs
ef67402074be14deb95e4ff564737d5593144130Klaus LuettichSOURCE_PATHS = $(COMMONLIB_PATH) $(CLEAN_PATH)
1323eba62fc519b068f5aaec4f9d2be05ffabea9Klaus Luettichsources = hets.hs $(filter-out $(non_sources), \
1323eba62fc519b068f5aaec4f9d2be05ffabea9Klaus Luettich $(wildcard $(addsuffix /[A-Z]*hs, $(SOURCE_PATHS))))
1323eba62fc519b068f5aaec4f9d2be05ffabea9Klaus Luettich#endif
725a68ec81cba9b8aa8647bebfb5baa449803e7eKlaus Luettich
d579f5b263e6c73d466c265f2fbfd45b0e69ca64Klaus Luettichobjects = $(sources:%.hs=%.o)
bf731ab5ef055c75bf26e8e5b2eb4a4a11ab61ebKlaus Luettich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder $(gendrifted_files)
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maedergenrule_header_files = $(wildcard ATC/*.header.hs)
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maederatc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Common/AS_Annotation.der.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Static/DevGraph.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Proofs/Proofs.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Isabelle/IsaSign.hs
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maederatc_der_files = $(foreach file, $(atc_files), \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder ATC/$(basename $(basename $(notdir $(file)))).der.hs)
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederCASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder CASL/AS_Basic_CASL.der.hs
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
ac43fa22d2d3f91a17674ac164cba3cf39a17795Klaus Luettich HasCASL/Sublogic.hs \
ac43fa22d2d3f91a17674ac164cba3cf39a17795Klaus Luettich
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersModal_files := Modal/AS_Modal.hs Modal/ModalSign.hs
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederCoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersCOL_files := COL/AS_COL.hs COL/COLSign.hs
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederCspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersHatchet_files := Haskell/Hatchet/AnnotatedHsSyn.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Haskell/Hatchet/MultiModuleBasics.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Haskell/Hatchet/HsSyn.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Haskell/Hatchet/Representation.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Haskell/Hatchet/Class.hs Haskell/Hatchet/KindInference.hs \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder Haskell/Hatchet/Env.hs Hatchet/HatParser.hs
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maederatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersgenerated_rule_files = $(atc_der_files) $(atc_logic_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersgendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
ac43fa22d2d3f91a17674ac164cba3cf39a17795Klaus Luettich
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersinline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers Comorphisms/Modal2CASL.hs Comorphisms/CASL2TopSort.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersgen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersderived_sources += $(drifted_files) Driver/Version.hs $(happy_files) \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(inline_axiom_files) Modal/ModalSystems.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers# sources that have {-# OPTIONS -cpp #-}
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckerscpp_sources = Isabelle/Logic_Isabelle.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers Proofs/Proofs.hs hets.hs CASL/CCC/FreeTypes.hs \
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich Comorphisms/LogicList.hs Comorphisms/LogicGraph.hs $(happy_files)
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maedernondoc_sources = $(wildcard utils/DrIFT-src/*.hs) \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(wildcard utils/DrIFT-src/*.lhs) \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(wildcard utils/GenerateRules/*.hs) \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(wildcard utils/InlineAxioms/*.hs) \
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder $(cpp_sources) $(pfe_sources) $(gen_inline_axiom_files) \
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder $(genrule_header_files) $(generated_rule_files) \
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder Haskell/PreludeString.append.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Haskell/ProgramaticaPrelude.hs hxt/HXT.hs \
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder $(patsubst %.hs,%.der.hs,$(drifted_files))
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# this variable holds the modules that should be documented
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersdoc_sources = $(filter-out $(nondoc_sources), $(sources)) \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(patsubst %.hs, %.hspp, $(cpp_sources)) $(uni_sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maedertax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maedertax_objects = $(patsubst %.hs,%.o,$(tax_sources))
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder####################################################################
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder### targets
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder.PHONY : all hets-opt hets-optimized clean d_clean real_clean bin_clean \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder lib_clean distclean check capa hacapa h2h clean_genRules genRules \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder taxonomy count doc apache_doc post_doc4apache \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder derivedSources install_hets install release
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder#.PRECIOUS: sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder### call run_hc with
75cda7e5b890d050d560d970af244a183f28328fKlaus Luettich# $(call run_hc,<command-that-compiles-hetc-with-ghc>)
75cda7e5b890d050d560d970af244a183f28328fKlaus Luettich# and it generates hetcats-make
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder# iff there was no error during compilation
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maederrun_hc = ($(1) 2>&1 || $(RM) hetcats-make) | tee hetcats-make
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maederhets: $(sources) $(derived_sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(call run_hc, $(HC) --make -o $@ hets.hs $(HC_OPTS))
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhets-opt:
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(MAKE) distclean
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(MAKE) derivedSources
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(MAKE) real_clean
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning $(MAKE) hets-optimized
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhets-optimized: $(derived_sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(call run_hc, $(HC) --make -O -o hets hets.hs $(HC_OPTS))
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder strip hets
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhets-old: $(objects)
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian Maeder $(RM) $@
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian Maeder $(HC) -o hets $(HC_OPTS) $(objects)
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhets.cgi: $(sources) GUI/hets_cgi.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder ghc --make -package-conf /home/luettich/ghc-pkg/package.conf \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder -package WASH-CGI GUI/hets_cgi.hs -o hets.cgi $(HC_INCLUDE) \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC_FLAGS) -O
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder strip hets.cgi
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maedertaxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder###############################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### TAGS files for (x)emacs
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian Maeder# load them with "M-x" "visit-tags-table" from
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# "HetCATS/hetcats.TAGS"
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# use "M-." to search for a tag
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# !!Beware this is somewhat instable, because it uses an absolute path!!
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhetcats.TAGS: $(sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(sources); mv TAGS $@; mv tags hetcats.tags
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder###############################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### count lines of code
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maedercount: $(sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder wc -l $(sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder###############################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Documentation via haddock
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederdoc: docs/index.html
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# generate haddock documentation with links to sources
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederdocs/index.html: $(doc_sources)
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder $(HADDOCK) $(doc_sources) -o docs -h -v \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder -i docs/base.haddock -i docs/parsec.haddock -s ../ \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder -t 'hets -- a heterogenous Specification (CASL) tool set'
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# sources are not copied here
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederapache_doc:
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) docs/*.*
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder cvs up -d
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder $(MAKE) hets-opt
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(MAKE) doc
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(MAKE) post_doc4apache
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(MAKE) o_clean
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(MAKE) hets.cgi
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederpost_doc4apache:
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(PERL) utils/post_process_docs.pl docs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder 'Common.Lib.Map.html:Common.Lib._Map.html'
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers cp docs/*.* a-docs/
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers###############################
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers### release management
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus LuettichderivedSources: $(derived_sources)
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus Luettich
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus Luettichutils/DrIFT: $(DRIFT_deps)
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus Luettich (cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT && \
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich strip ../DrIFT)
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettichutils/genRules: $(GENERATERULES_deps)
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich (cd utils/GenerateRules; \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(HC) --make -i../DrIFT-src -i../.. $(HC_WARN) \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder GenerateRules.hs -o ../genRules && strip ../genRules)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make utils/InlineAxioms/InlineAxioms.hs $(HC_WARN) \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder -i../.. -o $(INLINEAXIOMS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder strip $(INLINEAXIOMS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederrelease:
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) -r HetCATS
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository\
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder co -P HetCATS
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) -r uni
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder if [ -d ../uni ] ; then ln -s ../uni uni ; fi
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) -r programatica
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder if [ -d ../programatica ] ; then \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder mkdir programatica; \
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich ln -s ../../programatica/tools programatica/tools ; fi
efa8f9db01f64e2c719c201e4037743caefae045Klaus Luettich (cd HetCATS; $(MAKE) derivedSources; \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(MAKE) clean; ./clean.sh; \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) clean.*; mv Makefile Makefile.orig; \
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder mv ReleaseMakefile Makefile)
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder tar cvf HetCATS.tar HetCATS
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maederinstall-hets:
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers chmod g+w hets
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder cp -p version_nr $(INSTALLDIR)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder (cd $(INSTALLDIR); $(RM) hets; \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederinstall: hets-opt install-hets
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder#############################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### ATC DrIFT-rule generation
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaedergenRules: $(generated_rule_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder$(atc_der_files): $(atc_files) $(genrule_header_files) utils/genRules
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(foreach file,$(atc_files),$(gen_atc_files))
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederCASL/ATC_CASL.der.hs: $(CASL_files) utils/genRules
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder utils/genRules -r $(rule) -o CASL $(CASL_files)
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHasCASL/ATC_HasCASL.der.hs: $(HasCASL_files) utils/genRules
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder utils/genRules -r $(rule) -o HasCASL $(HasCASL_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederModal/ATC_Modal.der.hs: $(Modal_files) utils/genRules
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder utils/genRules -r $(rule) -o Modal $(Modal_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian MaederCoCASL/ATC_CoCASL.der.hs: $(CoCASL_files) utils/genRules
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder utils/genRules -r $(rule) -o CoCASL $(CoCASL_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersCOL/ATC_COL.der.hs: $(COL_files) utils/genRules
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder utils/genRules -r $(rule) -o COL $(COL_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersCspCASL/ATC_CspCASL.der.hs: $(CspCASL_files) utils/genRules
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder utils/genRules -r $(rule) -o CspCASL $(CspCASL_files)
f29371d8bd5a232c974e736b06d0d8a655d320fbKlaus Luettich
f29371d8bd5a232c974e736b06d0d8a655d320fbKlaus LuettichHatchet/ATC_Hatchet.der.hs: $(Hatchet_files) utils/genRules
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder utils/genRules -r $(rule) -o Hatchet -h ATC/Hatchet.header.hs \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(Hatchet_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederrule:= ShATermConvertible
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersgen_atc_files = \
88c800932dd7053322501ea2039d9f234be6866cKlaus Luettich if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder then utils/genRules -r $(rule) -o ATC -h \
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
else utils/genRules -r $(rule) -o ATC $(file); fi ;
clean_genRules:
$(RM) $(generated_rule_files) $(gendrifted_files)
###############
### clean up
clean: bin_clean o_clean
### removes *.hi and *.o in all include directories
o_clean:
for p in $(CLEAN_PATH) ; do \
(cd $$p ; $(RM) *.hi *.o *.hspp) ; done
### remove binaries
bin_clean:
$(RM) hets
$(RM) test_parser
$(RM) CASL/capa
$(RM) HasCASL/hacapa
$(RM) Haskell/hapa
$(RM) Haskell/hana
$(RM) Haskell/wrap
$(RM) ToHaskell/h2h
$(RM) Syntax/hetpa
$(RM) Static/hetana
$(RM) GUI/hetdg
$(RM) hetpa
$(RM) hetana
$(RM) hetdg
$(RM) atctest2
$(RM) atctest
$(RM) Common/annos
$(RM) Haskell/Hatchet/hatch
$(RM) ToHaskell/translateAna
$(RM) Taxonomy/taxonomyTool
### additonally removes *.d (dependency files) in every include directory
### also delete *.d.bak (dependency file backups)
d_clean: clean
for p in $(CLEAN_PATH) ; do \
(cd $$p ; $(RM) *.d *.d.bak) ; done
### remove files also in own libraries
lib_clean:
for p in $(COMMONLIB_PATH) ; do \
(cd $$p ; $(RM) *.hi *.d *.o) ; done
### additionally removes the files that define the sources-variable
real_clean: bin_clean lib_clean clean
$(RM) hetcats-make sources_hetcats.mk
### additionally removes files not in CVS tree
distclean: real_clean clean_genRules d_clean
$(RM) $(derived_sources)
$(RM) utils/DrIFT utils/genRules $(INLINEAXIOMS)
####################################################################
### test targets
####################################################################
### a parser to test annotation parser and Id parsers
test_parser: Common/test_parser
Common/test_parser: Common/test_parser.hs Common/AS_Annotation.der.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### interactive
ghci:
$(HC)i $(HCI_OPTS)
### christian's target
### CASL parser
capa: CASL/capa
CASL/capa: CASL/capa.hs Common/*.hs CASL/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HasCASL parser
hacapa: HasCASL/hacapa
HasCASL/hacapa: HasCASL/hacapa.hs Common/*.hs HasCASL/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### Haskell analysis
hana: Haskell/hana
Haskell/hana: Haskell/hana.hs Haskell/HatAna.hs Haskell/PreludeString.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HasCASL to Haskell translation
h2h: ToHaskell/h2h
ToHaskell/h2h: ToHaskell/h2h.hs ToHaskell/*.hs Haskell/*.hs HasCASL/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL parser
hetpa: Syntax/hetpa.hs Syntax/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL parser
hetana: Static/hetana.hs Static/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### ATC test system
atctest: ATC/ATCTest.hs ATC/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
atctest2: ATC/ATCTest2.hs Common/SimpPretty.hs \
Common/ATerm/*.hs Common/Lib/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### ATerm.Lib test system
atermlibtest: Common/ATerm/ATermLibTest.hs Common/SimpPretty.hs \
Common/ATerm/*.hs Common/Lib/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL with dev graph
hetdg: GUI/hetdg.hs $(drifted_files) *.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### run tests in other directories
check:
for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
####################################################################
## Preparing the version of HetCATS
Driver/Version.hs: Driver/Version.in version_nr
$(PERL) utils/build_version.pl version_nr < Driver/Version.in > $@
## two hardcoded dependencies for a correct generation of Version.hs
Driver/Options.hs Driver/WriteFn.hs Driver/ReadFn.hs: Driver/Version.hs
hets.hs: Driver/Version.hs
####################################################################
## rules for DrIFT
.SUFFIXES:
%: %.hs
$(HC) --make -o $@ $<
%.hs: %.ly
$(HAPPY) $<
%.hs: %.y
$(HAPPY) -o $@ $<
%.hs: %.der.hs utils/DrIFT
($(DRIFT_ENV); export DERIVEPATH; $(DRIFT) $(DRIFT_OPTS) $< > $@)
## rules for inlineAxioms
%.hs: %.inline.hs $(INLINEAXIOMS)
$(INLINEAXIOMS) $< > $@
## rule for cpp and haddock
%.hspp: %.hs
$(HC) -E -cpp -DUNI_PACKAGE -optP -P $<
## compiling rules for object and interface files
%.o %.hi: %.hs
$(HC) -c $< $(HC_OPTS)
%.o %.hi: %.lhs
$(HC) -c $< $(HC_OPTS)
## compiling rules for dependencies
%.d : %.hs
$(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
%.d : %.lhs
$(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
Modal/ModalSystems.hs: Modal/GeneratePatterns.inline.hs.in \
utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(PERL) utils/genTransMFormFunc.pl $< $@
# hetcats-make is created as side-effect of hets or hets-optimized
sources_hetcats.mk: hetcats-make utils/create_sources.pl
$(PERL) utils/create_sources.pl hetcats-make sources_hetcats.mk