rules revision 9f85afecbd79b3df5a0bb17bd28cd0b288dc3213
a898afa0c41d5bdca1134dce14666fef3cfed666Andrew Forrest# Makefile
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# $Id$
a898afa0c41d5bdca1134dce14666fef3cfed666Andrew Forrest# Author: (c) Klaus Luettich, Christian Maeder, Uni Bremen 2002-2009
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
a898afa0c41d5bdca1134dce14666fef3cfed666Andrew Forrest# This Makefile will compile the hets system and provides also
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# targets for test programs during implementation phases.
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# !!! Note: This makefile is written for GNU make !!!
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# (gmake on solaris)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestall: hets
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestinclude var.mk
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# the 'replacing spaces' example was taken from the (GNU) Make info manual
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestempty =
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestspace = $(empty) $(empty)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestDRIFT_ENV = DERIVEPATH=$(subst $(space),:,$(PFE_PATHS))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestDRIFT_deps = utils/DrIFT-src/*hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGENITCORRECTIONS_deps = utils/itcor/GenItCorrections.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Common/Doc.hs CASL/ToDoc.hs Modal/AS_Modal.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Modal/Parse_AS.hs Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
887712849e5b2fb58199a680a47bb45bdaa6a0c6Gabor Melkvi
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPERL = perl
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHAPPY = happy -sga
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGENRULES = utils/genRules
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGENRULECALL = $(GENRULES) -r Typeable -r ShATermConvertible \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest -i Data.Typeable -i ATerm.Lib
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGENRULECALL2 = $(GENRULES) -r Typeable -r ShATermLG \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest -i Data.Typeable -i ATerm.Lib -i ATC.Grothendieck
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestDRIFT = utils/DrIFT
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestINLINEAXIOMS = utils/outlineAxioms
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHADDOCK = haddock
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestOSBYUNAME = $(shell uname)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestifneq ($(findstring SunOS, $(OSBYUNAME)),)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestTAR = gtar
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPATCH = gpatch
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestelse
af232c5bb9b46bae40e9141a10177dbf9bc6e376Jaco JoosteTAR = tar
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPATCH = patch
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestendif
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestARCH = $(subst $(space),,$(shell uname -m))
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestSETUP = utils/Setup
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestSETUPPREFIX = --prefix=$(HOME)/.ghc/$(ARCH)-$(OSBYUNAME)-hets-packages
5a7b89066fcba7cced4e980306cf91163ed79c3dAndrew Forrest
5a7b89066fcba7cced4e980306cf91163ed79c3dAndrew ForrestSETUPPACKAGE = ../$(SETUP) clean; \
5a7b89066fcba7cced4e980306cf91163ed79c3dAndrew Forrest ../$(SETUP) configure -O -p $(SETUPPREFIX) --user; \
5a7b89066fcba7cced4e980306cf91163ed79c3dAndrew Forrest ../$(SETUP) build; ../$(SETUP) haddock; ../$(SETUP) install --user
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# list glade files
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGTK_GLADE_FILES = $(wildcard GUI/Glade/*.glade)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGTK_GLADE_HSFILES = $(subst .glade,.hs,$(GTK_GLADE_FILES))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestderived_sources += $(GTK_GLADE_HSFILES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# the list of logics that need ShATermConvertible instances
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestlogics = CASL HasCASL Isabelle Modal Temporal CoCASL COL CspCASL CASL_DL \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest SoftFOL ConstraintCASL Propositional OWL RelationalScheme VSE OMDoc DFOL \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest LF Maude ExtModal
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestTESTTARGETFILES += CASL/fromKif.hs CASL/capa.hs HasCASL/hacapa.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Haskell/wrap.hs Isabelle/isa.hs Syntax/hetpa.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest ATC/ATCTest.hs ATC/ATCTest2.hs Common/ATerm/ATermLibTest.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Common/ATerm/ATermDiffMain.hs Common/annos.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest SoftFOL/tests/PrintTPTPTests.hs Comorphisms/test/showKP.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Comorphisms/test/sublogicGraph.hs PGIP/ParseProofScript.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest SoftFOL/dfg.hs GUI/displayDependencyGraph.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest### list of directories to run checks in
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestTESTDIRS += Common CASL HasCASL test
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forresths_clean_files = Haskell/TiATC.hs Haskell/TiDecorateATC.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Haskell/TiPropATC.hs Haskell/ATC_Haskell.der.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPFE_TOOLDIR = $(wildcard ../programatica/tools)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestifneq ($(strip $(PFE_TOOLDIR)),)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest base/parse2/LexerGen base/parse2/LexerSpec base/tests/HbcLibraries \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest base/transforms base/transforms/Deriving property \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest property/syntax property/AST property/transforms \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest property/TI property/defs property/parse2 property/parse2/Parser
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPFE_PATH = $(addprefix -i, $(PFE_PATHS))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forresthappy_files += $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestLEX_DIR = $(PFE_TOOLDIR)/base/parse2/Lexer
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestprogramatica_pkg: $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(LEX_DIR)/HsLex.hs $(SETUP)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest @if $(HCPKG) field programatica version; then \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest echo "of programatica package found"; else \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest ($(PATCH) -usNlp0 -d $(PFE_TOOLDIR) \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest -i `pwd`/Haskell/Programatica.patch || exit 0); \
c0f53aa89d68ce3e4df7e9af73c00b292c8cbfefAndrew Forrest cp -f utils/programatica.cabal ../programatica/tools; \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest cp -f $(SETUP) ../programatica/tools; \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest (cd ../programatica/tools; \
751a89ff3a7a62c4981ea2dad1b06c79a782a609Jaco Jooste ./Setup configure $(SETUPPREFIX); \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest ./Setup build; ./Setup install --user) fi
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest$(LEX_DIR)/HsLex.hs: $(LEX_DIR)Gen/HsLexerGen
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest echo "{-# OPTIONS -w #-}" > $@
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $< >> $@
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(LEX_DIR)/HsTokens.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(HC) --make -fno-monomorphism-restriction -O \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest -i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest -i$(PFE_TOOLDIR)/base/lib \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $@.hs -o $@
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestlogics += Haskell
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestderived_sources += Haskell/PreludeString.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestAPPENDPRELUDESTRING = utils/appendHaskellPreludeString \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Haskell/ProgramaticaPrelude.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest## rule for appendHaskellPreludeString
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHaskell/PreludeString.hs: Haskell/PreludeString.append.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(APPENDPRELUDESTRING)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(RM) $@
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(APPENDPRELUDESTRING) < $< > $@
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest chmod 444 $@
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestAst_Haskell_files = HsDeclStruct HsExpStruct HsFieldsStruct \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest HsGuardsStruct HsKindStruct HsPatStruct HsTypeStruct HsAssocStruct \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest HsModule HsName HsLiteral HsIdent
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest#files in base/TI/
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest#Ti_Haskell_files = TiTypes TiKinds TiDecorate TiInstanceDB
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest#Ti_Prop_files = property/TI/TiPropDecorate property/syntax/PropSyntaxRec
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestOther_PFE_files = property/AST/HsPropStruct base/defs/PNT \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest base/defs/UniqueNames base/Modules/TypedIds base/Modules/Ents \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest base/parse2/SourceNames base/syntax/SyntaxRec \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest property/syntax/PropSyntaxStruct
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHaskell_files = $(addsuffix .hs, \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(addprefix $(PFE_TOOLDIR)/, $(Other_PFE_files)))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest## rule for ATC generation
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHaskell/ATC_Haskell.der.hs: $(Haskell_files) $(GENRULES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(GENRULECALL) -i Haskell.BaseATC -o $@ $(Haskell_files)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forresths_der_files += $(hs_clean_files)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestTESTDIRS += ToHaskell
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestTESTTARGETFILES += Haskell/hana.hs Haskell/h2h.hs Haskell/h2hf.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestelse
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# unset this variable from var.mk because the programatica sources
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# are needed to created our sources!
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestPFE_FLAGS =
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestendif
5d761bd44dd209231a91b4155e640128b35d45cdGabor Melkvi# end of programatica stuff
5d761bd44dd209231a91b4155e640128b35d45cdGabor Melkvi
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestTESTTARGETS = Test.o $(subst .hs,,$(TESTTARGETFILES))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestGHCVERSION = $(shell ghc --numeric-version)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestifneq ($(findstring 12, $(GHCVERSION)),)
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestNO_BIND_WARNING = -fno-warn-unused-do-bind
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestendif
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHC_WARN = -Wall -fno-warn-orphans $(NO_BIND_WARNING)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestINCLUDE_PATH =
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHC_INCLUDE = $(addprefix -i, $(INCLUDE_PATH))
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# uncomment HC_PROF for profiling (and comment out packages in var.mk)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# call resulting binary with a final +RTS -p to get a file <binary>.prof
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# HC_PROF = -prof -auto-all -osuf p_o +RTS -K100m -RTS
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestHC_OPTS += $(HC_WARN) $(HC_INCLUDE) $(HC_PROF)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# -ddump-minimal-imports
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# uncomment the above line to generate .imports files for displayDependencyGraph
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# files generated by DriFT
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestdrifted_files = Common/AS_Annotation.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest CASL/AS_Basic_CASL.hs Modal/AS_Modal.hs \
98edafaa1060580ef39bce8710345d9fe25b5b04Jaco Jooste Syntax/AS_Structured.hs Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
5a7b89066fcba7cced4e980306cf91163ed79c3dAndrew Forrest Propositional/AS_BASIC_Propositional.hs \
5a7b89066fcba7cced4e980306cf91163ed79c3dAndrew Forrest CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest CASL_DL/AS_CASL_DL.hs OWL/ReadWrite.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest CspCASL/AS_CspCASL_Process.hs CspCASL/AS_CspCASL.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest RelationalScheme/AS.hs ATC/Grothendieck.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(gendrifted_files)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# files to extract data types from to generate ShATermConvertible instances
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestatc_files = Common/AS_Annotation.der.hs Common/DefaultMorphism.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Logic/Prover.hs Common/LibName.hs Common/ExtSign.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Common/Consistency.hs Common/ProofTree.hs Static/DevGraph.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Common/Id.hs Common/Result.hs Common/OrderedMap.hs \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest Common/Lib/Graph.hs
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# files generated by genRules as input for DriFT
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrestatc_der_files = $(foreach file, $(atc_files), \
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest ATC/$(basename $(basename $(notdir $(file)))).der.hs)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest# the rules to create ATC .der.hs file for DriFT
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestATC/Id.der.hs: Common/Id.hs $(GENRULES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(GENRULECALL) -o $@ $<
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
864e2a74d7dc5e572cd895466611cc57e3523083Andrew ForrestATC/Result.der.hs: Common/Result.hs $(GENRULES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(GENRULECALL) -i ATC.Id -o $@ $<
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestATC/OrderedMap.der.hs: Common/OrderedMap.hs $(GENRULES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(GENRULECALL) -o $@ $<
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestATC/Graph.der.hs: Common/Lib/Graph.hs $(GENRULES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(GENRULECALL) -o $@ $<
a898afa0c41d5bdca1134dce14666fef3cfed666Andrew Forrest
402cd5da45d9182b81c16a13c3568faf78701827Andrew ForrestATC/ProofTree.der.hs: Common/ProofTree.hs $(GENRULES)
402cd5da45d9182b81c16a13c3568faf78701827Andrew Forrest $(GENRULECALL) -o $@ $<
ATC/AS_Annotation.der.hs: Common/AS_Annotation.der.hs $(GENRULES)
$(GENRULECALL) -i ATC.Id -i Common.ATerm.ConvInstances -o $@ $<
ATC/Consistency.der.hs: Common/Consistency.hs $(GENRULES)
$(GENRULECALL) -x Common.Consistency.ConservativityChecker -o $@ $<
ATC/LibName.der.hs: Common/LibName.hs $(GENRULES)
$(GENRULECALL) -i ATC.Id -i Common.ATerm.ConvInstances -o $@ $<
ATC/ExtSign.der.hs: Common/ExtSign.hs $(GENRULES)
$(GENRULECALL) -i Common.ATerm.ConvInstances -o $@ $<
ATC/DefaultMorphism.der.hs: Common/DefaultMorphism.hs $(GENRULES)
$(GENRULECALL) -o $@ $<
ATC/AS_Structured.der.hs: Syntax/AS_Structured.der.hs $(GENRULES)
$(GENRULECALL2) -o $@ $<
ATC/AS_Architecture.der.hs: Syntax/AS_Architecture.der.hs $(GENRULES)
$(GENRULECALL2) -i ATC.AS_Structured -o $@ $<
ATC/AS_Library.der.hs: Syntax/AS_Library.der.hs $(GENRULES)
$(GENRULECALL2) -i ATC.AS_Architecture -i ATC.LibName -o $@ $<
ATC/GlobalAnnotations.der.hs: Common/GlobalAnnotations.hs $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -i ATC.Result -o $@ $<
ATC/Prover.der.hs: Logic/Prover.hs $(GENRULES)
$(GENRULECALL) -x Logic.Prover.ProverTemplate \
-x Logic.Prover.ConsChecker \
-i ATC.AS_Annotation -i ATC.OrderedMap -o $@ $<
ATC/DevGraph.der.hs: Static/DevGraph.hs $(GENRULES)
$(GENRULECALL2) -i ATC.LibName -i ATC.Consistency \
-i ATC.AS_Structured -o $@ $<
# ATC files for every logic
CASL_files = CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
CASL/AS_Basic_CASL.der.hs
HasCASL_files = Common/Prec.hs HasCASL/As.hs HasCASL/Le.hs HasCASL/Sublogic.hs
Isabelle_files = Isabelle/IsaSign.hs
Propositional_files = Propositional/Sign.hs Propositional/Morphism.hs \
Propositional/AS_BASIC_Propositional.hs Propositional/Symbol.hs \
Propositional/Sublogic.hs
RS_files = RelationalScheme/AS.hs RelationalScheme/Sign.hs
Modal_files = Modal/AS_Modal.hs Modal/ModalSign.hs
Temporal_files = Temporal/AS_BASIC_Temporal.hs Temporal/Sign.hs \
Temporal/Symbol.hs Temporal/Morphism.hs
ConstraintCASL_files = ConstraintCASL/AS_ConstraintCASL.hs
CoCASL_files = CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
COL_files = COL/AS_COL.hs COL/COLSign.hs
CspCASL_files = CspCASL/AS_CspCASL.hs CspCASL/AS_CspCASL_Process.hs \
CspCASL/SignCSP.hs CspCASL/Morphism.hs
CASL_DL_files = CASL_DL/AS_CASL_DL.hs CASL_DL/Sign.hs CASL_DL/Sublogics.hs
SoftFOL_files = SoftFOL/Sign.hs
OWL_files = OWL/Sign.hs OWL/Sublogic.hs OWL/Morphism.hs
VSE_files = VSE/As.hs
OMDoc_files = OMDoc/OMDocInterface.hs
DFOL_files = DFOL/AS_DFOL.hs DFOL/Sign.hs DFOL/Morphism.hs DFOL/Symbol.hs
LF_files = LF/Sign.hs LF/Morphism.hs
Maude_files = Maude/Sign.hs Maude/Morphism.hs Maude/Sentence.hs \
Maude/Symbol.hs Maude/AS_Maude.hs
ExtModal_files = ExtModal/AS_ExtModal.hs ExtModal/ExtModalSign.hs \
ExtModal/MorphismExtension.hs
# ATC DrIFT-rule generation for logics
CASL/ATC_CASL.der.hs: $(CASL_files) $(GENRULES)
$(GENRULECALL) -i ATC.GlobalAnnotations -o $@ $(CASL_files)
RelationalScheme/ATC_RelationalScheme.der.hs: $(RS_files) $(GENRULES)
$(GENRULECALL) -i ATC.GlobalAnnotations -o $@ $(RS_files)
Propositional/ATC_Propositional.der.hs: $(Propositional_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(Propositional_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) -o $@ $(Isabelle_files)
Modal/ATC_Modal.der.hs: $(Modal_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(Modal_files)
Temporal/ATC_Temporal.der.hs: $(Temporal_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(Temporal_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)
SoftFOL/ATC_SoftFOL.der.hs: $(SoftFOL_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(SoftFOL_files)
OWL/ATC_OWL.der.hs: $(OWL_files) $(GENRULES)
$(GENRULECALL) -i OWL.ReadWrite -o $@ $(OWL_files)
VSE/ATC_VSE.der.hs: $(VSE_files) $(GENRULES)
$(GENRULECALL) -x VSE.As.FoldRec -i CASL.ATC_CASL -o $@ $(VSE_files)
OMDoc/ATC_OMDoc.der.hs: $(OMDoc_files) $(GENRULES)
$(GENRULECALL) -i OMDoc.ATerm -o $@ $(OMDoc_files)
DFOL/ATC_DFOL.der.hs: $(DFOL_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(DFOL_files)
LF/ATC_LF.der.hs: $(LF_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(LF_files)
Maude/ATC_Maude.der.hs: $(Maude_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(Maude_files)
ExtModal/ATC_ExtModal.der.hs: $(ExtModal_files) $(GENRULES)
$(GENRULECALL) -i CASL.ATC_CASL -o $@ $(ExtModal_files)
# all ATC .der.hs files for all logics
atc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
generated_rule_files = $(atc_der_files) $(atc_logic_files)
# a rule to create all .der.hs files
genRules: $(generated_rule_files)
# the final ATC target files created by DriFT
gendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
# files to be processed by utils/InlineAxioms
inline_axiom_files = Comorphisms/Modal2CASL.hs CASL_DL/PredefinedSign.hs
gen_inline_axiom_files = $(patsubst %.hs,%.inline.hs, $(inline_axiom_files))
# all sources that need to be created before ghc can be called
derived_sources += $(drifted_files) Driver/Version.hs $(happy_files) \
$(inline_axiom_files) Modal/ModalSystems.hs $(hs_der_files)
####################################################################
### targets
.PHONY : all hets-opt hets-optimized clean o_clean clean_pretty \
real_clean bin_clean package_clean distclean packages \
programatica_pkg aterm_pkg maintainer-clean annos \
check capa hacapa h2h h2hf showKP clean_genRules genRules \
count doc fromKif derivedSources release cgi ghci build
.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
$(SETUP): utils/Setup.hs
$(HC) --make -O -o $@ $<
packages: aterm_pkg programatica_pkg
programatica_pkg:
aterm_sources = $(wildcard atermlib/src/ATerm/*.hs)
aterm_pkg: $(aterm_sources) $(SETUP)
@if $(HCPKG) field aterm version; then \
echo "of aterm package found"; else \
cp -f LICENSE.txt atermlib; \
cp -f LIZENZ.txt atermlib; \
cp -f utils/Setup.hs atermlib; \
cp -f $(SETUP) atermlib; \
(cd atermlib; $(SETUPPACKAGE)) fi
hets-opt:
$(MAKE) distclean
$(MAKE) derivedSources
$(MAKE) clean
$(MAKE) hets-optimized
hets-optimized: $(derived_sources)
$(HC) --make -O -o hets hets.hs $(HC_OPTS)
cgi:
$(MAKE) distclean
$(MAKE) derivedSources
$(MAKE) clean
$(MAKE) hets.cgi
hets.cgi: $(sources) GUI/hets_cgi.hs
ghc --make GUI/hets_cgi.hs -o $@ $(HC_OPTS) -O
hets_maintainers.txt: $(sources)
@echo 'File : Maintainer' > $@
@echo -n Generating $@ " "
@egrep -m 1 "Maintainer" $(sources) | \
sed -e 's/: *Maintainer *: */ : /' >> $@
@echo " done"
# count lines of code
count: $(sources)
wc -l $(sources)
# Documentation via haddock
doc: docs/index.html
HADDOCK_OPTS = $(addprefix --optghc=, $(HC_OPTS))
docs/index.html:
$(RM) -r docs
mkdir docs
$(HADDOCK) -o docs -h -v -s ../%F \
-t 'Hets - the Heterogeneous Tool Set' \
-p Hets-Haddock-Prologue.txt $(HADDOCK_OPTS) \
Syntax/ADoc.hs $(filter-out Test.hs, $(wildcard *.hs)) \
Static/ChangeGraph.hs
derivedSources: $(derived_sources)
$(DRIFT): $(DRIFT_deps)
(cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT)
$(GENRULES): $(DRIFT) $(GENERATERULES_deps)
(cd utils/GenerateRules; \
$(HC) --make -i../DrIFT-src -i../.. $(HC_WARN) \
GenerateRules.hs -o ../genRules)
# "-package hssource" for ghc-5.04.2
$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
$(HC) --make utils/InlineAxioms/InlineAxioms.hs $(HC_WARN) $(HC_PROF) \
-i../.. -o $(INLINEAXIOMS)
utils/appendHaskellPreludeString: utils/appendHaskellPreludeString.hs
$(HC) --make -o $@ $<
# release management
REV = trunk
release:
$(RM) -r Hets
svn co https://svn-agbkb.informatik.uni-bremen.de/Hets/$(REV) Hets
$(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 Hets; $(MAKE) derivedSources; $(MAKE) clean; \
cp Makefile Makefile.orig; \
cp ReleaseMakefile Makefile; \
./clean.sh; \
find . -name .svn -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
$(RM) clean.*; utils/replaceAllHeaders.sh)
$(TAR) cvf Hets.tar Hets
# Common/LaTeX_maps.hs generation
utils/genItCorrections: $(GENITCORRECTIONS_deps)
$(HC) --make -o $@ $<
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"
### clean up
clean_genRules:
$(RM) $(generated_rule_files) $(gendrifted_files) $(hspp_sources) \
$(hs_clean_files)
clean: bin_clean o_clean clean_pretty
### removes all *.o, *.hi and *.p_o files in all subdirectories
o_clean:
find . -name \*.o -o -name \*.hi -o -name \*.p_o \
-o -name \*.exe -o -name \*.exe.manifest | xargs $(RM)
### remove binaries
bin_clean:
$(RM) hets
$(RM) hets.cgi
$(RM) $(SETUP)
$(RM) $(TESTTARGETS)
clean_pretty:
$(RM) pretty/*.c.* pretty/*.h.* pretty/gen_it_* \
pretty/generated_words.tex
### additionally removes the library files
real_clean: clean
### clean user packages
package_clean:
$(HCPKG) unregister programatica --user || exit 0
$(HCPKG) unregister aterm --user || exit 0
### 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
maintainer-clean: distclean package_clean
$(RM) -r $(HOME)/.ghc/$(ARCH)-$(OSBYUNAME)-hets-packages
### interactive
ghci: $(derived_sources)
ghci $(HC_OPTS)
### build only, don't link
build: hets.hs packages
$(HC) --make -c $< $(HC_OPTS)
### Kif parser
fromKif: CASL/fromKif
### Annos parser
annos: Common/annos
### 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_OPTS)
### HasCASL to Haskell translation
h2h: Haskell/h2h
### test program to check the known provers
showKP: Comorphisms/test/showKP
### run tests in other directories
check: $(TESTTARGETS)
for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
## Preparing the version of Hets
Driver/Version.hs: Driver/Version.in version_nr
$(RM) $@
LANG=C $(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 to avoid 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): $(derived_sources)
## suffix rules
.SUFFIXES:
## rule for GHC
%: %.hs packages
$(HC) --make -o $@ $< $(HC_OPTS)
## rule for HAPPY
%.hs: %.y
$(HAPPY) -o $@.tmp $<
echo "{-# OPTIONS -w #-}" > $@
cat $@.tmp >> $@
$(RM) $@.tmp
## rule for DrIFT
%.hs: %.der.hs $(DRIFT)
$(RM) $@
($(DRIFT_ENV); export DERIVEPATH; $(DRIFT) $< > $@)
chmod 444 $@
## rule for inlineAxioms
%.hs: %.inline.hs $(INLINEAXIOMS)
$(RM) $@
$(INLINEAXIOMS) $< > $@
chmod 444 $@
## rule for cpp and haddock
%.hspp: %.hs
$(HC) -E -cpp -D__HADDOCK__ \
-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$@
## Rule to generate hs files from glade files. Needed for GTK
%.hs: %.glade utils/appendHaskellPreludeString \
GUI/Glade/Template.append.hs
b=`basename $< .glade`; \
cat GUI/Glade/Template.append.hs | sed "s/\%s/$$b/" | \
utils/appendHaskellPreludeString $< > $@
## generate the inline file for the predefined CASL_DL sign
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 $@
# Warning: Don't change the order of the depencies!!
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 $@
# directory for installers
INSTALLER_DIR = ../installers
ifeq ($(strip $(HETS_VERSION)),)
HETS_VERSION := `cat version_nr`
# or `date +%F`
endif
# prepare installer creation
initialize_installer:
mkdir -p $(INSTALLER_DIR)
sed "s/^\(HETS_VERSION =\).*/\1$(HETS_VERSION)/" Makefile.installer \
> $(INSTALLER_DIR)/Makefile
@echo Please do
@echo " -> cd $(INSTALLER_DIR)"
@echo " -> make"
@echo and wait until it is finished
# check out java parts for OWL
owl_java:
svn co \
https://owlapi.svn.sourceforge.net/svnroot/owlapi/owl1_1/trunk \
OWL/java/OwlApi
initialize_java: owl_java
ant -q init
java-libs:
ant -q java-libs
java-files:
ant -q java-files
java-clean:
ant -q java-clean