rules revision 5db0bfca8a3cd5d5f487ad70524bd6ec49fb439f
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2005
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Year: 2004
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# This Makefile will compile the new hets system and provides also
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# targets for test programs during implementation phases.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# !!! Note: This makefile is written for GNU make !!!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# (gmake on solaris)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin####################################################################
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin## Some varibles, which control the compilation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHAIFA_PATHS = Network Network/Server Org Org/W3 Org/W3/N2001 \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Org/Xmlsoap Org/Xmlsoap/Schemas Org/Xmlsoap/Schemas/Soap \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Text Text/XML Text/XML/HXT Text/XML/Schema Text/XML/Schema/TypeMapper \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinSOURCE_PATHS = . utils/itcor \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin utils utils/DrIFT-src utils/GenerateRules utils/InlineAxioms Common \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Common/Lib Common/ATerm Logic CASL CASL/CCC CASL/CompositionTable \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Syntax Static GUI HasCASL Haskell Modal CoCASL COL ConstraintCASL \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CspCASL ATC Proofs Comorphisms Isabelle Driver Modifications \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Taxonomy CASL_DL SoftFOL OWL OMDoc PGIP Propositional RelationalScheme \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin VSE Interfaces
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# the 'replacing spaces' example was taken from the (GNU) Make info manual
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinspace = $(empty) $(empty)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDRIFT_ENV = DERIVEPATH=$(subst $(space),:,$(PFE_PATHS))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# override on commandline for other architectures
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinINSTALLDIR = \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinDRIFT_deps = utils/DrIFT-src/*hs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinGENITCORRECTIONS_deps = utils/itcor/GenItCorrections.hs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Modal/Parse_AS.hs Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPERL = perl
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHAPPY = happy -sga
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinGENRULECALL = $(GENRULES) -r Typeable -r ShATermConvertible \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHADDOCK = haddock
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinOSBYUNAME = $(shell uname)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(findstring SunOS, $(OSBYUNAME)),)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPATCH = gpatch
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPATCH = patch
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinARCH = $(subst $(space),,$(shell uname -m))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinSETUPPREFIX = --prefix=$(HOME)/.ghc/$(ARCH)-$(OSBYUNAME)-hets-packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinSETUPPACKAGE = ../$(SETUP) clean; \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ../$(SETUP) configure $(SETUPPREFIX) --user; \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ../$(SETUP) build; ../$(SETUP) haddock; ../$(SETUP) install --user
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# list glade files
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinGTK_GLADE_FILES = $(wildcard GUI/Glade/*.glade)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinGTK_GLADE_HSFILES = $(subst .glade,.hs,$(GTK_GLADE_FILES))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinderived_sources += $(GTK_GLADE_HSFILES)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinlogics = CASL HasCASL Isabelle Modal CoCASL COL CspCASL CASL_DL SoftFOL \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ConstraintCASL Propositional OWL RelationalScheme VSE OMDoc
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinTESTTARGETFILES += CASL/fromKif.hs CASL/capa.hs HasCASL/hacapa.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ATC/ATCTest.hs ATC/ATCTest2.hs Common/ATerm/ATermLibTest.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Common/ATerm/ATermDiffMain.hs Common/annos.hs Common/test_parser.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SoftFOL/tests/PrintTPTPTests.hs Comorphisms/test/showKP.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SoftFOL/tests/soapTest.hs Comorphisms/test/sublogicGraph.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin### list of directories to run checks in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinTESTDIRS += Common CASL HasCASL test
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinhs_clean_files = Haskell/TiATC.hs Haskell/TiDecorateATC.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPFE_TOOLDIR = $(wildcard ../programatica/tools)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifneq ($(strip $(PFE_TOOLDIR)),)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin base/parse2/LexerGen base/parse2/LexerSpec base/tests/HbcLibraries \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin property/TI property/defs property/parse2 property/parse2/Parser
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPFE_PATH = $(addprefix -i, $(PFE_PATHS))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinhappy_files += $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinLEX_DIR = $(PFE_TOOLDIR)/base/parse2/Lexer
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprogramatica_pkg: $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(LEX_DIR)/HsLex.hs $(SETUP)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin @if $(HCPKG) field programatica version; then \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "of programatica package found"; else \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ($(PATCH) -usNlp0 -d $(PFE_TOOLDIR) \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -i `pwd`/Haskell/Programatica.patch || exit 0); \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin cp -f utils/programatica.cabal ../programatica/tools; \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin cp -f $(SETUP) ../programatica/tools; \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ./Setup configure $(SETUPPREFIX); \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ./Setup build; ./Setup install --user) fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "{-# OPTIONS -w #-}" > $@
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(HC) --make -fno-monomorphism-restriction -O \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -i$(PFE_TOOLDIR)/base/lib \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $@.hs -o $@
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinlogics += Haskell
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinderived_sources += Haskell/PreludeString.hs $(LEX_DIR)/HsLex.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinAPPENDPRELUDESTRING = utils/appendHaskellPreludeString \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin## rule for appendHaskellPreludeString
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHaskell/PreludeString.hs: Haskell/PreludeString.append.hs \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(APPENDPRELUDESTRING)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(APPENDPRELUDESTRING) < $< > $@
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin chmod 444 $@
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinAst_Haskell_files = HsDeclStruct HsExpStruct HsFieldsStruct \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin HsGuardsStruct HsKindStruct HsPatStruct HsTypeStruct HsAssocStruct \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin HsModule HsName HsLiteral HsIdent
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#Ti_Haskell_files = TiTypes TiKinds TiDecorate TiInstanceDB
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#Ti_Prop_files = property/TI/TiPropDecorate property/syntax/PropSyntaxRec
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinOther_PFE_files = property/AST/HsPropStruct base/defs/PNT \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin base/defs/UniqueNames base/Modules/TypedIds base/Modules/Ents \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHaskell_files = $(addsuffix .hs, \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(addprefix $(PFE_TOOLDIR)/, $(Other_PFE_files)))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin## rule for ATC generation
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHaskell/ATC_Haskell.der.hs: $(Haskell_files) $(GENRULES)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $(GENRULECALL) -i Haskell.BaseATC -o $@ $(Haskell_files)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinhs_der_files += $(hs_clean_files)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinTESTDIRS += ToHaskell
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinTESTTARGETFILES += Haskell/hana.hs Haskell/h2h.hs Haskell/h2hf.hs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinPFE_FLAGS =
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinTESTTARGETS = Test.o $(subst .hs,,$(TESTTARGETFILES))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# remove -fno-warn-orphans for older ghcs and add -ifgl
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHC_WARN = -Wall -fno-warn-orphans
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# INCLUDE_PATH =
sources = hets.hs $(filter-out $(non_sources), \
drifted_files = Common/AS_Annotation.hs \
ATC/$(basename $(basename $(notdir $(file)))).der.hs)
$(GENRULECALL) -i ATC.AS_Structured -o $@ $<
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $<
$(GENRULECALL) -x Logic.Prover.ProverTemplate \
-i ATC.AS_Annotation -o $@ $<
Isabelle_files = Isabelle/IsaSign.hs
ConstraintCASL_files = ConstraintCASL/AS_ConstraintCASL.hs
SoftFOL_files = SoftFOL/Sign.hs
VSE_files = VSE/As.hs
OMDoc_files = OMDoc/OMDocInterface.hs
atc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
gendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
inline_axiom_files = Comorphisms/CASL2PCFOL.hs \
gen_inline_axiom_files = $(patsubst %.hs,%.inline.hs, $(inline_axiom_files))
derived_sources += $(drifted_files) Driver/Version.hs $(happy_files) \
$(inline_axiom_files) Modal/ModalSystems.hs $(hs_der_files)
genrule_header_files = $(wildcard ATC/*.header.hs)
nondoc_sources = $(wildcard utils/DrIFT-src/*.hs) \
$(wildcard utils/DrIFT-src/*.lhs) \
$(wildcard utils/GenerateRules/*.hs) \
$(wildcard utils/InlineAxioms/*.hs) \
$(wildcard utils/itcor/*.hs) \
$(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hspp \
$(patsubst %.hs, %.der.hs, $(drifted_files))
$(SETUP): utils/Setup.hs
$(HC) --make -O -o hets hets.hs $(HC_OPTS)
$(MAKE) hets.cgi
ghc --make GUI/hets_cgi.hs -o $@ $(HC_OPTS) -O
strip hets.cgi
hets_maintainers.txt: $(sources)
doc: docs/index.html
# the interface treatment is stolen from uni/mk/suffix.mk
docs/index.html: $(doc_sources)
HINTERFACES0=`find -L docs/www -name '*.haddock' \
-p Hets-Haddock-Prologue.txt $(doc_sources)
$(MAKE) hets.cgi
$(PERL) utils/post_process_docs.pl a-docs \
$(PERL) utils/post_process_docs.pl a-docs \
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules && strip ../genRules)
$(HC) --make utils/InlineAxioms/InlineAxioms.hs $(HC_WARN) $(HC_PROF) \
svn co https://svn-agbkb.informatik.uni-bremen.de/Hets/$(REV) Hets
cp Makefile Makefile.orig; \
./clean.sh; \
$(RM) clean.*; utils/replaceAllHeaders.sh)
$(TAR) cvf Hets.tar Hets
cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
### Common/LaTeX_maps.hs generation
utils/genItCorrections: $(GENITCORRECTIONS_deps)
@echo -n "Generating pretty/LaTeX_maps.hs ... "
gen_it_characters gen_it_words >> LaTeX_maps.hs)
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)
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)
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)
OMDoc/ATC_OMDoc.der.hs: $(OMDoc_files) $(GENRULES)
$(GENRULECALL) -i OMDoc.ATerm -o $@ $(OMDoc_files)
$(RM) hets.cgi
$(RM) pretty/*.c.* pretty/*.h.* pretty/gen_it_* \
fromKif: CASL/fromKif
annos: Common/annos
capa: CASL/capa
hacapa: HasCASL/hacapa
hana: Haskell/hana
h2hf: Haskell/h2hf
Common/Lib/*.hs Comorphisms/*.hs
h2h: Haskell/h2h
showKP: Comorphisms/test/showKP
LANG=C $(PERL) utils/build_version.pl version_nr \
< Driver/Version.in > $@
## two hardcoded dependencies for a correct generation of Version.hs
%.hs: %.der.hs $(DRIFT)
%.hs: %.inline.hs $(INLINEAXIOMS)
%.hs: %.glade utils/appendHaskellPreludeString \
cat GUI/Glade/Template.append.hs | sed "s/\%s/$$b/" | \
utils/appendHaskellPreludeString $< > $@
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
# uses intransparently utils/outlineAxioms
utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(PERL) utils/genTransMFormFunc.pl $< $@
sed "s/^\(HETS_VERSION =\).*/\1$(HETS_VERSION)/" Makefile.installer \