rules revision 4d5652abf9ed9c5714723ff7fdb80a54f7350fb2
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# hetcats/Makefile
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# $Header$
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# Year: 2004
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# This Makefile will compile the new hetcats system and provides also
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# targets for test programs during implementation phases.
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# !!! Note: This makefile is written for GNU make !!!
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# (gmake on solaris ; make on linux)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger####################################################################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger## Some varibles, which control the compilation
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerINCLUDE_PATH = ghc:hetcats:fgl
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCOMMONLIB_PATH = Common/Lib:Common/ATerm:fgl/Data/Graph:fgl/Data/Graph/Inductive:fgl/Data/Graph/Inductive/Aux:fgl/Data/Graph/Inductive/Monad:fgl/Data/Graph/Inductive/Query
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCLEAN_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:Taxonomy:$(PFE_PATHS)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger## set ghc imports properly for your system
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerLINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:${LINUX_IMPORTS}:${GHC_IMPORTS}'
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# the 'replacing spaces' example was taken from the (GNU) Make info manual
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerempty:=
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerspace:= $(empty) $(empty)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# override on commandline for other architectures
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerDRIFT_deps = utils/DrIFT-src/*hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerINLINEAXIOMS_deps = utils/InlineAxioms/*hs $(drifted_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHC = ghc
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerPERL = perl
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHAPPY = happy
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerDRIFT = $(DRIFT_ENV) utils/DrIFT
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerINLINEAXIOMS = utils/outlineAxioms
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHADDOCK = haddock
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCPPP = cpp
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHC_FLAGS = -Wall -fglasgow-exts -fno-monomorphism-restriction \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -fallow-overlapping-instances -fallow-undecidable-instances
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# -ddump-minimal-imports
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# flags also come in via ../uni/uni-package.conf
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# but added it here in case of compilation without uni
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHC_INCLUDE = -i$(INCLUDE_PATH)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerUNI_PACKAGE_CONF := $(wildcard ../uni/uni-package.conf)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerifneq ($(strip $(UNI_PACKAGE_CONF)),)
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -package uni-server -DUNI_PACKAGE
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# some modules from uni for haddock
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# if uni/server is included also HaXml sources are needed
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingeruni_sources = $(wildcard ../uni/davinci/haddock/*.hs) \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(wildcard ../uni/graphs/haddock/*.hs) \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ../uni/htk/toplevel/HTk.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(wildcard ../uni/htk/haddock/*/*.hs) \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(wildcard ../uni/events/haddock/*.hs) \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(wildcard ../uni/reactor/haddock/*.hs) \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(wildcard ../uni/util/haddock/*.hs) \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(wildcard ../uni/posixutil/haddock/*.hs)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerendif
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerPFE_TOOLDIR := $(wildcard ../programatica/tools)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerifneq ($(strip $(PFE_TOOLDIR)),)
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger base/transforms base/transforms/Deriving hs2html pfe property base \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger property/pfe property/syntax property/AST property/transforms \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger property/TI property/defs property/parse2 property/parse2/Parser \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger hs2stratego hs2stratego/AST
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerPFE_PATH = $(addprefix -i$(PFE_TOOLDIR)/, $(PFE_DIRS))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# add PFE_PATHS to DERIVEPATH if needed
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# but name clashes currently prevent ATC generation in a single file
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerPFE_PATHS = $(subst $(space),:,$(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS)))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerpfe_sources = $(wildcard $(subst :,/*hs , $(PFE_PATHS)))
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger#-fallow-undecidable-instances -fno-monomorphism-restriction
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerendif
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### Profiling (only for debugging)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### Attention every module must be compiled with profiling or the linker
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### cannot link the various .o files properly. So after switching on
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### Profiling, do an 'gmake real_clean; gmake'
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### and comment out HC_PACKAGE variable definition above.
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### Comment in the following line for switching on profiling.
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger#HC_PROF = -prof -auto-all
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHC_OPTS = $(HCI_OPTS) $(HC_PROF)
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerDRIFT_OPTS = +RTS -K10m -RTS
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### list of directories to run checks in
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerTESTDIRS = Common CASL HasCASL
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger####################################################################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger## sources for hetcats (semi - manually produced with a perl script)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerGHCMAKE_OUTPUT = $(wildcard hetcats-make)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerifneq ($(strip $(GHCMAKE_OUTPUT)),)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerinclude sources_hetcats.mk
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerelse
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerSOURCE_PATHS = $(COMMON_LIB_PATH):$(CLEAN_PATH)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingersources = $(wildcard $(subst :,/*hs , $(SOURCE_PATHS))/*hs)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerendif
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(gendrifted_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingergenrule_header_files = $(wildcard ATC/*.header.hs)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingeratc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Common/AS_Annotation.der.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Static/DevGraph.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Proofs/Proofs.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Isabelle/IsaSign.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingeratc_der_files = $(foreach file, $(atc_files), \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ATC/$(basename $(basename $(notdir $(file)))).der.hs)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger CASL/AS_Basic_CASL.der.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger HasCASL/Sublogic.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerModal_files := Modal/AS_Modal.hs Modal/ModalSign.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCOL_files := COL/AS_COL.hs COL/COLSign.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerlogics := CASL HasCASL Modal CoCASL COL CspCASL
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingeratc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingergenerated_rule_files = $(atc_der_files) $(atc_logic_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingergendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerinline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Comorphisms/Modal2CASL.hs # Comorphisms/CASL2TopSort.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingergen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerderived_sources = $(drifted_files) hetcats/Version.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(inline_axiom_files) Modal/ModalSystems.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# sources that have {-# OPTIONS -cpp #-}
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingercpp_sources = ./Isabelle/Logic_Isabelle.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ./Proofs/Proofs.hs hets.hs ./CASL/CCC/FreeTypes.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ./Comorphisms/LogicList.hs ./Comorphisms/LogicGraph.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# this variable holds the modules that should be documented
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerdoc_sources = $(filter-out $(cpp_sources), $(filter-out $(pfe_sources), \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(sources))) $(patsubst %.hs, %.hspp, $(cpp_sources))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingertax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingertax_objects = $(patsubst %.hs,%.o,$(tax_sources))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger####################################################################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### targets
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger.PHONY : all hets-opt hets-optimized clean d_clean real_clean bin_clean \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger lib_clean distclean check capa hacapa clean_genRules genRules \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger taxonomy hets.cgi count doc apache_doc post_doc4apache \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger derivedSources install_hets install release
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger#.PRECIOUS: sources_hetcats.mk
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerall: hets
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerhets: $(sources) $(derived_sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerhets-opt:
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) distclean
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) derivedSources
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) real_clean
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) hets-optimized
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerhets-optimized: $(derived_sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger strip hets
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerhets-old: $(objects)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(RM) $@
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC) -o hets $(HC_OPTS) $(objects)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerhets.cgi: $(sources) GUI/hets_cgi.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ghc --make -package-conf /home/luettich/ghc-pkg/package.conf \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -package WASH-CGI GUI/hets_cgi.hs -o hets.cgi $(HC_INCLUDE) \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC_FLAGS) -O
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingertaxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger###############################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### TAGS files for (x)emacs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# load them with "M-x" "visit-tags-table" from
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# "HetCATS/hetcats/hetcats.TAGS"
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# use "M-." to search for a tag
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# !!Beware this is somewhat instable, because it uses an absolute path!!
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerhetcats.TAGS: $(sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(sources); mv TAGS $@; mv tags hetcats.tags
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger###############################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### count lines of code
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingercount: $(sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger wc -l $(sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger###############################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### Documentation via haddock
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerdoc: docs/index.html
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# generate haddock documentation with links to sources
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerdocs/index.html: $(doc_sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HADDOCK) $(doc_sources) $(uni_sources) -o docs -h -v \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -i docs/base.haddock -i docs/parsec.haddock -s ../ \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -t 'hets -- a heterogenous Specification (CASL) tool set'
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger# sources are not copied here
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerapache_doc:
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(RM) docs/*.*
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger cvs up -d
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) hets-opt
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) doc
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) post_doc4apache
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(MAKE) hets.cgi
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerpost_doc4apache:
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(PERL) utils/post_process_docs.pl docs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger 'Common.Lib.Map.html:Common.Lib._Map.html'
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger cp docs/*.* a-docs/
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger###############################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### release management
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerderivedSources: $(derived_sources)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerutils/DrIFT: $(DRIFT_deps)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger (cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT && \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger strip ../DrIFT)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerutils/genRules: $(GENERATERULES_deps)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger (cd utils/GenerateRules; \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC) --make '-i../..:../DrIFT-src' \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger GenerateRules.hs -o ../genRules && strip ../genRules)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC) --make utils/InlineAxioms/InlineAxioms.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC_OPTS) -o $(INLINEAXIOMS)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger strip $(INLINEAXIOMS)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerrelease:
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(RM) -r HetCATS
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository\
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger co HetCATS
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(RM) -r uni
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ln -s ../uni uni
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger (cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(RM) clean.*; mv Makefile Makefile.orig; \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger mv ReleaseMakefile Makefile)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger tar cvf HetCATS.tar HetCATS
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerinstall-hets:
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger chmod g+w hets
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger cp -p version_nr $(INSTALLDIR)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger (cd $(INSTALLDIR); $(RM) hets; \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerinstall: hets-opt install-hets
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger#############################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### ATC DrIFT-rule generation
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingergenRules: $(generated_rule_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger$(atc_der_files): $(atc_files) $(genrule_header_files) utils/genRules
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(foreach file,$(atc_files),$(gen_atc_files))
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCASL/ATC_CASL.der.hs: $(CASL_files) utils/genRules
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger utils/genRules -r $(rule) -o CASL $(CASL_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHasCASL/ATC_HasCASL.der.hs: $(HasCASL_files) utils/genRules
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger utils/genRules -r $(rule) -o HasCASL $(HasCASL_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerModal/ATC_Modal.der.hs: $(Modal_files) utils/genRules
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger utils/genRules -r $(rule) -o Modal $(Modal_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCoCASL/ATC_CoCASL.der.hs: $(CoCASL_files) utils/genRules
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger utils/genRules -r $(rule) -o CoCASL $(CoCASL_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCOL/ATC_COL.der.hs: $(COL_files) utils/genRules
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger utils/genRules -r $(rule) -o COL $(COL_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerCspCASL/ATC_CspCASL.der.hs: $(CspCASL_files) utils/genRules
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger utils/genRules -r $(rule) -o CspCASL $(CspCASL_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerrule:= ShATermConvertible
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingergen_atc_files = \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger then utils/genRules -r $(rule) -o ATC -h \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger else utils/genRules -r $(rule) -o ATC $(file); fi ;
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulingerclean_genRules:
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(RM) $(generated_rule_files) $(gendrifted_files)
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger#############################
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger### programatica stuff
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerLEX_DIR := $(PFE_TOOLDIR)/base/parse2/Lexer
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger$(LEX_DIR)/HsLex.hs: $(LEX_DIR)Gen/HsLexerGen
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $< > $@
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(LEX_DIR)/HsTokens.hs
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $(HC) --make -O -package data \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -i$(PFE_TOOLDIR)/base/lib \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger -i$(LEX_DIR):$(LEX_DIR)Gen:$(LEX_DIR)Spec \
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger $@.hs -o $@
838924562130977ca1a3d3839d146fcda39ea1afKryštof Tulinger
838924562130977ca1a3d3839d146fcda39ea1afKryštof TulingerHaskell/HatParser.hs: $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs
###############
### 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)
####################################################################
### 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 analysis
hana: Haskell/hana
Haskell/hana: Haskell/hana.hs Haskell/HatAna.hs
$(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)
### 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: %.y
$(HAPPY) -o $@ $<
%.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