Makefile revision fc436618ae33856afa329ee53c4f47a2e19100ee
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# Author: (c) Klaus Luettich, Christian Maeder, Uni Bremen 2002-2009
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# This Makefile will compile the hets system and provides also
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# targets for test programs during implementation phases.
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# !!! Note: This makefile is written for GNU make !!!
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# (gmake on solaris)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# the 'replacing spaces' example was taken from the (GNU) Make info manual
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschDRIFT_ENV = DERIVEPATH=$(subst $(space),:,$(PFE_PATHS))
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschGENITCORRECTIONS_deps = utils/itcor/GenItCorrections.hs
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Common/Doc.hs CASL/ToDoc.hs Modal/AS_Modal.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Modal/Parse_AS.hs Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschGENRULECALL = $(GENRULES) -r Typeable -r ShATermConvertible \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschGENRULECALL2 = $(GENRULES) -r Typeable -r ShATermLG \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch -i Data.Typeable -i ATerm.Lib -i ATC.Grothendieck
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschSETUPPREFIX = --prefix=$(HOME)/.ghc/$(ARCH)-$(OSBYUNAME)-hets-packages
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch ../$(SETUP) configure -O -p $(SETUPPREFIX) --user; \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch ../$(SETUP) build; ../$(SETUP) haddock; ../$(SETUP) install
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# list glade files
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschGTK_GLADE_FILES = $(wildcard GUI/Glade/*.glade)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschGTK_GLADE_HSFILES = $(subst .glade,.hs,$(GTK_GLADE_FILES))
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# the list of logics that need ShATermConvertible instances
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschlogics = CASL HasCASL Isabelle Modal Temporal CoCASL COL CspCASL CASL_DL \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch SoftFOL ConstraintCASL Propositional OWL RelationalScheme VSE OMDoc DFOL \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch LF Framework Maude ExtModal CommonLogic CSL QBF Adl HolLight
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschTESTTARGETFILES += CASL/fromKif.hs CASL/capa.hs HasCASL/hacapa.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Haskell/wrap.hs Isabelle/isa.hs Syntax/hetpa.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch ATC/ATCTest.hs ATC/ATCTest2.hs Common/ATerm/ATermLibTest.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Common/ATerm/ATermDiffMain.hs Common/annos.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch SoftFOL/tests/PrintTPTPTests.hs Comorphisms/test/showKP.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Comorphisms/test/sublogicGraph.hs PGIP/ParseProofScript.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch SoftFOL/dfg.hs Adl/adl.hs GUI/displayDependencyGraph.hs
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch### list of directories to run checks in
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschhs_clean_files = Haskell/TiATC.hs Haskell/TiDecorateATC.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Haskell/TiPropATC.hs Haskell/ATC_Haskell.der.hs
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch base/parse2/LexerGen base/parse2/LexerSpec base/tests/HbcLibraries \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch base/transforms base/transforms/Deriving property \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch property/syntax property/AST property/transforms \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch property/TI property/defs property/parse2 property/parse2/Parser
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschhappy_files += $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschprogramatica_pkg: $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch @if $(HCPKG) field programatica version; then \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch echo "of programatica package found"; else \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch -i `pwd`/Haskell/Programatica.patch || exit 0); \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch cp -f utils/programatica.cabal $(PFE_TOOLDIR); \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch echo "{-# OPTIONS -w #-}" > $@
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch $(HC) --make -fno-monomorphism-restriction -O \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschAPPENDPRELUDESTRING = utils/appendHaskellPreludeString \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch## rule for appendHaskellPreludeString
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschHaskell/PreludeString.hs: Haskell/PreludeString.append.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschAst_Haskell_files = HsDeclStruct HsExpStruct HsFieldsStruct \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch HsGuardsStruct HsKindStruct HsPatStruct HsTypeStruct HsAssocStruct \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch#Ti_Haskell_files = TiTypes TiKinds TiDecorate TiInstanceDB
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch#Ti_Prop_files = property/TI/TiPropDecorate property/syntax/PropSyntaxRec
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschOther_PFE_files = property/AST/HsPropStruct base/defs/PNT \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch base/defs/UniqueNames base/Modules/TypedIds base/Modules/Ents \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch base/parse2/SourceNames base/syntax/SyntaxRec \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch $(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch $(addprefix $(PFE_TOOLDIR)/, $(Other_PFE_files)))
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch## rule for ATC generation
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschHaskell/ATC_Haskell.der.hs: $(Haskell_files) $(GENRULES)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch $(GENRULECALL) -i Haskell.BaseATC -o $@ $(Haskell_files)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschTESTTARGETFILES += Haskell/hana.hs Haskell/h2h.hs Haskell/h2hf.hs
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# unset this variable from var.mk because the programatica sources
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# are needed to created our sources!
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# end of programatica stuff
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschTESTTARGETS = Test.o $(subst .hs,,$(TESTTARGETFILES))
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschNO_BIND_WARNING = -fno-warn-unused-do-bind -fno-warn-warnings-deprecations
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschHC_WARN = -Wall -fno-warn-orphans $(NO_BIND_WARNING)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# uncomment HC_PROF for profiling (and comment out packages in var.mk)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# call resulting binary with a final +RTS -p to get a file <binary>.prof
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# HC_PROF = -prof -auto-all -osuf p_o +RTS -K100m -RTS
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschHC_OPTS += $(HC_WARN) $(HC_INCLUDE) $(HC_PROF) $(HC_DEBIAN_OPT)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# -ddump-minimal-imports
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# uncomment the above line to generate .imports files for displayDependencyGraph
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# files generated by DriFT
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Syntax/AS_Structured.hs Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch CspCASL/AS_CspCASL_Process.hs CspCASL/AS_CspCASL.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# files to extract data types from to generate ShATermConvertible instances
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschatc_files = Common/AS_Annotation.der.hs Common/DefaultMorphism.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Common/Consistency.hs Common/ProofTree.hs Static/DevGraph.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch Common/Id.hs Common/Result.hs Common/OrderedMap.hs \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# files generated by genRules as input for DriFT
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Boschatc_der_files = $(foreach file, $(atc_files), \
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch ATC/$(basename $(basename $(notdir $(file)))).der.hs)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan Bosch# the rules to create ATC .der.hs file for DriFT
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschATC/Result.der.hs: Common/Result.hs $(GENRULES)
c502126b6e8a5d0c5431f0314b4d6eb0d43ab53dStephan BoschATC/OrderedMap.der.hs: Common/OrderedMap.hs $(GENRULES)
$(GENRULECALL) -o $@ $<
$(GENRULECALL) -o $@ $<
$(GENRULECALL) -o $@ $<
$(GENRULECALL2) -o $@ $<
# all ATC .der.hs files for all logics
# a rule to create all .der.hs files
# files to be processed by utils/InlineAxioms
cgi:
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules)
-i../.. -o $(INLINEAXIOMS)
./clean.sh; \
# Common/LaTeX_maps.hs generation
@echo -n "Generating pretty/LaTeX_maps.hs ... "
@(cd pretty >/dev/null; ../utils/genItCorrections \
$(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) $@
@echo Please do