Makefile revision b1f59a4ea7c96f4c03a4d7cfcb9c5e66871cfbbb
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen# Makefile
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen# $Header$
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2005
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# Year: 2004
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen# This Makefile will compile the new hets system and provides also
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen# targets for test programs during implementation phases.
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen# !!! Note: This makefile is written for GNU make !!!
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# (gmake on solaris)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainenall: patch hets
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen####################################################################
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen## Some varibles, which control the compilation
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo SirainenINCLUDE_PATH = hxt syb-generics haifa-lite/src hcl/src
8732bdd21579472feb40da8ffc99b8fd3b341417Timo SirainenHXT_PATHS = Data Data/Tree Data/Tree/NTree Data/Digest Text Text/XML \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen Text/XML/HXT Text/XML/HXT/IO Text/XML/HXT/DOM Text/XML/HXT/Arrow \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen Text/XML/HXT/XPath Text/XML/HXT/Validator Text/XML/HXT/Parser \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen Text/XML/HXT/RelaxNG Text/XML/HXT/ProtocolHandler Codec Codec/ASN1 \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Codec/Binary Codec/Encryption Codec/Encryption/RSA System Control \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Control/Arrow Control/Monad Network
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHAIFA_PATHS = Network Network/Server Org Org/W3 Org/W3/N2001 \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Org/Xmlsoap Org/Xmlsoap/Schemas Org/Xmlsoap/Schemas/Soap \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen Text Text/XML Text/XML/HXT Text/XML/Schema Text/XML/Schema/TypeMapper \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Text/XML/Serializer
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenCLEAN_PATH = . utils/itcor \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen utils utils/DrIFT-src utils/GenerateRules utils/InlineAxioms Common \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Common/Lib Common/ATerm Logic CASL CASL/CCC CASL/CompositionTable \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Syntax Static GUI HasCASL Haskell Modal CoCASL COL ConstraintCASL \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen CspCASL ATC Proofs Comorphisms Isabelle Driver \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Taxonomy CASL_DL SPASS OWL_DL OMDoc $(PFE_PATHS) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(addprefix hxt/, $(HXT_PATHS)) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen hcl/src/Data syb-generics/Data syb-generics/Data/Generics2 \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(addprefix haifa-lite/src/, $(HAIFA_PATHS))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# the 'replacing spaces' example was taken from the (GNU) Make info manual
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenempty =
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenspace = $(empty) $(empty)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen## set ghc imports properly for your system
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenGHC_IMPORTS = `$(HC) --print-libdir`/imports
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# import directories for ghc-5.04.2
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenGHC5 = $(GHC_IMPORTS)/base:$(GHC_IMPORTS)/haskell98
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenDRIFT_ENV = \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen DERIVEPATH=.:$(GHC_IMPORTS):$(GHC5):$(subst $(space),:,$(PFE_PATHS))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# override on commandline for other architectures
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenINSTALLDIR = \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenDRIFT_deps = utils/DrIFT-src/*hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenGENITCORRECTIONS_deps = utils/itcor/GenItCorrections.hs Common/Utils.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Common/Lib/Map.hs Common/Lib/Set.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Common/Doc.hs CASL/ToDoc.hs Modal/AS_Modal.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Modal/Parse_AS.hs Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHC = ghc
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenPERL = perl
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHAPPY = happy -sga
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenGENRULES = utils/genRules
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenGENRULECALL = $(GENRULES) -r Typeable -r ShATermConvertible \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen -i Common.DynamicUtils -i Common.ATerm.Lib
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenDRIFT = utils/DrIFT
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenINLINEAXIOMS = utils/outlineAxioms
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHADDOCK = haddock
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenCPPP = cpp
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# remove -fno-warn-orphans for older ghcs and add -ifgl
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHC_WARN = -Wall -fno-warn-orphans
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHC_FLAGS = -fcontext-stack60 \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(HC_WARN) -fglasgow-exts -fno-monomorphism-restriction \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen -fallow-overlapping-instances -fallow-undecidable-instances
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# -ddump-minimal-imports
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# flags also come in via ../uni/uni-package.conf
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# but added it here in case of compilation without uni
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHC_INCLUDE = $(addprefix -i, $(INCLUDE_PATH))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenlogics = CASL HasCASL Isabelle Modal CoCASL COL CspCASL CASL_DL SPASS \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen OWL_DL ConstraintCASL
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenTESTTARGETFILES += CASL/fromKif.hs CASL/capa.hs HasCASL/hacapa.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Haskell/wrap.hs Isabelle/isa.hs Syntax/hetpa.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen ATC/ATCTest.hs ATC/ATCTest2.hs Common/ATerm/ATermLibTest.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Common/ATerm/ATermDiffMain.hs Common/annos.hs Common/test_parser.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen SPASS/tests/PrintTPTPTests.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenUNI_PACKAGE_CONF = $(wildcard ../uni/uni-package.conf)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenifneq ($(strip $(UNI_PACKAGE_CONF)),)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen -package uni-server -DUNI_PACKAGE
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# some modules from uni for haddock
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# if uni/server is included also HaXml sources are needed
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenuni_dirs = ../uni/davinci ../uni/graphs ../uni/events \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen ../uni/reactor ../uni/util ../uni/posixutil
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenuni_sources = $(wildcard $(addsuffix /haddock/*.hs, $(uni_dirs))) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(wildcard ../uni/htk/haddock/*/*.hs)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenTESTTARGETFILES += OWL_DL/ToHaskellAS.hs Taxonomy/taxonomyTool.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenendif
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen### list of directories to run checks in
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenTESTDIRS += Common CASL HasCASL test
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenPFE_TOOLDIR = $(wildcard ../programatica/tools)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenifneq ($(strip $(PFE_TOOLDIR)),)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen base/parse2/LexerGen base/parse2/LexerSpec base/tests/HbcLibraries \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen base/transforms base/transforms/Deriving property \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen property/syntax property/AST property/transforms \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen property/TI property/defs property/parse2 property/parse2/Parser
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenPFE_PATH = $(addprefix -i, $(PFE_PATHS))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenhappy_files += $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenLEX_DIR = $(PFE_TOOLDIR)/base/parse2/Lexer
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenpatch: Haskell/Programatica.patch
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen patch -usNlp0 -d $(PFE_TOOLDIR) -i `pwd`/$< || exit 0
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen$(LEX_DIR)/HsLex.hs: $(LEX_DIR)Gen/HsLexerGen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen echo "{-# OPTIONS -w #-}" > $@
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $< >> $@
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(LEX_DIR)/HsTokens.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(HC) --make -O -package data \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen -i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen -i$(PFE_TOOLDIR)/base/lib \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $@.hs -o $@
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen strip $@
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenlogics += Haskell
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenderived_sources += Haskell/PreludeString.hs $(LEX_DIR)/HsLex.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(LEX_DIR)Gen/HsLexerGen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenutils/appendHaskellPreludeString: utils/appendHaskellPreludeString.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(HC) --make -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenAPPENDPRELUDESTRING = utils/appendHaskellPreludeString \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Haskell/ProgramaticaPrelude.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen## rule for appendHaskellPreludeString
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHaskell/PreludeString.hs: Haskell/PreludeString.append.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(APPENDPRELUDESTRING)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(APPENDPRELUDESTRING) < $< > $@
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen chmod 444 $@
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenAst_Haskell_files = HsDeclStruct HsExpStruct HsFieldsStruct \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen HsGuardsStruct HsKindStruct HsPatStruct HsTypeStruct HsAssocStruct \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen HsModule HsName HsLiteral HsIdent
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen#files in base/TI/
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen#Ti_Haskell_files = TiTypes TiKinds TiDecorate TiInstanceDB
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen#Ti_Prop_files = property/TI/TiPropDecorate property/syntax/PropSyntaxRec
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenOther_PFE_files = property/AST/HsPropStruct base/defs/PNT \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen base/defs/UniqueNames base/Modules/TypedIds base/Modules/Ents \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen base/parse2/SourceNames base/syntax/SyntaxRec \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen property/syntax/PropSyntaxStruct
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHaskell_files = $(addsuffix .hs, \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(addprefix $(PFE_TOOLDIR)/, $(Other_PFE_files)))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen## rule for ATC generation
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHaskell/ATC_Haskell.der.hs: $(Haskell_files) $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -i Haskell.BaseATC -o $@ $(Haskell_files)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenhs_der_files += Haskell/TiATC.hs Haskell/TiDecorateATC.hs Haskell/TiPropATC.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenTESTDIRS += ToHaskell Haskell/test
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenTESTTARGETFILES += Haskell/hana.hs Haskell/h2h.hs Haskell/h2hf.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenendif
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenTESTTARGETS = Test.o $(subst .hs,,$(TESTTARGETFILES))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen### Profiling (only for debugging)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen### Attention every module must be compiled with profiling or the linker
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen### cannot link the various .o files properly. So after switching on
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen### Profiling, do an 'gmake real_clean; gmake'
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen### Comment in the following line for switching on profiling.
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen#HC_PROF = -prof -auto-all -fignore-asserts
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHC_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS) $(HC_PROF) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen -DCASLEXTENSIONS
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen####################################################################
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen## sources for hets
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainennon_sources = Common/LaTeX_maps.svmono.hs CspCASL/Main.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Common/CaslLanguage.hs ./Test.hs Static/LogicStructured.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(wildcard syb-generics/Data/Generics2/*.hs) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen haifa-lite/src/Network/Server/HTTP.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(wildcard haifa-lite/src/Org/W3/N2001/*.hs) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(wildcard haifa-lite/src/Org/Xmlsoap/Schemas/Soap/*.hs) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(wildcard haifa-lite/src/Text/XML/*/*.hs)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenSOURCE_PATHS = $(CLEAN_PATH)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainensources = hets.hs $(filter-out $(non_sources), \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(wildcard $(addsuffix /[A-Z]*hs, $(SOURCE_PATHS))))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen#endif
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenobjects = $(sources:%.hs=%.o)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainendrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen HasCASL/As.hs ATC/DevGraph.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs CASL_DL/AS_CASL_DL.hs\
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen ConstraintCASL/AS_ConstraintCASL.hs\
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen $(gendrifted_files)
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainenatc_files = Common/AS_Annotation.der.hs Common/DefaultMorphism.hs \
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen Logic/Prover.hs #Common/Id.hs Common/Result.hs OWL_DL/AS.hs
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainenatc_der_files = $(foreach file, $(atc_files), \
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen ATC/$(basename $(basename $(notdir $(file)))).der.hs)
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo SirainenATC/Id.der.hs: Common/Id.hs $(GENRULES)
5c2d695acf9f95ae0dcdda89c4d2391ceda4d672Timo Sirainen $(GENRULECALL) -o $@ $<
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo SirainenATC/Result.der.hs: Common/Result.hs $(GENRULES)
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen $(GENRULECALL) -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenATC/AS_Annotation.der.hs: Common/AS_Annotation.der.hs $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenATC/DefaultMorphism.der.hs: Common/DefaultMorphism.hs $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenATC/AS_Structured.der.hs: Syntax/AS_Structured.der.hs $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -i ATC.AS_Annotation -i ATC.Grothendieck -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenATC/AS_Architecture.der.hs: Syntax/AS_Architecture.der.hs $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -i ATC.AS_Structured -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenATC/AS_Library.der.hs: Syntax/AS_Library.der.hs $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -i ATC.AS_Architecture -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenATC/GlobalAnnotations.der.hs: Common/GlobalAnnotations.hs $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -i ATC.AS_Annotation -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenATC/Prover.der.hs: Logic/Prover.hs $(GENRULES)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(GENRULECALL) -x ProverTemplate -i ATC.AS_Annotation -o $@ $<
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenCASL_files = CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen CASL/AS_Basic_CASL.der.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenHasCASL_files = Common/Prec.hs HasCASL/As.hs HasCASL/Le.hs HasCASL/Sublogic.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenIsabelle_files = Isabelle/IsaSign.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenModal_files = Modal/AS_Modal.hs Modal/ModalSign.hs
8732bdd21579472feb40da8ffc99b8fd3b341417Timo SirainenConstraintCASL_files = ConstraintCASL/AS_ConstraintCASL.hs
8732bdd21579472feb40da8ffc99b8fd3b341417Timo SirainenCoCASL_files = CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
94ba4820927b906b333e39445c1508a29387c3aaTimo SirainenCOL_files = COL/AS_COL.hs COL/COLSign.hs
8732bdd21579472feb40da8ffc99b8fd3b341417Timo SirainenCspCASL_files = CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo SirainenCASL_DL_files = CASL_DL/AS_CASL_DL.hs CASL_DL/Sign.hs
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo SirainenSPASS_files = SPASS/Sign.hs
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo SirainenOWL_DL_files = OWL_DL/Sign.hs
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainenatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainengenerated_rule_files = $(atc_der_files) $(atc_logic_files)
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainengendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Siraineninline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2CFOL.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Comorphisms/Modal2CASL.hs Comorphisms/CASL2TopSort.hs \
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen Comorphisms/CASL2SubCFOL.hs CASL_DL/PredefinedSign.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainengen_inline_axiom_files = $(patsubst %.hs,%.inline.hs, $(inline_axiom_files))
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenderived_sources += $(drifted_files) Driver/Version.hs $(happy_files) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen $(inline_axiom_files) Modal/ModalSystems.hs $(hs_der_files) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen OWL_DL/ReadWrite.hs ConstraintCASL/AS_ConstraintCASL.hs
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen# sources that have {-# OPTIONS -cpp #-}
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainencpp_sources = Common/DynamicUtils.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Common/Lib/Set.hs Common/Lib/Map.hs ATC/Set.hs\
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Isabelle/CreateTheories.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen SPASS/Logic_SPASS.hs GUI/Utils.hs Driver/WriteFn.hs \
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen Comorphisms/LogicList.hs Comorphisms/LogicGraph.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen Comorphisms/KnownProvers.hs hets.hs $(happy_files) \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen hxt/Text/XML/HXT/ProtocolHandler/ProtocolHandler.hs \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen OMDoc/HetsInterface.hs
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen# unused, remove when header files are gone
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainengenrule_header_files = $(wildcard ATC/*.header.hs)
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainennondoc_sources = $(wildcard utils/DrIFT-src/*.hs) \
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen $(wildcard utils/DrIFT-src/*.lhs) \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(wildcard utils/GenerateRules/*.hs) \
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainen $(wildcard utils/InlineAxioms/*.hs) \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(cpp_sources) $(pfe_sources) $(gen_inline_axiom_files) \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(genrule_header_files) $(generated_rule_files) \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hspp \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen Modal/GeneratePatterns.inline.hs \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen Haskell/PreludeString.append.hs Haskell/ProgramaticaPrelude.hs \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen SPASS/MathServCommunication.hs \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(patsubst %.hs, %.der.hs, $(drifted_files))
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenhspp_sources = $(patsubst %.hs, %.hspp, $(cpp_sources))
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen# this variable holds the modules that should be documented
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainendoc_sources = $(filter-out $(nondoc_sources), $(sources) $(hspp_sources))
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainentax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainentax_objects = $(patsubst %.hs, %.o, $(tax_sources))
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen####################################################################
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen### targets
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen.PHONY : all hets-opt hets-optimized clean o_clean clean_pretty \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen real_clean bin_clean distclean \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen check capa hacapa h2h h2hf clean_genRules genRules \
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen count doc apache_doc post_doc4apache fromKif \
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen derivedSources install_hets install release cgi patch ghci
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainenpatch:
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainenhets-opt:
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(MAKE) distclean
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(MAKE) derivedSources
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(MAKE) clean
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(MAKE) hets-optimized
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainenhets-optimized: $(derived_sources)
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(HC) --make -O -o hets hets.hs $(HC_OPTS)
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen strip hets
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainenhets-old: $(objects)
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(RM) $@
8732bdd21579472feb40da8ffc99b8fd3b341417Timo Sirainen $(HC) -o hets $(HC_OPTS) $(objects)
cdf294e5cceee81d58c8477c7c28d9ad6b55c36aTimo Sirainen
94ba4820927b906b333e39445c1508a29387c3aaTimo Sirainencgi:
$(MAKE) distclean
$(MAKE) derivedSources
$(MAKE) real_clean
$(MAKE) hets.cgi
hets.cgi: $(sources) GUI/hets_cgi.hs
ghc --make GUI/hets_cgi.hs -o $@ $(HC_INCLUDE) \
$(HC_FLAGS) $(PFE_FLAGS) -O
strip hets.cgi
###############################
### TAGS files for (x)emacs
# load them with "M-x" "visit-tags-table" from
# "HetCATS/hetcats.TAGS"
# use "M-." to search for a tag
# !!Beware this is somewhat instable, because it uses an absolute path!!
hetcats.TAGS: $(sources)
/home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
$(sources); mv TAGS $@; mv tags hetcats.tags
hets_maintainers.txt: $(sources)
@echo 'File : Maintainer' > $@
@echo -n Generating $@ " "
@$(PERL) -e \
'foreach my $$f (@ARGV) { open I, "<$$f"; \
print "$$f :"; while (<I>) \
{ if(m,^\s*Maintainer\s*:\s*(.*)$$,o) { \
print " $$1" ; last} }; print "\n"; close I; }' \
$(sources) >> $@
@echo " done"
###############################
### count lines of code
count: $(sources)
wc -l $(sources)
###############################
### Documentation via haddock
doc: docs/index.html
# generate haddock documentation with links to sources
# the interface treatment is stolen from uni/mk/suffix.mk
docs/index.html: $(doc_sources)
$(RM) -r docs
mkdir docs
cp -r ../uni/www docs/www || mkdir docs/www
HINTERFACES0=`find docs/www -name '*.haddock' \
-printf "--read-interface=www/%P,%p "` ; \
HINTERFACES=`echo $$HINTERFACES0 | \
$(PERL) -pe 's+/[^/]*.haddock,+,+g'` ; \
$(HADDOCK) -o docs -h -v -s ../%F $$HINTERFACES \
-t 'Hets - the Heterogeneous Tool Set' \
-p Hets-Haddock-Prologue.txt $(doc_sources)
# sources are not copied here
apache_doc:
$(RM) -r docs
cvs up -d ; echo "CVS exited with: " $$?
$(MAKE) hets-opt
$(MAKE) doc
$(MAKE) post_doc4apache
$(MAKE) o_clean
$(MAKE) hets.cgi
post_doc4apache:
$(RM) -r a-docs
cp -r docs a-docs
$(PERL) utils/post_process_docs.pl a-docs \
'Common.Lib.Map.html:Common.Lib._Map.html'
$(PERL) utils/post_process_docs.pl a-docs \
'Data.Map.html:Data._Map.html'
###############################
### release management
derivedSources: $(derived_sources) $(hspp_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 -i../.. $(HC_WARN) \
GenerateRules.hs -o ../genRules && strip ../genRules)
# "hssource" for ghc-5.04.2
$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
$(HC) --make utils/InlineAxioms/InlineAxioms.hs $(HC_WARN) $(HC_PROF) \
-package hssource -i../.. -o $(INLINEAXIOMS)
strip $(INLINEAXIOMS)
# set this variable from the command line to i,e. RELEASETAG='-r release-0-60'
RELEASETAG =
release:
$(RM) -r HetCATS
cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository\
co -P $(RELEASETAG) HetCATS
$(RM) -r uni
if [ -d ../uni ] ; then ln -s ../uni uni ; fi
$(RM) -r programatica
if [ -d ../programatica ] ; then \
mkdir programatica; \
ln -s ../../programatica/tools programatica/tools ; fi
(cd HetCATS; $(MAKE) derivedSources; $(MAKE) clean; \
cp Makefile Makefile.orig; \
cp ReleaseMakefile Makefile; \
./clean.sh; \
find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
$(RM) clean.*)
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
pack/install-%.jar: pack/install-%.xml pack/UserInputSpec-%.xml hets.in hets
## TODO: add more dependencies and use hets-opt
compile $< -b . -k standard -o $@
# compile $< -b . -k web -o $@
###################################
### Common/LaTeX_maps.hs generation
utils/genItCorrections: $(GENITCORRECTIONS_deps)
$(HC) --make -o $@ $<
strip $@
pretty/LaTeX_maps.hs: utils/words.pl utils/genItCorrections \
pretty/words.input pretty/fonts.input pretty/width-table.tex.templ
@echo -n "Generating pretty/LaTeX_maps.hs ... "
@(cd pretty >/dev/null; $(PERL) ../utils/words.pl > words.pl.log)
@(cd pretty >/dev/null; ../utils/genItCorrections \
gen_it_characters gen_it_words >> LaTeX_maps.hs)
@echo "ready"
@echo "please copy the file manually to Common"
#############################
### ATC DrIFT-rule generation
genRules: $(generated_rule_files)
CASL/ATC_CASL.der.hs: $(CASL_files) $(GENRULES)
$(GENRULECALL) -i ATC.GlobalAnnotations -o $@ $(CASL_files)
HasCASL/ATC_HasCASL.der.hs: $(HasCASL_files) $(GENRULES)
$(GENRULECALL) -i ATC.GlobalAnnotations -o $@ $(HasCASL_files)
Isabelle/ATC_Isabelle.der.hs: $(Isabelle_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(Isabelle_files)
Modal/ATC_Modal.der.hs: $(Modal_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(Modal_files)
ConstraintCASL/ATC_ConstraintCASL.der.hs: $(ConstraintCASL_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(ConstraintCASL_files)
CASL_DL/ATC_CASL_DL.der.hs: $(CASL_DL_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(CASL_DL_files)
CoCASL/ATC_CoCASL.der.hs: $(CoCASL_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(CoCASL_files)
COL/ATC_COL.der.hs: $(COL_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(COL_files)
CspCASL/ATC_CspCASL.der.hs: $(CspCASL_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(CspCASL_files)
SPASS/ATC_SPASS.der.hs: $(SPASS_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(SPASS_files)
OWL_DL/ATC_OWL_DL.der.hs: $(OWL_DL_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -i OWL_DL.ReadWrite \
-o $@ $(OWL_DL_files)
clean_genRules:
$(RM) $(generated_rule_files) $(gendrifted_files) $(hspp_sources) \
Haskell/ATC_Haskell.der.hs
###############
### clean up
clean: bin_clean o_clean clean_pretty
### removes *.hi and *.o in all include directories
o_clean:
for p in $(CLEAN_PATH) ; do \
(cd $$p ; $(RM) *.hi *.o) ; done
### remove binaries
bin_clean:
$(RM) hets
$(RM) hets.cgi
$(RM) showKP
$(RM) $(TESTTARGETS)
clean_pretty:
$(RM) pretty/*.c.* pretty/*.h.* pretty/gen_it_* \
pretty/generated_words.tex
### additionally removes the library files
real_clean: clean
### additionally removes generated files not in the CVS tree
distclean: clean clean_genRules
$(RM) $(derived_sources)
$(RM) Modal/GeneratePatterns.inline.hs utils/appendHaskellPreludeString
$(RM) utils/DrIFT utils/genRules $(INLINEAXIOMS)
$(RM) utils/genItCorrections pretty/LaTeX_maps.hs pretty/words.pl.log
####################################################################
### test targets
####################################################################
### interactive
ghci: $(derived_sources)
$(HC)i $(HC_OPTS)
### christian's target
### CASL parser
fromKif: CASL/fromKif
### CASL parser
capa: CASL/capa
### HasCASL parser
hacapa: HasCASL/hacapa
### Haskell analysis
hana: Haskell/hana
### Haskell to Isabelle-HOLCF translation
h2hf: Haskell/h2hf
Haskell/h2hf: Haskell/h2hf.hs Haskell/*.hs Isabelle/*.hs Common/*.hs \
Common/Lib/*.hs Comorphisms/*.hs
$(HC) -O --make -o $@ $< $(HC_FLAGS) $(PFE_FLAGS)
### HasCASL to Haskell translation
h2h: Haskell/h2h
### test program to check the known provers
showKP: Comorphisms/test/showKP.hs Comorphisms/*.hs Common/*.hs Logic/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### run tests in other directories
check: $(TESTTARGETS)
for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
####################################################################
## Preparing the version of HetCATS
Driver/Version.hs: Driver/Version.in version_nr
$(RM) $@
$(PERL) utils/build_version.pl version_nr < Driver/Version.in > $@
chmod 444 $@
## two hardcoded dependencies for a correct generation of Version.hs
Driver/Options.hs Driver/WriteFn.hs Driver/ReadFn.hs: Driver/Version.hs
hets.hs: Driver/Version.hs
ATC/DevGraph.hs: Static/DevGraph.hs
## two dependencies for avoidence of circular prerequisites
CASL_DEPENDENT_BINARIES= hets CASL/capa CASL/fromKif \
Common/annos Common/test_parser Comorphisms/test/showKP \
CspCASL/print_csp HasCASL/hacapa Haskell/h2h Haskell/h2hf \
Haskell/hana Haskell/wrap Isabelle/isa Syntax/hetpa
$(CASL_DEPENDENT_BINARIES): $(sources) $(derived_sources)
# CASL_DL/Logic.hs: CASL_DL/PredefinedSign.hs
####################################################################
## rules for DrIFT
.SUFFIXES:
%: %.hs
$(HC) --make -o $@ $< $(HC_OPTS)
%.hs: %.y
$(HAPPY) -o $@.tmp $<
echo "{-# OPTIONS -w #-}" > $@
cat $@.tmp >> $@
$(RM) $@.tmp
%.hs: %.der.hs $(DRIFT)
$(RM) $@
($(DRIFT_ENV); export DERIVEPATH; $(DRIFT) $< > $@)
chmod 444 $@
## rules for inlineAxioms
%.hs: %.inline.hs $(INLINEAXIOMS)
$(RM) $@
$(INLINEAXIOMS) $< > $@
chmod 444 $@
## rule for cpp and haddock
%.hspp: %.hs
$(HC) -E -cpp -DUNI_PACKAGE -DCASLEXTENSIONS -DPROGRAMATICA -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$@
## generate the inline file for the predefined CASL_DL sign
# Warning: Don't change the order of the depencies!!
CASL_DL/PredefinedSign.inline.hs: \
CASL_DL/PredefinedSign.inline.hs.in utils/appendHaskellPreludeString \
CASL_DL/PredDatatypes.het
$(RM) $@
utils/appendHaskellPreludeString CASL_DL/PredDatatypes.het \
< CASL_DL/PredefinedSign.inline.hs.in > $@
echo " )" >> $@
chmod 444 $@
CASL_DL/PredDatatypes.het: utils/transformLibAsBasicSpec.pl \
CASL_DL/Datatypes.het
$(RM) $@
$(PERL) $+ > $@
chmod 444 $@
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
# uses intransparently utils/outlineAxioms
Modal/ModalSystems.hs: Modal/GeneratePatterns.inline.hs.in \
utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(RM) $@
$(PERL) utils/genTransMFormFunc.pl $< $@
chmod 444 $@