rules revision dfaa945ae8e570a57dad32b18732ac2c3982893c
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# hetcats/Makefile
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# $Header$
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# Year: 2004
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# This Makefile will compile the new hetcats system and provides also
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# targets for test programs during implementation phases.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# !!! Note: This makefile is written for GNU make !!!
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# (gmake on solaris ; make on linux)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync####################################################################
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync## Some varibles, which control the compilation
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncINCLUDE_PATH = ghc:hetcats:fgl
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCOMMONLIB_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
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCLEAN_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_PATHS)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync## set ghc imports properly for your system
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncLINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:${LINUX_IMPORTS}:${GHC_IMPORTS}'
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# the 'replacing spaces' example was taken from the (GNU) Make info manual
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncempty:=
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncspace:= $(empty) $(empty)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# override on commandline for other architectures
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDRIFT_deps = utils/DrIFT-src/*hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncINLINEAXIOMS_deps = utils/InlineAxioms/*hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHC = ghc
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPERL = perl
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHAPPY = happy
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDRIFT = $(DRIFT_ENV) utils/DrIFT
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncINLINEAXIOMS = utils/outlineAxioms
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHADDOCK = haddock
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCPPP = cpp
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHC_FLAGS = -Wall -fglasgow-exts
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# -fallow-overlapping-instances -fallow-incoherent-instances
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# -ddump-minimal-imports
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# flags also come in via ../uni/uni-package.conf
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# but added it here in case of compilation without uni
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHC_INCLUDE = -i$(INCLUDE_PATH)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncUNI_PACKAGE_CONF := $(wildcard ../uni/uni-package.conf)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncifneq ($(strip $(UNI_PACKAGE_CONF)),)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync -package uni-server -DUNI_PACKAGE
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# some modules from uni for haddock
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# if uni/server is included also HaXml sources are needed
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncuni_sources = $(wildcard ../uni/davinci/haddock/*.hs) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(wildcard ../uni/graphs/haddock/*.hs) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ../uni/htk/toplevel/HTk.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(wildcard ../uni/htk/haddock/*/*.hs) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(wildcard ../uni/events/haddock/*.hs) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(wildcard ../uni/reactor/haddock/*.hs) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(wildcard ../uni/util/haddock/*.hs) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(wildcard ../uni/posixutil/haddock/*.hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncendif
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPFE_TOOLDIR := $(wildcard ../programatica/tools)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncifneq ($(strip $(PFE_TOOLDIR)),)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync base/transforms base/transforms/Deriving hs2html \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync property/pfe property/syntax property/AST property/transforms \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync property/TI property/defs property/parse2 property/parse2/Parser \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync hs2stratego hs2stratego/AST
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPFE_PATH = $(addprefix -i$(PFE_TOOLDIR)/, $(PFE_DIRS))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# add PFE_PATHS to DERIVEPATH if needed
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# but name clashes currently prevent ATC generation in a single file
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPFE_PATHS = $(subst $(space),:,$(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS)))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncpfe_sources = $(wildcard $(subst :,/*hs , $(PFE_PATHS)))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#-fallow-undecidable-instances -fno-monomorphism-restriction
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncendif
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### Profiling (only for debugging)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### Attention every module must be compiled with profiling or the linker
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### cannot link the various .o files properly. So after switching on
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### Profiling, do an 'gmake real_clean; gmake'
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### and comment out HC_PACKAGE variable definition above.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### Comment in the following line for switching on profiling.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#HC_PROF = -prof -auto-all
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHC_OPTS = $(HCI_OPTS) $(HC_PROF)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDRIFT_OPTS = +RTS -K10m -RTS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### list of directories to run checks in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncTESTDIRS = Common CASL HasCASL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync####################################################################
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync## sources for hetcats (semi - manually produced with a perl script)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncGHCMAKE_OUTPUT = $(wildcard hetcats-make)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncifneq ($(strip $(GHCMAKE_OUTPUT)),)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncinclude sources_hetcats.mk
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncelse
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncSOURCE_PATHS = $(COMMON_LIB_PATH):$(CLEAN_PATH)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncsources = $(wildcard $(subst :,/*hs , $(SOURCE_PATHS))/*hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncendif
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(gendrifted_files)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgenrule_header_files = $(wildcard ATC/*.header.hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncatc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Common/AS_Annotation.der.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Static/DevGraph.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Proofs/Proofs.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Isabelle/IsaSign.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncatc_der_files = $(foreach file, $(atc_files), \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ATC/$(basename $(basename $(notdir $(file)))).der.hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync CASL/AS_Basic_CASL.der.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync HasCASL/Sublogic.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncModal_files := Modal/AS_Modal.hs Modal/ModalSign.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCOL_files := COL/AS_COL.hs COL/COLSign.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynclogics := CASL HasCASL Modal CoCASL COL CspCASL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgenerated_rule_files = $(atc_der_files) $(atc_logic_files)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncinline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Comorphisms/Modal2CASL.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchappy_files =
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncderived_sources = $(drifted_files) $(happy_files) hetcats/Version.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(inline_axiom_files) Modal/ModalSystems.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# sources that have {-# OPTIONS -cpp #-}
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynccpp_sources = ./Isabelle/Logic_Isabelle.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ./Proofs/Proofs.hs hets.hs ./CASL/CCC/FreeTypes.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ./Comorphisms/LogicList.hs ./Comorphisms/LogicGraph.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ./Taxonomy/AbstractGraphView.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# this variable holds the modules that should be documented
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdoc_sources = $(filter-out $(cpp_sources), $(filter-out $(pfe_sources), \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(sources))) $(patsubst %.hs, %.hspp, $(cpp_sources))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctax_objects = $(patsubst %.hs,%.o,$(tax_sources))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync####################################################################
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### targets
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync.PHONY : all hets-opt hets-optimized clean d_clean real_clean bin_clean \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync lib_clean distclean check capa hacapa clean_genRules genRules \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync taxonomy hets.cgi count doc apache_doc post_doc4apache \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync derivedSources install_hets install release
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#.PRECIOUS: sources_hetcats.mk
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncall: hets
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets: $(sources) $(derived_sources)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets-opt:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) distclean
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) derivedSources
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) real_clean
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) hets-optimized
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets-optimized: $(derived_sources)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync strip hets
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets-old: $(objects)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(RM) $@
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) -o hets $(HC_OPTS) $(objects)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets.cgi: $(sources) GUI/hets_cgi.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ghc --make -package-conf /home/luettich/ghc-pkg/package.conf \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync -package WASH-CGI GUI/hets_cgi.hs -o hets.cgi $(HC_INCLUDE) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC_FLAGS) -O
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctaxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync###############################
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### TAGS files for (x)emacs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# load them with "M-x" "visit-tags-table" from
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# "HetCATS/hetcats/hetcats.TAGS"
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# use "M-." to search for a tag
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# !!Beware this is somewhat instable, because it uses an absolute path!!
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchetcats.TAGS: $(sources)
/home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
$(sources); mv TAGS $@; mv tags hetcats.tags
###############################
### count lines of code
count: $(sources)
wc -l $(sources)
###############################
### Documentation via haddock
doc: docs/index.html
# generate haddock documentation with links to sources
docs/index.html: $(doc_sources)
$(HADDOCK) $(doc_sources) $(uni_sources) -o docs -h -v \
-i docs/base.haddock -i docs/parsec.haddock -s ../ \
-t 'hets -- a heterogenous Specification (CASL) tool set'
# sources are not copied here
apache_doc:
$(RM) docs/*.*
cvs up -d
$(MAKE) hets-opt
$(MAKE) doc
$(MAKE) post_doc4apache
$(MAKE) hets.cgi
post_doc4apache:
$(PERL) utils/post_process_docs.pl docs \
'Common.Lib.Map.html:Common.Lib._Map.html'
cp docs/*.* a-docs/
###############################
### release management
derivedSources: $(derived_sources)
utils/DrIFT: $(DRIFT_deps)
(cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT && \
strip ../DrIFT)
utils/genRules: $(GENERATERULES_deps)
(cd utils/GenerateRules; \
$(HC) --make '-i../..:../DrIFT-src' -package text \
GenerateRules.hs -o ../genRules && strip ../genRules)
$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
$(HC) --make utils/InlineAxioms/InlineAxioms.hs \
$(HC_OPTS) -o $(INLINEAXIOMS)
strip $(INLINEAXIOMS)
release:
$(RM) -r HetCATS
cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository\
co HetCATS
$(RM) -r uni
ln -s ../uni uni
(cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
$(RM) clean.*; mv Makefile Makefile.orig; \
mv ReleaseMakefile Makefile)
tar cvf HetCATS.tar HetCATS
install-hets:
chmod g+w hets
cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
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)
### 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
%::
$(RM) hetcats-make