rules revision 498aa48bdb931ab50990d3b74318a5db2312186c
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2005
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# Year: 2004
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# This Makefile will compile the new hets system and provides also
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# targets for test programs during implementation phases.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# !!! Note: This makefile is written for GNU make !!!
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# (gmake on solaris)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync####################################################################
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync## Some varibles, which control the compilation
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncINCLUDE_PATH =
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHAIFA_PATHS = Network Network/Server Org Org/W3 Org/W3/N2001 \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Org/Xmlsoap Org/Xmlsoap/Schemas Org/Xmlsoap/Schemas/Soap \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Text Text/XML Text/XML/HXT Text/XML/Schema Text/XML/Schema/TypeMapper \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncSOURCE_PATHS = . utils/itcor \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync utils utils/DrIFT-src utils/GenerateRules utils/InlineAxioms Common \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Common/Lib Common/ATerm Logic CASL CASL/CCC CASL/CompositionTable \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Syntax Static GUI HasCASL Haskell Modal CoCASL COL ConstraintCASL \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync CspCASL ATC Proofs Comorphisms Isabelle Driver Modifications \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Taxonomy CASL_DL SoftFOL OWL_DL OWL_DL/OWL11 OMDoc PGIP Propositional
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# the 'replacing spaces' example was taken from the (GNU) Make info manual
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncspace = $(empty) $(empty)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncDRIFT_ENV = DERIVEPATH=$(subst $(space),:,$(PFE_PATHS))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# override on commandline for other architectures
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncINSTALLDIR = \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncDRIFT_deps = utils/DrIFT-src/*hs
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncGENITCORRECTIONS_deps = utils/itcor/GenItCorrections.hs
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Modal/Parse_AS.hs Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHCPKG = ghc-pkg
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHAPPY = happy -sga
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncGENRULECALL = $(GENRULES) -r Typeable -r ShATermConvertible \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHADDOCK = haddock
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncOSBYUNAME = $(shell uname)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncifneq ($(findstring SunOS, $(OSBYUNAME)),)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncARCH = $(subst $(space),,$(shell uname -m))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncSETUPPREFIX = --prefix=$(HOME)/.ghc/$(ARCH)-$(OSBYUNAME)-hets-packages
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncSETUPPACKAGE = ../$(SETUP) clean; \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ../$(SETUP) configure -p $(SETUPPREFIX) --user; \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ../$(SETUP) build; ../$(SETUP) haddock; ../$(SETUP) install --user
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHAXMLVERSION = $(shell $(HCPKG) field HaXml version)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncifneq ($(findstring 1.13.2, $(HAXMLVERSION)),)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHAXML_PACKAGE = -package HaXml -DHAXML_PACKAGE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# remove -fno-warn-orphans for older ghcs and add -ifgl
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHC_WARN = -Wall -fno-warn-orphans
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHC_FLAGS = $(HAXML_PACKAGE) \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync $(HC_WARN) -fglasgow-exts -fallow-overlapping-instances \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# -ddump-minimal-imports
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# uncomment to above line to generate .imports files for displayDependencyGraph
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHC_OPTS_MAC := $(if $(findstring Darwin,$(shell uname -s)), \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync -optl-F$(HOME)/Library/Frameworks -optl-framework -optlGNUreadline,)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHC_INCLUDE = $(addprefix -i, $(INCLUDE_PATH))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynclogics = CASL HasCASL Isabelle Modal CoCASL COL CspCASL CASL_DL SoftFOL \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync OWL_DL ConstraintCASL Propositional
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncTESTTARGETFILES += CASL/fromKif.hs CASL/capa.hs HasCASL/hacapa.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ATC/ATCTest.hs ATC/ATCTest2.hs Common/ATerm/ATermLibTest.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Common/ATerm/ATermDiffMain.hs Common/annos.hs Common/test_parser.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync SoftFOL/tests/PrintTPTPTests.hs Comorphisms/test/showKP.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync SoftFOL/tests/soapTest.hs Comorphisms/test/sublogicGraph.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncUNI_PACKAGE_CONF = $(wildcard ../uni/uni-package.conf)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncifneq ($(strip $(UNI_PACKAGE_CONF)),)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync -package uni-server -DUNI_PACKAGE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# some modules from uni for haddock
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync# if uni/server is included also HaXml sources are needed
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncuni_dirs = ../uni/davinci ../uni/graphs ../uni/events \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncuni_sources = $(wildcard $(addsuffix /haddock/*.hs, $(uni_dirs))) \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync $(wildcard ../uni/htk/haddock/*/*.hs)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncTESTTARGETFILES += OWL_DL/ToHaskellAS.hs OWL_DL/OWL11/OWL11Parser.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Taxonomy/taxonomyTool.hs SoftFOL/tests/CMDL_tests.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync### list of directories to run checks in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncTESTDIRS += Common CASL HasCASL test
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynchs_clean_files = Haskell/TiATC.hs Haskell/TiDecorateATC.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPFE_TOOLDIR = $(wildcard ../programatica/tools)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncifneq ($(strip $(PFE_TOOLDIR)),)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync base/parse2/LexerGen base/parse2/LexerSpec base/tests/HbcLibraries \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync base/transforms base/transforms/Deriving property \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync property/TI property/defs property/parse2 property/parse2/Parser
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPFE_PATH = $(addprefix -i, $(PFE_PATHS))
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPFE_FLAGS = -package programatica -DPROGRAMATICA
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynchappy_files += $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncLEX_DIR = $(PFE_TOOLDIR)/base/parse2/Lexer
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncprogramatica_pkg: $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync $(LEX_DIR)/HsLex.hs $(SETUP)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync @if $(HCPKG) field programatica version; then \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync echo "of programatica package found"; else \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync (patch -usNlp0 -d $(PFE_TOOLDIR) \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync -i `pwd`/Haskell/Programatica.patch || exit 0); \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync cp -f utils/programatica.cabal ../programatica/tools; \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync cp -f $(SETUP) ../programatica/tools; \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ./Setup configure $(SETUPPREFIX); \
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ./Setup build; ./Setup install --user) fi
$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
$(LEX_DIR)/HsTokens.hs
-i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
-i$(PFE_TOOLDIR)/base/lib \
$(LEX_DIR)Gen/HsLexerGen
APPENDPRELUDESTRING = utils/appendHaskellPreludeString \
#files in base/TI/
$(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
Haskell/ATC_Haskell.der.hs: $(Haskell_files) $(GENRULES)
$(GENRULECALL) -i Haskell.BaseATC -o $@ $(Haskell_files)
TESTTARGETS = Test.o $(subst .hs,,$(TESTTARGETFILES))
sources = hets.hs $(filter-out $(non_sources), \
ATC/$(basename $(basename $(notdir $(file)))).der.hs)
$(GENRULECALL) -i ATC.AS_Structured -o $@ $<
$(GENRULECALL) -i ATC.AS_Architecture -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
OWL_DL_files = OWL_DL/Sign.hs
OWL11_files= OWL_DL/OWL11/Sign.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) \
$(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hspp \
$(patsubst %.hs, %.der.hs, $(drifted_files))
$(SETUP): utils/Setup.hs
http_pkg: utils/http.tgz $(SETUP)
$(TAR) zxf utils/http.tgz; \
shellac_pkg: utils/shellac.tgz $(SETUP)
$(TAR) zxf utils/shellac.tgz; \
shread_pkg: utils/shread.tgz $(SETUP) shellac_pkg
$(TAR) zxf utils/shread.tgz; \
$(TAR) zxf utils/hxt.tgz; \
$(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 \
utils/DrIFT: $(DRIFT_deps)
utils/genRules: $(GENERATERULES_deps)
(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)
Propositional/ATC_Propositional.der.hs: $(Propositional_files) \
$(GENRULECALL) -i ATC.GlobalAnnotations -o $@ \
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)
SoftFOL/ATC_SoftFOL.der.hs: $(SoftFOL_files) $(GENRULES)
$(GENRULECALL) -i ATC.AS_Annotation -o $@ $(SoftFOL_files)
OWL_DL/ATC_OWL_DL.der.hs: $(OWL_DL_files) $(GENRULES)
OWL_DL/OWL11/ATC_OWL11.der.hs: $(OWL11_files) $(GENRULES)
$(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)
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
# uses intransparently utils/outlineAxioms
utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(PERL) utils/genTransMFormFunc.pl $< $@
sed "s/^\(SPASS_DIR_MAC=\).*/\1`ls utils/SPASS-ppc-mac/ | grep SPASS`/" Makefile.inst > Makefile.inst2 ;\
rm Makefile.inst ;\
mv Makefile.inst2 $(INSTALLER_DIR)/Makefile ;\