rules revision 0e71596246d44e470c78cde3029c967b9f1e6734
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# Year: 2004
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# This Makefile will compile the new hetcats system and provides also
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# targets for test programs during implementation phases.
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# !!! Note: This makefile is written for GNU make !!!
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# (gmake on solaris ; make on linux)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim####################################################################
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim## Some varibles, which control the compilation
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimINCLUDE_PATH = ghc hetcats fgl hxt
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimCOMMONLIB_PATH = Common/Lib Common/ATerm fgl/Data/Graph \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim fgl/Data/Graph/Inductive fgl/Data/Graph/Inductive/Internal \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim fgl/Data/Graph/Inductive/Monad fgl/Data/Graph/Inductive/Query
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimCLEAN_PATH = . utils/DrIFT-src utils/GenerateRules utils/InlineAxioms Common \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim Logic CASL CASL/CCC Syntax Static GUI HasCASL Haskell Modal CoCASL COL \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim CspCASL ATC ToHaskell Proofs Comorphisms Isabelle $(INCLUDE_PATH) \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim Haskell/Hatchet Hatchet Taxonomy $(PFE_PATHS)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim## set ghc imports properly for your system
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimGHC_IMPORTS =`$(HC) --print-libdir`/imports
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimDRIFT_ENV = \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim DERIVEPATH=.:ghc:hetcats:$(GHC_IMPORTS):$(subst $(space),:,$(PFE_PATHS))
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# the 'replacing spaces' example was taken from the (GNU) Make info manual
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimspace:= $(empty) $(empty)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# override on commandline for other architectures
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimINSTALLDIR = \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimDRIFT_deps = utils/DrIFT-src/*hs
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimINLINEAXIOMS_deps = utils/InlineAxioms/*hs $(drifted_files)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimHAPPY = happy -sgca
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimHADDOCK = haddock
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimHC_FLAGS = -Wall -fglasgow-exts -fno-monomorphism-restriction \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim -fallow-overlapping-instances -fallow-undecidable-instances
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# -ddump-minimal-imports
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# flags also come in via ../uni/uni-package.conf
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# but added it here in case of compilation without uni
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimHC_INCLUDE = $(addprefix -i, $(INCLUDE_PATH))
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimUNI_PACKAGE_CONF := $(wildcard ../uni/uni-package.conf)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimifneq ($(strip $(UNI_PACKAGE_CONF)),)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim -package uni-server -DUNI_PACKAGE
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimlogics = CASL HasCASL Modal CoCASL COL CspCASL Hatchet
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# some modules from uni for haddock
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim# if uni/server is included also HaXml sources are needed
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimuni_dirs = ../uni/davinci ../uni/graphs ../uni/events \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimuni_sources = $(wildcard $(addsuffix /haddock/*.hs, $(uni_dirs))) \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim $(wildcard ../uni/htk/haddock/*/*.hs)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimPFE_TOOLDIR := $(wildcard ../programatica/tools)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimifneq ($(strip $(PFE_TOOLDIR)),)
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimPFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim base/transforms base/transforms/Deriving property \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim property/TI property/defs property/parse2 property/parse2/Parser
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimPFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimpfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimPFE_PATH = $(addprefix -i, $(PFE_PATHS))
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimPFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kimhappy_files = $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon KimLEX_DIR := $(PFE_TOOLDIR)/base/parse2/Lexer
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim $(HC) --make -O -package data \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim -i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim -i$(PFE_TOOLDIR)/base/lib \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
9e86db79b7d1bbc5f2f04e99954cbd5eae0e22bbHyon Kim $@.hs -o $@
derived_sources += Haskell/PreludeString.hs
APPENDPRELUDESTRING = utils/appendHaskellPreludeString \
$(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
happy_files += Haskell/Hatchet/HsParser.hs
TESTDIRS = Common CASL HasCASL Haskell/Hatchet/examples ToHaskell
#include sources_hetcats.mk
sources = hets.hs $(filter-out $(non_sources), \
genrule_header_files = $(wildcard ATC/*.header.hs)
ATC/$(basename $(basename $(notdir $(file)))).der.hs)
Hatchet_files := Haskell/Hatchet/AnnotatedHsSyn.hs \
atc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
gendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
gen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
derived_sources += $(drifted_files) hetcats/Version.hs $(happy_files) \
$(inline_axiom_files) Modal/ModalSystems.hs
cpp_sources = Isabelle/Logic_Isabelle.hs \
nondoc_sources = $(wildcard utils/DrIFT-src/*.hs) \
$(wildcard utils/DrIFT-src/*.lhs) \
$(wildcard utils/GenerateRules/*.hs) \
$(wildcard utils/InlineAxioms/*.hs) \
$(patsubst %.hs,%.der.hs,$(drifted_files))
#.PRECIOUS: sources_hetcats.mk
$(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
$(HC) --make -O -o hets hets.hs $(HC_OPTS) -w 2>&1 | tee hetcats-make
ghc --make -package-conf /home/luettich/ghc-pkg/package.conf \
strip hets.cgi
taxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
$(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
hetcats.TAGS: $(sources)
$(sources); mv TAGS $@; mv tags hetcats.tags
doc: docs/index.html
docs/index.html: $(doc_sources)
$(MAKE) hets.cgi
$(PERL) utils/post_process_docs.pl docs \
utils/DrIFT: $(DRIFT_deps)
utils/genRules: $(GENERATERULES_deps)
(cd utils/GenerateRules; \
GenerateRules.hs -o ../genRules && strip ../genRules)
$(HC) --make utils/InlineAxioms/InlineAxioms.hs \
$(MAKE) clean; ./clean.sh; \
$(RM) clean.*; mv Makefile Makefile.orig; \
tar cvf HetCATS.tar HetCATS
cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
$(atc_der_files): $(atc_files) $(genrule_header_files) utils/genRules
utils/genRules -r $(rule) -o CASL $(CASL_files)
utils/genRules -r $(rule) -o HasCASL $(HasCASL_files)
utils/genRules -r $(rule) -o Modal $(Modal_files)
utils/genRules -r $(rule) -o CoCASL $(CoCASL_files)
utils/genRules -r $(rule) -o COL $(COL_files)
utils/genRules -r $(rule) -o CspCASL $(CspCASL_files)
if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; \
then utils/genRules -r $(rule) -o ATC -h \
ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
else utils/genRules -r $(rule) -o ATC $(file); fi ;
$(RM) CASL/capa
$(RM) HasCASL/hacapa
$(RM) Haskell/hapa
$(RM) Haskell/hana
$(RM) Haskell/wrap
$(RM) ToHaskell/h2h
$(RM) Syntax/hetpa
$(RM) Static/hetana
$(RM) GUI/hetdg
$(RM) Common/annos
$(RM) Haskell/Hatchet/hatch
$(RM) ToHaskell/translateAna
$(RM) Taxonomy/taxonomyTool
### also delete *.d.bak (dependency file backups)
(cd $$p ; $(RM) *.d *.d.bak) ; done
$(RM) hetcats-make sources_hetcats.mk
test_parser: Common/test_parser
capa: CASL/capa
hacapa: HasCASL/hacapa
hana: Haskell/hana
h2h: ToHaskell/h2h
hetpa: Syntax/hetpa.hs Syntax/*.hs
hetana: Static/hetana.hs Static/*.hs
atctest: ATC/ATCTest.hs ATC/*.hs
### ATerm.Lib test system
hetdg: GUI/hetdg.hs $(drifted_files) *.hs
## two hardcoded dependencies for a correct generation of Version.hs
%.hs: %.inline.hs $(INLINEAXIOMS)
## rule for Modal/ModalSystems.hs needed for ModalLogic Translation
utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(PERL) utils/genTransMFormFunc.pl $< $@