rules revision dfaa945ae8e570a57dad32b18732ac2c3982893c
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# Year: 2004
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# This Makefile will compile the new hetcats system and provides also
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# targets for test programs during implementation phases.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# !!! Note: This makefile is written for GNU make !!!
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# (gmake on solaris ; make on linux)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync####################################################################
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync## Some varibles, which control the compilation
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## 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# the 'replacing spaces' example was taken from the (GNU) Make info manual
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncspace:= $(empty) $(empty)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# override on commandline for other architectures
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDRIFT_deps = utils/DrIFT-src/*hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncINLINEAXIOMS_deps = utils/InlineAxioms/*hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHAPPY = happy
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDRIFT = $(DRIFT_ENV) utils/DrIFT
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHADDOCK = haddock
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
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHC_INCLUDE = -i$(INCLUDE_PATH)
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# 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 $(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)
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 property/pfe property/syntax property/AST property/transforms \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync property/TI property/defs property/parse2 property/parse2/Parser \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPFE_PATH = $(addprefix -i$(PFE_TOOLDIR)/, $(PFE_DIRS))
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
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
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHC_OPTS = $(HCI_OPTS) $(HC_PROF)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncDRIFT_OPTS = +RTS -K10m -RTS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### list of directories to run checks in
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncTESTDIRS = Common CASL HasCASL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync####################################################################
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync## sources for hetcats (semi - manually produced with a perl script)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncGHCMAKE_OUTPUT = $(wildcard hetcats-make)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncifneq ($(strip $(GHCMAKE_OUTPUT)),)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncSOURCE_PATHS = $(COMMON_LIB_PATH):$(CLEAN_PATH)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncsources = $(wildcard $(subst :,/*hs , $(SOURCE_PATHS))/*hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
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)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgenrule_header_files = $(wildcard ATC/*.header.hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncatc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncatc_der_files = $(foreach file, $(atc_files), \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ATC/$(basename $(basename $(notdir $(file)))).der.hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynclogics := CASL HasCASL Modal CoCASL COL CspCASL
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgenerated_rule_files = $(atc_der_files) $(atc_logic_files)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncinline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncgen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchappy_files =
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncderived_sources = $(drifted_files) $(happy_files) hetcats/Version.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(inline_axiom_files) Modal/ModalSystems.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# sources that have {-# OPTIONS -cpp #-}
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ./Proofs/Proofs.hs hets.hs ./CASL/CCC/FreeTypes.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ./Comorphisms/LogicList.hs ./Comorphisms/LogicGraph.hs \
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))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctax_objects = $(patsubst %.hs,%.o,$(tax_sources))
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.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets: $(sources) $(derived_sources)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) distclean
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) derivedSources
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) real_clean
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(MAKE) hets-optimized
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets-optimized: $(derived_sources)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynchets-old: $(objects)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) -o hets $(HC_OPTS) $(objects)
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
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctaxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync $(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync###############################
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync### TAGS files for (x)emacs
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# load them with "M-x" "visit-tags-table" from
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# use "M-." to search for a tag
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync# !!Beware this is somewhat instable, because it uses an absolute path!!
$(sources); mv TAGS $@; mv tags hetcats.tags
doc: docs/index.html
docs/index.html: $(doc_sources)
$(MAKE) hets.cgi
$(PERL) utils/post_process_docs.pl docs \
utils/DrIFT: $(DRIFT_deps)
utils/genRules: $(GENERATERULES_deps)
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules && strip ../genRules)
$(HC) --make utils/InlineAxioms/InlineAxioms.hs \
(cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
$(RM) clean.*; mv Makefile Makefile.orig; \
tar cvf HetCATS.tar HetCATS
cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
$(atc_der_files): $(atc_files) $(genrule_header_files) utils/genRules
utils/genRules -r $(rule) -o CASL $(CASL_files)
utils/genRules -r $(rule) -o HasCASL $(HasCASL_files)
utils/genRules -r $(rule) -o Modal $(Modal_files)
utils/genRules -r $(rule) -o CoCASL $(CoCASL_files)
utils/genRules -r $(rule) -o COL $(COL_files)
utils/genRules -r $(rule) -o CspCASL $(CspCASL_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 ;
$(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) Common/annos
$(RM) Haskell/Hatchet/hatch
$(RM) ToHaskell/translateAna
$(RM) Taxonomy/taxonomyTool
### also delete *.d.bak (dependency file backups)
(cd $$p ; $(RM) *.d *.d.bak) ; done
$(RM) hetcats-make sources_hetcats.mk
$(RM) hetcats/Version.hs
test_parser: Common/test_parser
capa: CASL/capa
hacapa: HasCASL/hacapa
hapa: Haskell/hapa
hana: Haskell/hana
hetpa: Syntax/hetpa.hs Syntax/*.hs
hetana: Static/hetana.hs Static/*.hs
atctest: ATC/ATCTest.hs ATC/*.hs
### ATerm.Lib test system
hetdg: GUI/hetdg.hs $(drifted_files) *.hs
## two hardcoded dependencies for a correct generation of Version.hs
%.hs: %.inline.hs $(INLINEAXIOMS)
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(PERL) utils/genTransMFormFunc.pl $< $@