Makefile revision 9e748851c150e1022fb952bab3315e869aaf0214
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Year: 2004
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# This Makefile will compile the new hetcats system and provides also
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# targets for test programs during implementation phases.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# !!! Note: This makefile is written for GNU make !!!
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# (gmake on solaris ; make on linux)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync####################################################################
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## Some varibles, which control the compilation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCOMMONLIB_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
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCLEAN_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)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync## set ghc imports properly for your system
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncLINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:${LINUX_IMPORTS}:${GHC_IMPORTS}'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# the 'replacing spaces' example was taken from the (GNU) Make info manual
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# override on commandline for other architectures
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncINSTALLDIR = /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -ddump-minimal-imports
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# flags also come in via ../uni/uni-package.conf
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# but added it here in case of compilation without uni
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncUNI_PACKAGE_CONF := $(wildcard ../uni/uni-package.conf)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# some modules from uni for haddock
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# if uni/server is included also HaXml sources are needed
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncuni_sources = $(wildcard ../uni/davinci/haddock/*.hs) \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync property/pfe property/syntax property/AST property/transforms \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync property/TI property/defs property/parse2 property/parse2/Parser \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPFE_PATH = $(addprefix -i$(PFE_TOOLDIR)/, $(PFE_DIRS))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# add PFE_PATHS to DERIVEPATH if needed
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# but name clashes currently prevent ATC generation in a single file
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPFE_PATHS = $(subst $(space),:,$(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS)))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncpfe_sources = $(wildcard $(subst :,/*hs , $(PFE_PATHS)))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync#-fallow-undecidable-instances -fno-monomorphism-restriction
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsync### Profiling (only for debugging)
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsync### Attention every module must be compiled with profiling or the linker
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsync### cannot link the various .o files properly. So after switching on
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsync### Profiling, do an 'gmake real_clean; gmake'
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsync### and comment out HC_PACKAGE variable definition above.
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsync### Comment in the following line for switching on profiling.
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsync#HC_PROF = -prof -auto-all
2b41f73e305b2cd1a4dadff538705a7a8fb63f02vboxsyncHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
3cb585d34a2e3df35c60e45e7182dde65f3a6c22vboxsync### list of directories to run checks in
3cb585d34a2e3df35c60e45e7182dde65f3a6c22vboxsync####################################################################
3cb585d34a2e3df35c60e45e7182dde65f3a6c22vboxsync## sources for hetcats (semi - manually produced with a perl script)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncsources = $(wildcard $(subst :,/*hs , $(SOURCE_PATHS))/*hs)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncatc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ATC/$(basename $(basename $(notdir $(file)))).der.hs)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
3cb585d34a2e3df35c60e45e7182dde65f3a6c22vboxsyncatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncgenerated_rule_files = $(atc_der_files) $(atc_logic_files)
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncgendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncinline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncgen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncderived_sources = $(drifted_files) $(happy_files) hetcats/Version.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# sources that have {-# OPTIONS -cpp #-}
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ./Proofs/Proofs.hs hets.hs ./CASL/CCC/FreeTypes.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ./Comorphisms/LogicList.hs ./Comorphisms/LogicGraph.hs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# this variable holds the modules that should be documented
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncdoc_sources = $(filter-out $(cpp_sources), $(filter-out $(pfe_sources), \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync $(sources))) $(patsubst %.hs, %.hspp, $(cpp_sources))
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsynctax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync####################################################################
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync.PHONY : all hets-opt hets-optimized clean d_clean real_clean bin_clean \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync lib_clean distclean check capa hacapa clean_genRules genRules \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync taxonomy hets.cgi count doc apache_doc post_doc4apache \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
$(RM) $@
$(HC_FLAGS) -O
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules && strip ../genRules)
gen_atc_files = \
### also delete *.d.bak (dependency file backups)
$(RM) $@
ghci:
$(RM) $@
$(RM) $@
$(RM) $@
$(happy_files)
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
### ATerm.Lib test system
$(RM) $@
$(RM) $@
## two hardcoded dependencies for a correct generation of Version.hs
.SUFFIXES:
$(HAPPY) $<
$(INLINEAXIOMS) $< > $@
%.d : %.hs
%.d : %.lhs
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation