Makefile revision d784803f9c752667b4fcf7393d698002bedf3f89
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# hetcats/Makefile
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# $Header$
71cef386fae61275b03e203825680b39fedaa8c6Tinderbox User# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Year: 2004
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# This Makefile will compile the new hetcats system and provides also
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User# targets for test programs during implementation phases.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews# !!! Note: This makefile is written for GNU make !!!
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# (gmake on solaris ; make on linux)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews####################################################################
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User## Some varibles, which control the compilation
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserINCLUDE_PATH = ghc:hetcats
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm:fgl/Data/Graph:fgl/Data/Graph/Inductive:fgl/Data/Graph/Inductive/Aux:fgl/Data/Graph/Inductive/Monad:fgl/Data/Graph/Inductive/Query
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic UpdaterCLEAN_PATH = utils/DrIFT-src:utils/GenerateRules:utils/InlineAxioms:Common:Logic:CASL:CASL/CCC:Syntax:Static:GUI:HasCASL:Haskell:Modal:CoCASL:COL:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:Isabelle:$(INCLUDE_PATH):Haskell/Hatchet:$(PFE_DRIFTPATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews## set ghc imports properly for your system
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsLINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:${LINUX_IMPORTS}:${GHC_IMPORTS}'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the 'replacing spaces' example was taken from the (GNU) Make info manual
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsempty:=
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsspace:= $(empty) $(empty)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# add PFE_DRIFTPATH to DERIVEPATH if needed
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater# but name clashes currently prevent ATC generation in a single file
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic UpdaterPFE_DRIFTPATH = $(subst $(space),:,$(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS)))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# override on commandline for other architectures
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserDRIFT_deps = utils/DrIFT-src/*hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserINLINEAXIOMS_deps = utils/InlineAxioms/*hs
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHC = ghc
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserPERL = perl
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHAPPY = happy
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserDRIFT = $(DRIFT_ENV) utils/DrIFT
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsINLINEAXIOMS = utils/outlineAxioms
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHADDOCK = haddock
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserCPPP = cpp
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHC_FLAGS = -Wall -fglasgow-exts
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# -ddump-minimal-imports
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# flags also come in via ../uni/uni-package.conf
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# but added it here in case of compilation without uni
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHC_INCLUDE = -i$(INCLUDE_PATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User -package uni-server -DUNI_PACKAGE
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserPFE_TOOLDIR = $(wildcard ../programatica/tools)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userifneq ($(strip $(PFE_TOOLDIR)),)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User base/transforms base/transforms/Deriving hs2html \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User property/pfe property/syntax property/AST property/transforms \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User property/TI property/defs property/parse2 property/parse2/Parser \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt hs2stratego hs2stratego/AST
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPFE_PATH = $(addprefix -i$(PFE_TOOLDIR)/, $(PFE_DIRS))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#-fallow-undecidable-instances -fno-monomorphism-restriction
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### Profiling (only for debugging)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### Attention every module must be compiled with profiling or the linker
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### cannot link the various .o files properly. So after switching on
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### Profiling, do an 'gmake real_clean; gmake'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### and comment out HC_PACKAGE variable definition above.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### Comment in the following line for switching on profiling.
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User#HC_PROF = -prof -auto-all
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserHC_OPTS = $(HCI_OPTS) $(HC_PROF)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsDRIFT_OPTS = +RTS -K10m -RTS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### list of directories to run checks in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTESTDIRS = Common CASL HasCASL
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews####################################################################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews## sources for hetcats (semi - manually produced with a perl script)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntGHCMAKE_OUTPUT = $(wildcard hetcats-make)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsifneq ($(strip $(GHCMAKE_OUTPUT)),)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude sources_hetcats.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewselse
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSOURCE_PATH = $(COMMON_LIB_PATH):$(CLEAN_PATH)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewssources = $(wildcard $(subst :,/*hs , $(SOURCE_PATH))/*hs)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsendif
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(gendrifted_files)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsgenrule_header_files = $(wildcard ATC/*.header.hs)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Useratc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Common/AS_Annotation.der.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Static/DevGraph.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Proofs/Proofs.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Isabelle/IsaSign.hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsatc_der_files = $(foreach file, $(atc_files), ATC/$(basename $(basename $(notdir $(file)))).der.hs)
f6da30bb5447c23d880b09f601441e70c5313557Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews CASL/AS_Basic_CASL.der.hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User HasCASL/Sublogic.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsModal_files := Modal/AS_Modal.hs Modal/ModalSign.hs
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCOL_files := COL/AS_COL.hs COL/COLSign.hs
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewslogics := CASL HasCASL Modal CoCASL COL CspCASL
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usergenerated_rule_files = $(atc_der_files) $(atc_logic_files)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntgendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs Comorphisms/Modal2CASL.hs
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntgen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewshappy_files =
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsderived_sources = $(drifted_files) $(happy_files) hetcats/Version.hs $(inline_axiom_files) Modal/ModalSystems.hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# sources that have {-# OPTIONS -cpp #-}
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewscpp_sources = ./Isabelle/Logic_Isabelle.hs \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ./Proofs/Proofs.hs hets.hs ./CASL/CCC/FreeTypes.hs \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User ./Comorphisms/LogicList.hs ./Comorphisms/LogicGraph.hs
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User# this variable holds the modules that should be documented
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userdoc_sources = $(filter-out $(cpp_sources) ,$(sources)) \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(patsubst %.hs, %.hspp, $(cpp_sources))
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# some modules from uni for haddock
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# if uni/server is included also HaXml sources are needed
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsuni_sources = $(wildcard ../uni/davinci/haddock/*.hs) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(wildcard ../uni/graphs/haddock/*.hs) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ../uni/htk/toplevel/HTk.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(wildcard ../uni/htk/haddock/*/*.hs) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(wildcard ../uni/events/haddock/*.hs) \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(wildcard ../uni/reactor/haddock/*.hs) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(wildcard ../uni/util/haddock/*.hs) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(wildcard ../uni/posixutil/haddock/*.hs)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewstax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewstax_objects = $(patsubst %.hs,%.o,$(tax_sources))
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews####################################################################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### targets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews.PHONY : all hets-opt hets-optimized clean d_clean real_clean bin_clean \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews lib_clean distclean check capa hacapa clean_genRules genRules \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews taxonomy hets.cgi count doc apache_doc post_doc4apache \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User derivedSources install_hets install release
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#.PRECIOUS: sources_hetcats.mk
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsall: hets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewshets: $(sources) $(derived_sources)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userhets-opt: $(sources) $(derived_sources)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(MAKE) distclean
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews $(MAKE) derivedSources
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(MAKE) real_clean
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(MAKE) hets-optimized
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userhets-optimized: $(sources) $(derived_sources)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt strip hets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewshets-old: $(objects)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(RM) $@
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HC) -o hets $(HC_OPTS) $(objects)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox Userhets.cgi: $(sources) GUI/hets_cgi.hs
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User ghc --make -package-conf /home/luettich/ghc-pkg/package.conf -package WASH-CGI GUI/hets_cgi.hs -o hets.cgi $(HC_INCLUDE) $(HC_FLAGS) -O
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usertaxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews###############################
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### TAGS files for (x)emacs
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# load them with "M-x" "visit-tags-table" from
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# "HetCATS/hetcats/hetcats.TAGS"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# use "M-." to search for a tag
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# !!Beware this is somewhat instable, because it uses an absolute path!!
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userhetcats.TAGS: $(sources)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(sources); mv TAGS $@; mv tags hetcats.tags
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews###############################
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews### count lines of code
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewscount: $(sources)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews wc -l $(sources)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User###############################
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt### Documentation via haddock
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsdoc: docs/index.html
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# generate haddock documentation with links to sources
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userdocs/index.html: $(doc_sources)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(HADDOCK) $(doc_sources) $(uni_sources) -o docs -h -v \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User -i docs/base.haddock -i docs/parsec.haddock -s ../ \
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User -t 'hets -- a heterogenous Specification (CASL) tool set'
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# sources are not copied here
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsapache_doc:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(RM) docs/*.*
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cvs up -d
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(MAKE) hets-opt
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(MAKE) doc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(MAKE) post_doc4apache
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User $(MAKE) hets.cgi
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userpost_doc4apache:
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User $(PERL) utils/post_process_docs.pl docs \
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User 'Common.Lib.Map.html:Common.Lib._Map.html'
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User cp docs/*.* a-docs/
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User###############################
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User### release management
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox UserderivedSources: $(derived_sources)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userutils/DrIFT: $(DRIFT_deps)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User (cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT && \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews strip ../DrIFT)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Userutils/genRules: $(GENERATERULES_deps)
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User (cd utils/GenerateRules; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HC) --make '-i../..:../DrIFT-src' -package text GenerateRules.hs -o ../genRules && \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews strip ../genRules)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HC) --make utils/InlineAxioms/InlineAxioms.hs \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(HC_OPTS) -o $(INLINEAXIOMS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews strip $(INLINEAXIOMS)
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox User
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updaterrelease:
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater $(RM) -r HetCATS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository co HetCATS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(RM) -r uni
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews ln -s ../uni uni
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews (cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater $(RM) clean.*; mv Makefile Makefile.orig; \
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater mv ReleaseMakefile Makefile)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews tar cvf HetCATS.tar HetCATS
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinstall-hets:
350e5eecadfc5ee72b11b2cc46828c9a0bcd717cTinderbox User chmod g+w hets
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews cp -p version_nr $(INSTALLDIR)
(cd $(INSTALLDIR); $(RM) hets; \
ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
install: hets-opt install-hets
#############################
### ATC DrIFT-rule generation
genRules: $(generated_rule_files)
$(atc_der_files): $(atc_files) $(genrule_header_files) utils/genRules
$(foreach file,$(atc_files),$(gen_atc_files))
CASL/ATC_CASL.der.hs: $(CASL_files) utils/genRules
utils/genRules -r $(rule) -o CASL $(CASL_files)
HasCASL/ATC_HasCASL.der.hs: $(HasCASL_files) utils/genRules
utils/genRules -r $(rule) -o HasCASL $(HasCASL_files)
Modal/ATC_Modal.der.hs: $(Modal_files) utils/genRules
utils/genRules -r $(rule) -o Modal $(Modal_files)
CoCASL/ATC_CoCASL.der.hs: $(CoCASL_files) utils/genRules
utils/genRules -r $(rule) -o CoCASL $(CoCASL_files)
COL/ATC_COL.der.hs: $(COL_files) utils/genRules
utils/genRules -r $(rule) -o COL $(COL_files)
CspCASL/ATC_CspCASL.der.hs: $(CspCASL_files) utils/genRules
utils/genRules -r $(rule) -o CspCASL $(CspCASL_files)
rule:= ShATermConvertible
gen_atc_files = if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; then \
utils/genRules -r $(rule) -o ATC -h 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
### removes *.hi and *.o in all include directories
clean: bin_clean
for p in $(subst :, ,$(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) 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 $(subst :, ,$(CLEAN_PATH)) . ; do \
(cd $$p ; $(RM) *.d *.d.bak) ; done
### remove files also in own libraries
lib_clean:
for p in $(subst :, ,$(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) hetcats/Version.hs
$(RM) $(drifted_file) $(inline_axiom_files)
$(RM) utils/DrIFT utils/genRules $(INLINEAXIOMS)
# $(RM) $(happy_files)
####################################################################
### 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
$(RM) $@
$(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
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### HasCASL parser
hacapa: HasCASL/hacapa
HasCASL/hacapa: HasCASL/hacapa.hs Common/*.hs HasCASL/*.hs
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### Haskell parser
hapa: Haskell/hapa
Haskell/hapa: Haskell/hapa.hs Haskell/Hatchet/*.hs $(happy_files)
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### Haskell analysis
hana: Haskell/hana
Haskell/hana: Haskell/hana.hs Haskell/HatAna.hs Haskell/Hatchet/*.hs $(happy_files)
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL parser
hetpa: Syntax/hetpa.hs Syntax/*.hs
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL parser
hetana: Static/hetana.hs Static/*.hs
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### ATC test system
atctest: ATC/ATCTest.hs ATC/*.hs
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
atctest2: Common/ATerm/ATermLibTest.hs Common/SimpPretty.hs Common/ATerm/*.hs Common/Lib/*.hs
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### ATerm.Lib test system
atermlibtest: Common/ATerm/ATermLibTest.hs Common/ATerm/*.hs Common/SimpPretty.hs
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL with dev graph
hetdg: GUI/hetdg.hs $(drifted_files) *.hs
$(RM) $@
$(HC) --make -o $@ $< $(HC_OPTS) -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
### run tests in other directories
check: hetcats
for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
####################################################################
## Preparing the version of HetCATS
hetcats/Version.hs: hetcats/Version.in version_nr
$(PERL) utils/build_version.pl version_nr < hetcats/Version.in > $@
## two hardcoded dependencies for a correct generation of Version.hs
hetcats/Options.hs hetcats/WriteFn.hs hetcats/ReadFn.hs: hetcats/Version.hs
hets.hs: hetcats/Version.hs
####################################################################
## rules for DrIFT
.SUFFIXES:
%.hs: %.ly
$(HAPPY) $<
%.hs: %.der.hs utils/DrIFT
$(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