Makefile revision 8c812cd83569e973f10cf69a342424ceabc07af9
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2005
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# This Makefile will compile the new hets system and provides also
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# targets for test programs during implementation phases.
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# !!! Note: This makefile is written for GNU make !!!
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff# (gmake on solaris)
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff####################################################################
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff## Some varibles, which control the compilation
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael GraffHAIFA_PATHS = Network Network/Server Org Org/W3 Org/W3/N2001 \
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff Org/Xmlsoap Org/Xmlsoap/Schemas Org/Xmlsoap/Schemas/Soap \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Text Text/XML Text/XML/HXT Text/XML/Schema Text/XML/Schema/TypeMapper \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff utils utils/DrIFT-src utils/GenerateRules utils/InlineAxioms Common \
7df0472d8a76c83d2137bd9549414a30787d58cfBrian Wellington Common/Lib Common/ATerm Logic CASL CASL/CCC CASL/CompositionTable \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff Syntax Static GUI HasCASL Haskell Modal CoCASL COL ConstraintCASL \
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff CspCASL ATC Proofs Comorphisms Isabelle Driver Modifications \
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael Graff Taxonomy CASL_DL SoftFOL OWL_DL OWL_DL/OWL11 OMDoc PGIP Propositional
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff# the 'replacing spaces' example was taken from the (GNU) Make info manual
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffDRIFT_ENV = DERIVEPATH=$(subst $(space),:,$(PFE_PATHS))
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff# override on commandline for other architectures
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffGENITCORRECTIONS_deps = utils/itcor/GenItCorrections.hs
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Common/Doc.hs CASL/ToDoc.hs Modal/AS_Modal.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Modal/Parse_AS.hs Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffGENRULECALL = $(GENRULES) -r Typeable -r ShATermConvertible \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffSETUPPREFIX = --prefix=$(HOME)/.ghc/$(ARCH)-$(OSBYUNAME)-hets-packages
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff ../$(SETUP) configure -p $(SETUPPREFIX) --user; \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff ../$(SETUP) build; ../$(SETUP) haddock; ../$(SETUP) install --user
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffHAXMLVERSION = $(shell $(HCPKG) field HaXml version)
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff# remove -fno-warn-orphans for older ghcs and add -ifgl
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff $(HC_WARN) -fglasgow-exts -fallow-overlapping-instances \
62e4837585f2d48ce9ef3ad6880d8fb75a578e58Andreas Gustafsson# -ddump-minimal-imports
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff# uncomment to above line to generate .imports files for displayDependencyGraph
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffHC_OPTS_MAC := $(if $(findstring Darwin,$(shell uname -s)), \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff -optl-F$(HOME)/Library/Frameworks -optl-framework -optlGNUreadline,)
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Grafflogics = CASL HasCASL Isabelle Modal CoCASL COL CspCASL CASL_DL SoftFOL \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffTESTTARGETFILES += CASL/fromKif.hs CASL/capa.hs HasCASL/hacapa.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Haskell/wrap.hs Isabelle/isa.hs Syntax/hetpa.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff ATC/ATCTest.hs ATC/ATCTest2.hs Common/ATerm/ATermLibTest.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Common/ATerm/ATermDiffMain.hs Common/annos.hs Common/test_parser.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff SoftFOL/tests/PrintTPTPTests.hs Comorphisms/test/showKP.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff SoftFOL/tests/soapTest.hs Comorphisms/test/sublogicGraph.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffUNI_PACKAGE_CONF = $(wildcard ../uni/uni-package.conf)
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael GraffHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff# some modules from uni for haddock
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff# if uni/server is included also HaXml sources are needed
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graffuni_dirs = ../uni/davinci ../uni/graphs ../uni/events \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffuni_sources = $(wildcard $(addsuffix /haddock/*.hs, $(uni_dirs))) \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael GraffTESTTARGETFILES += OWL_DL/ToHaskellAS.hs OWL_DL/OWL11/OWL11Parser.hs \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff Taxonomy/taxonomyTool.hs SoftFOL/tests/CMDL_tests.hs \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff### list of directories to run checks in
c05e003dce672b2f8555a3e56857f29ce89c1677Michael GraffTESTDIRS += Common CASL HasCASL test OWL_DL/java/test
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffhs_clean_files = Haskell/TiATC.hs Haskell/TiDecorateATC.hs \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff Haskell/TiPropATC.hs Haskell/ATC_Haskell.der.hs
c05e003dce672b2f8555a3e56857f29ce89c1677Michael GraffPFE_TOOLDIR = $(wildcard ../programatica/tools)
c05e003dce672b2f8555a3e56857f29ce89c1677Michael GraffPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff base/parse2/LexerGen base/parse2/LexerSpec base/tests/HbcLibraries \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff base/transforms base/transforms/Deriving property \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff property/syntax property/AST property/transforms \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff property/TI property/defs property/parse2 property/parse2/Parser
c05e003dce672b2f8555a3e56857f29ce89c1677Michael GraffPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
c05e003dce672b2f8555a3e56857f29ce89c1677Michael GraffPFE_FLAGS = -package programatica -DPROGRAMATICA
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffhappy_files += $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graffprogramatica_pkg: $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
c05e003dce672b2f8555a3e56857f29ce89c1677Michael Graff @if $(HCPKG) field programatica version; then \
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff echo "of programatica package found"; else \
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff -i `pwd`/Haskell/Programatica.patch || exit 0); \
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence cp -f utils/programatica.cabal ../programatica/tools; \
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff echo "{-# OPTIONS -w #-}" > $@
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
4e675038a097065ff13944232cd7c89ac5961984Michael Graff $(HC) --make -fno-monomorphism-restriction -O \
4e675038a097065ff13944232cd7c89ac5961984Michael Graff -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graffderived_sources += Haskell/PreludeString.hs $(LEX_DIR)/HsLex.hs \
291b0d910d115e41a4b69d0603c3376aebf0c630Michael Graffutils/appendHaskellPreludeString: utils/appendHaskellPreludeString.hs
291b0d910d115e41a4b69d0603c3376aebf0c630Michael GraffAPPENDPRELUDESTRING = utils/appendHaskellPreludeString \
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff## rule for appendHaskellPreludeString
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael GraffHaskell/PreludeString.hs: Haskell/PreludeString.append.hs \
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael GraffAst_Haskell_files = HsDeclStruct HsExpStruct HsFieldsStruct \
d736db6dc53e615e3f2d66d1ddbe28473694d107Michael Graff HsGuardsStruct HsKindStruct HsPatStruct HsTypeStruct HsAssocStruct \
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff#Ti_Haskell_files = TiTypes TiKinds TiDecorate TiInstanceDB
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff#Ti_Prop_files = property/TI/TiPropDecorate property/syntax/PropSyntaxRec
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael GraffOther_PFE_files = property/AST/HsPropStruct base/defs/PNT \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff base/defs/UniqueNames base/Modules/TypedIds base/Modules/Ents \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff base/parse2/SourceNames base/syntax/SyntaxRec \
e24f605ad64182532640dc6721070456b13112d5Michael Graff $(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
e24f605ad64182532640dc6721070456b13112d5Michael Graff $(addprefix $(PFE_TOOLDIR)/, $(Other_PFE_files)))
e24f605ad64182532640dc6721070456b13112d5Michael Graff## rule for ATC generation
e24f605ad64182532640dc6721070456b13112d5Michael GraffHaskell/ATC_Haskell.der.hs: $(Haskell_files) $(GENRULES)
e24f605ad64182532640dc6721070456b13112d5Michael Graff $(GENRULECALL) -i Haskell.BaseATC -o $@ $(Haskell_files)
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael GraffTESTTARGETFILES += Haskell/hana.hs Haskell/h2h.hs Haskell/h2hf.hs
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael GraffTESTTARGETS = Test.o $(subst .hs,,$(TESTTARGETFILES))
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff### Profiling (only for debugging)
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff### Attention every module must be compiled with profiling or the linker
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff### cannot link the various .o files properly. So after switching on
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff### Profiling, do an 'gmake real_clean; gmake'
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff### Comment in the following line for switching on profiling.
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff#HC_PROF = -prof -auto-all -fignore-asserts
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael GraffHC_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS) $(HC_PROF) \
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff####################################################################
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff## sources for hets
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffnon_sources = Common/LaTeX_maps.svmono.hs Common/CaslLanguage.hs ./Test.hs \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffsources = hets.hs $(filter-out $(non_sources), \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff $(wildcard $(addsuffix /[A-Z]*hs, $(SOURCE_PATHS))))
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graffdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs CASL_DL/AS_CASL_DL.hs\
74889a341cac183d477e15cfead391a8f7bdba95Michael Graffatc_files = Common/AS_Annotation.der.hs Common/DefaultMorphism.hs \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael Graff Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
74889a341cac183d477e15cfead391a8f7bdba95Michael Graff Logic/Prover.hs Common/ExtSign.hs Static/DevGraph.hs
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graffatc_der_files = $(foreach file, $(atc_files), \
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael Graff ATC/$(basename $(basename $(notdir $(file)))).der.hs)
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael GraffATC/Result.der.hs: Common/Result.hs $(GENRULES)
7dbf5a0b64237aa3052f04f4c8f7d56be8ec5d79Michael GraffATC/AS_Annotation.der.hs: Common/AS_Annotation.der.hs $(GENRULES)
74889a341cac183d477e15cfead391a8f7bdba95Michael GraffATC/ExtSign.der.hs: Common/ExtSign.hs $(GENRULES)
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffATC/DefaultMorphism.der.hs: Common/DefaultMorphism.hs $(GENRULES)
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffATC/AS_Structured.der.hs: Syntax/AS_Structured.der.hs $(GENRULES)
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff $(GENRULECALL) -i ATC.AS_Annotation -i ATC.Grothendieck -o $@ $<
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffATC/AS_Architecture.der.hs: Syntax/AS_Architecture.der.hs $(GENRULES)
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffATC/AS_Library.der.hs: Syntax/AS_Library.der.hs $(GENRULES)
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff $(GENRULECALL) -i ATC.AS_Architecture -o $@ $<
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffATC/GlobalAnnotations.der.hs: Common/GlobalAnnotations.hs $(GENRULES)
1a0e33bc2044e1902493111db14cbf793083ac47Michael Graff $(GENRULECALL) -x Logic.Prover.ProverTemplate \
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffATC/DevGraph.der.hs: Static/DevGraph.hs $(GENRULES)
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael Graff $(GENRULECALL) -i ATC.AS_Library -i ATC.Grothendieck -o $@ $<
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffCASL_files = CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
e24f605ad64182532640dc6721070456b13112d5Michael GraffHasCASL_files = Common/Prec.hs HasCASL/As.hs HasCASL/Le.hs HasCASL/Sublogic.hs
2311073ce0ef26c0250e91e4a083d7cc94fa7d33Michael GraffPropositional_files = Propositional/Sign.hs Propositional/Morphism.hs \
e4f074a2c2340ea80099beebecc3b89aa234fa8fMichael Graff Propositional/AS_BASIC_Propositional.hs Propositional/Symbol.hs \
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael GraffModal_files = Modal/AS_Modal.hs Modal/ModalSign.hs
ae7d0a4375abaecfd5c5b0816616d9882831e69bMichael GraffConstraintCASL_files = ConstraintCASL/AS_ConstraintCASL.hs
74889a341cac183d477e15cfead391a8f7bdba95Michael GraffCoCASL_files = CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
a3ab70dae26d009bf78b0594b2ab5eb9208f4b91Michael GraffCspCASL_files = CspCASL/AS_CspCASL.hs CspCASL/AS_CspCASL_Process.hs \
cpp_sources = \
$(wildcard utils/GenerateRules/*.hs) \
$(wildcard utils/InlineAxioms/*.hs) \
$(RM) $@
cgi:
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules && strip ../genRules)
-i../.. -o $(INLINEAXIOMS)
if [ -d ../programatica ] ; then \
./clean.sh; \
### Common/LaTeX_maps.hs generation
strip $@
@echo -n "Generating pretty/LaTeX_maps.hs ... "
@(cd pretty >/dev/null; ../utils/genItCorrections \
$(GENRULES)
-o $@ $(OWL_DL_files)
-o $@ $(OWL11_files)
$(RM) $@
## two hardcoded dependencies for a correct generation of Version.hs
.SUFFIXES:
%.hs: %.y
$(RM) $@
$(RM) $@
$(INLINEAXIOMS) $< > $@
%.d : %.hs
%.d : %.lhs
$(RM) $@
$(RM) $@
$(PERL) $+ > $@
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
# uses intransparently utils/outlineAxioms
$(RM) $@
@if [ -d $(INSTALLER_DIR) ] ; then \
sed "s/^\(SPASS_DIR_MAC=\).*/\1`ls utils/SPASS-ppc-mac/ | grep SPASS`/" Makefile.inst > Makefile.inst2 ;\
@echo Please do