Makefile revision b7e6a2daa94ea6370ad121a7b72495dc4d8e6749
2N/A# Makefile
2N/A# $Header$
2N/A# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
2N/A# Year: 2004
2N/A
2N/A# This Makefile will compile the new hets system and provides also
2N/A# targets for test programs during implementation phases.
2N/A
2N/A# !!! Note: This makefile is written for GNU make !!!
2N/A# (gmake on solaris)
2N/A
2N/Aall: hets
2N/A
2N/A####################################################################
2N/A## Some varibles, which control the compilation
2N/A
2N/AINCLUDE_PATH = ghc fgl hxt
2N/ACOMMONLIB_PATH = Common/Lib Common/ATerm fgl/Data/Graph \
2N/A fgl/Data/Graph/Inductive fgl/Data/Graph/Inductive/Internal \
2N/A fgl/Data/Graph/Inductive/Monad fgl/Data/Graph/Inductive/Query
2N/ACLEAN_PATH = . utils/DrIFT-src utils/GenerateRules utils/InlineAxioms Common \
2N/A Logic CASL CASL/CCC Syntax Static GUI HasCASL Haskell Modal CoCASL COL \
2N/A CspCASL ATC ToHaskell Proofs Comorphisms Isabelle Driver $(INCLUDE_PATH) \
2N/A Haskell/Hatchet Hatchet Taxonomy $(PFE_PATHS)
2N/A
2N/A## set ghc imports properly for your system
2N/AGHC_IMPORTS =`$(HC) --print-libdir`/imports
2N/ADRIFT_ENV = \
2N/A DERIVEPATH=.:ghc:$(GHC_IMPORTS):$(subst $(space),:,$(PFE_PATHS))
2N/A
2N/A# the 'replacing spaces' example was taken from the (GNU) Make info manual
2N/Aempty:=
2N/Aspace:= $(empty) $(empty)
2N/A
2N/A# override on commandline for other architectures
2N/AINSTALLDIR = \
2N/A /home/www/agbkb/forschung/formal_methods/CoFI/hets/`utils/sysname.sh`
2N/A
2N/ADRIFT_deps = utils/DrIFT-src/*hs
2N/AGENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps) Common/Utils.hs
2N/AINLINEAXIOMS_deps = utils/InlineAxioms/InlineAxioms.hs Common/ListUtils.hs \
2N/A Common/Lib/Pretty.hs Common/Keywords.hs Common/Lib/Set.hs \
2N/A Common/Lib/Map.hs Common/Lib/Rel.hs Common/Lib/State.hs Common/Id.hs \
2N/A Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs CASL/ShowMixfix.hs \
2N/A CASL/Utils.hs Common/Lexer.hs Common/Token.hs Common/Anno_Parser.hs \
2N/A Common/GlobalAnnotations.hs Common/PrettyPrint.hs \
2N/A Common/Print_AS_Annotation.hs Common/PPUtils.hs CASL/LiteralFuns.hs \
2N/A CASL/Print_AS_Basic.hs Common/AnnoState.hs CASL/Formula.hs \
2N/A CASL/OpItem.hs CASL/SortItem.hs Common/Result.hs \
2N/A Common/ConvertLiteral.hs Common/Earley.hs CASL/MixfixParser.hs \
2N/A CASL/Parse_AS_Basic.hs CASL/Sign.hs CASL/Overload.hs \
2N/A CASL/StaticAna.hs Modal/AS_Modal.hs Modal/Parse_AS.hs \
2N/A Modal/ModalSign.hs Modal/Print_AS.hs Modal/StatAna.hs
2N/A
2N/AHC = ghc
2N/APERL = perl
2N/AHAPPY = happy -sgca
2N/ADRIFT = utils/DrIFT
2N/AINLINEAXIOMS = utils/outlineAxioms
2N/AHADDOCK = haddock
2N/ACPPP = cpp
2N/A
2N/AHC_WARN = -Wall
2N/AHC_FLAGS = $(HC_WARN) -fglasgow-exts -fno-monomorphism-restriction \
2N/A -fallow-overlapping-instances -fallow-undecidable-instances
2N/A# -ddump-minimal-imports
2N/A# flags also come in via ../uni/uni-package.conf
2N/A# but added it here in case of compilation without uni
2N/A
2N/AHC_INCLUDE = $(addprefix -i, $(INCLUDE_PATH))
2N/A
2N/Alogics = CASL HasCASL Modal CoCASL COL CspCASL Hatchet
2N/A
2N/AUNI_PACKAGE_CONF := $(wildcard ../uni/uni-package.conf)
2N/Aifneq ($(strip $(UNI_PACKAGE_CONF)),)
2N/AHC_PACKAGE = -package-conf $(UNI_PACKAGE_CONF) -package uni-davinci \
2N/A -package uni-server -DUNI_PACKAGE
2N/A
2N/A# some modules from uni for haddock
2N/A# if uni/server is included also HaXml sources are needed
2N/Auni_dirs = ../uni/davinci ../uni/graphs ../uni/events \
2N/A ../uni/reactor ../uni/util ../uni/posixutil
2N/A
2N/Auni_sources = $(wildcard $(addsuffix /haddock/*.hs, $(uni_dirs))) \
2N/A $(wildcard ../uni/htk/haddock/*/*.hs)
2N/Aendif
2N/A
2N/APFE_TOOLDIR := $(wildcard ../programatica/tools)
2N/Aifneq ($(strip $(PFE_TOOLDIR)),)
2N/APFE_DIRS = base/AST base/TI base/parse2 base/parse2/Lexer base/parse2/Parser \
2N/A base/pretty base/syntax base/lib base/lib/Monads base/Modules base/defs \
2N/A base/transforms base/transforms/Deriving property \
2N/A property/syntax property/AST property/transforms \
2N/A property/TI property/defs property/parse2 property/parse2/Parser
2N/A
2N/APFE_PATHS = $(addprefix $(PFE_TOOLDIR)/, $(PFE_DIRS))
2N/Apfe_sources = $(wildcard $(addsuffix /*hs, $(PFE_PATHS)))
2N/APFE_PATH = $(addprefix -i, $(PFE_PATHS))
2N/APFE_FLAGS = -package data -package text $(PFE_PATH) -DPROGRAMATICA
2N/Ahappy_files = $(PFE_TOOLDIR)/property/parse2/Parser/PropParser.hs \
2N/A $(PFE_TOOLDIR)/base/parse2/Lexer/HsLex.hs
2N/A
2N/ALEX_DIR := $(PFE_TOOLDIR)/base/parse2/Lexer
2N/A
2N/A$(LEX_DIR)/HsLex.hs: $(LEX_DIR)Gen/HsLexerGen
2N/A $< > $@
2N/A
2N/A$(LEX_DIR)Gen/HsLexerGen: $(LEX_DIR)Gen/*.hs $(LEX_DIR)Spec/*.hs \
2N/A $(LEX_DIR)/HsTokens.hs
2N/A $(HC) --make -O -package data \
2N/A -i$(PFE_TOOLDIR)/base/tests/HbcLibraries \
2N/A -i$(PFE_TOOLDIR)/base/lib \
2N/A -i$(LEX_DIR) -i$(LEX_DIR)Gen -i$(LEX_DIR)Spec \
2N/A $@.hs -o $@
2N/A
2N/Alogics += Haskell
2N/Aderived_sources += Haskell/PreludeString.hs
2N/AAPPENDPRELUDESTRING = utils/appendHaskellPreludeString \
2N/A Haskell/ProgramaticaPrelude.hs
2N/A
2N/A## rule for appendHaskellPreludeString
2N/AHaskell/PreludeString.hs: Haskell/PreludeString.append.hs \
2N/A $(APPENDPRELUDESTRING)
2N/A $(APPENDPRELUDESTRING) < $< > $@
2N/A
2N/AAst_Haskell_files := HsDeclStruct HsExpStruct HsFieldsStruct \
2N/A HsGuardsStruct HsKindStruct HsPatStruct HsTypeStruct HsAssocStruct \
2N/A HsModule HsName HsLiteral HsIdent
2N/A
2N/AOther_PFE_files := property/AST/HsPropStruct base/defs/PNT \
2N/A base/defs/UniqueNames base/Modules/TypedIds \
2N/A base/TI/TiKinds \
2N/A base/parse2/SourceNames base/syntax/SyntaxRec \
2N/A property/syntax/PropSyntaxStruct
2N/A
2N/AHaskell_files = $(addsuffix .hs, \
2N/A $(addprefix $(PFE_TOOLDIR)/base/AST/, $(Ast_Haskell_files)) \
2N/A $(addprefix $(PFE_TOOLDIR)/, $(Other_PFE_files)))
2N/A
2N/A## rule for ATC generation
2N/AHaskell/ATC_Haskell.der.hs: $(Haskell_files) utils/genRules
2N/A utils/genRules -r $(rule) -o Haskell -h ATC/Haskell.header.hs \
2N/A $(Haskell_files)
2N/Aendif
2N/Ahappy_files += Haskell/Hatchet/HsParser.hs
2N/A
2N/A### Profiling (only for debugging)
2N/A### Attention every module must be compiled with profiling or the linker
2N/A### cannot link the various .o files properly. So after switching on
2N/A### Profiling, do an 'gmake real_clean; gmake'
2N/A### and comment out HC_PACKAGE variable definition above.
2N/A### Comment in the following line for switching on profiling.
2N/A#HC_PROF = -prof -auto-all
2N/A
2N/AHCI_OPTS = $(HC_FLAGS) $(HC_INCLUDE) $(HC_PACKAGE) $(PFE_FLAGS)
2N/AHC_OPTS = $(HCI_OPTS) $(HC_PROF)
2N/ADRIFT_OPTS = +RTS -K10m -RTS
2N/A
2N/A### list of directories to run checks in
2N/ATESTDIRS = Common CASL HasCASL Haskell/Hatchet/examples ToHaskell
2N/A
2N/A
2N/A####################################################################
2N/A## sources for hets (semi - manually produced with a perl script)
2N/A
2N/A#GHCMAKE_OUTPUT = $(wildcard hetcats-make)
2N/A
2N/A#ifneq ($(strip $(GHCMAKE_OUTPUT)),)
2N/A#include sources_hetcats.mk
2N/A#else
2N/A
2N/Anon_sources = Common/LaTeX_maps.svmono.hs CspCASL/Main.hs Logic/Morphism.hs \
2N/A Static/LogicStructured.hs ./Test.hs
2N/ASOURCE_PATHS = $(COMMONLIB_PATH) $(CLEAN_PATH)
2N/Asources = hets.hs $(filter-out $(non_sources), \
2N/A $(wildcard $(addsuffix /[A-Z]*hs, $(SOURCE_PATHS))))
2N/A#endif
2N/A
2N/Aobjects = $(sources:%.hs=%.o)
2N/A
2N/Adrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs \
2N/A Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
2N/A Modal/AS_Modal.hs CoCASL/AS_CoCASL.hs COL/AS_COL.hs \
2N/A $(gendrifted_files)
2N/A
2N/Agenrule_header_files = $(wildcard ATC/*.header.hs)
2N/A
2N/Aatc_files := Common/Lib/Graph.hs Common/Id.hs Common/Result.hs \
2N/A Common/AS_Annotation.der.hs \
2N/A Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs \
2N/A Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
2N/A Static/DevGraph.hs \
2N/A Proofs/Proofs.hs \
2N/A Isabelle/IsaSign.hs
2N/A
2N/Aatc_der_files = $(foreach file, $(atc_files), \
2N/A ATC/$(basename $(basename $(notdir $(file)))).der.hs)
2N/A
2N/ACASL_files := CASL/Sublogic.hs CASL/Morphism.hs CASL/Sign.hs \
2N/A CASL/AS_Basic_CASL.der.hs
2N/A
2N/AHasCASL_files := HasCASL/As.hs HasCASL/Le.hs HasCASL/Morphism.hs \
2N/A HasCASL/Sublogic.hs \
2N/A
2N/AModal_files := Modal/AS_Modal.hs Modal/ModalSign.hs
2N/ACoCASL_files := CoCASL/AS_CoCASL.hs CoCASL/CoCASLSign.hs
2N/ACOL_files := COL/AS_COL.hs COL/COLSign.hs
2N/ACspCASL_files := CspCASL/AS_CSP_CASL.hs CspCASL/SignCSP.hs
2N/A
2N/AHatchet_files := Haskell/Hatchet/AnnotatedHsSyn.hs \
2N/A Haskell/Hatchet/MultiModuleBasics.hs \
2N/A Haskell/Hatchet/HsSyn.hs \
2N/A Haskell/Hatchet/Representation.hs \
2N/A Haskell/Hatchet/Class.hs Haskell/Hatchet/KindInference.hs \
2N/A Haskell/Hatchet/Env.hs Hatchet/HatParser.hs
2N/A
2N/Aatc_logic_files = $(foreach logic, $(logics), $(logic)/ATC_$(logic).der.hs)
2N/A
2N/Agenerated_rule_files = $(atc_der_files) $(atc_logic_files)
2N/A
2N/Agendrifted_files = $(patsubst %.der.hs, %.hs, $(generated_rule_files))
2N/A
2N/Ainline_axiom_files = Comorphisms/CASL2PCFOL.hs Comorphisms/PCFOL2FOL.hs \
2N/A Comorphisms/Modal2CASL.hs Comorphisms/CASL2TopSort.hs
2N/A
2N/Agen_inline_axiom_files = $(patsubst %.hs,%.inline.hs,$(inline_axiom_files))
2N/A
2N/Aderived_sources += $(drifted_files) Driver/Version.hs $(happy_files) \
2N/A $(inline_axiom_files) Modal/ModalSystems.hs
2N/A
2N/A# sources that have {-# OPTIONS -cpp #-}
2N/Acpp_sources = Isabelle/Logic_Isabelle.hs \
2N/A Proofs/Proofs.hs hets.hs CASL/CCC/FreeTypes.hs \
2N/A Comorphisms/LogicList.hs Comorphisms/LogicGraph.hs $(happy_files)
2N/A
2N/A
2N/Anondoc_sources = $(wildcard utils/DrIFT-src/*.hs) \
2N/A $(wildcard utils/DrIFT-src/*.lhs) \
2N/A $(wildcard utils/GenerateRules/*.hs) \
2N/A $(wildcard utils/InlineAxioms/*.hs) \
2N/A $(cpp_sources) $(pfe_sources) $(gen_inline_axiom_files) \
2N/A $(genrule_header_files) $(generated_rule_files) \
2N/A Haskell/PreludeString.append.hs \
2N/A Haskell/ProgramaticaPrelude.hs hxt/HXT.hs hxt/Net.hs \
2N/A $(patsubst %.hs,%.der.hs,$(drifted_files))
2N/A
2N/A# this variable holds the modules that should be documented
2N/Adoc_sources = $(filter-out $(nondoc_sources), $(sources)) \
2N/A $(patsubst %.hs, %.hspp, $(cpp_sources)) $(uni_sources)
2N/A
2N/Atax_sources = Taxonomy/AbstractGraphView.hs Taxonomy/MMiSSOntology.hs \
2N/A Taxonomy/MMiSSOntologyGraph.hs Taxonomy/OntoParser.hs
2N/Atax_objects = $(patsubst %.hs,%.o,$(tax_sources))
2N/A
2N/A
2N/A####################################################################
2N/A### targets
2N/A
2N/A.PHONY : all hets-opt hets-optimized clean d_clean real_clean bin_clean \
2N/A lib_clean distclean check capa hacapa h2h clean_genRules genRules \
2N/A taxonomy count doc apache_doc post_doc4apache \
2N/A derivedSources install_hets install release
2N/A
2N/A.SECONDARY : %.hs %.d $(generated_rule_files) $(gen_inline_axiom_files)
2N/A#.PRECIOUS: sources_hetcats.mk
2N/A
2N/A### call run_hc with
2N/A# $(call run_hc,<command-that-compiles-hetc-with-ghc>)
2N/A# and it generates hetcats-make
2N/A# iff there was no error during compilation
2N/Arun_hc = ($(1) 2>&1 || $(RM) hetcats-make) | tee hetcats-make
2N/A
2N/Ahets: $(sources) $(derived_sources)
2N/A $(call run_hc, $(HC) --make -o $@ hets.hs $(HC_OPTS))
2N/A
2N/Ahets-opt:
2N/A $(MAKE) distclean
2N/A $(MAKE) derivedSources
2N/A $(MAKE) real_clean
2N/A $(MAKE) hets-optimized
2N/A
2N/Ahets-optimized: $(derived_sources)
2N/A $(call run_hc, $(HC) --make -O -o hets hets.hs $(HC_OPTS))
2N/A strip hets
2N/A
2N/Ahets-old: $(objects)
2N/A $(RM) $@
2N/A $(HC) -o hets $(HC_OPTS) $(objects)
2N/A
2N/Ahets.cgi: $(sources) GUI/hets_cgi.hs
2N/A ghc --make -package-conf /home/luettich/ghc-pkg/package.conf \
2N/A -package WASH-CGI GUI/hets_cgi.hs -o hets.cgi $(HC_INCLUDE) \
2N/A $(HC_FLAGS) -O
2N/A strip hets.cgi
2N/A
2N/Ataxonomy: Taxonomy/taxonomyTool.hs $(tax_sources)
2N/A $(HC) --make -o Taxonomy/taxonomyTool $< -ifgl $(HC_OPTS)
2N/A
2N/A###############################
2N/A### TAGS files for (x)emacs
2N/A# load them with "M-x" "visit-tags-table" from
2N/A# "HetCATS/hetcats.TAGS"
2N/A# use "M-." to search for a tag
2N/A# !!Beware this is somewhat instable, because it uses an absolute path!!
2N/Ahetcats.TAGS: $(sources)
2N/A /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
2N/A $(sources); mv TAGS $@; mv tags hetcats.tags
2N/A
2N/A###############################
2N/A### count lines of code
2N/Acount: $(sources)
2N/A wc -l $(sources)
2N/A###############################
2N/A### Documentation via haddock
2N/Adoc: docs/index.html
2N/A
2N/A# generate haddock documentation with links to sources
2N/Adocs/index.html: $(doc_sources)
2N/A $(HADDOCK) $(doc_sources) -o docs -h -v \
2N/A -i docs/base.haddock -i docs/parsec.haddock -s ../ \
2N/A -t 'hets -- a heterogenous Specification (CASL) tool set'
2N/A
2N/A# sources are not copied here
2N/Aapache_doc:
2N/A $(RM) docs/*.*
2N/A cvs up -d
2N/A $(MAKE) hets-opt
2N/A $(MAKE) doc
2N/A $(MAKE) post_doc4apache
2N/A $(MAKE) o_clean
2N/A $(MAKE) hets.cgi
2N/A
2N/Apost_doc4apache:
2N/A $(PERL) utils/post_process_docs.pl docs \
2N/A 'Common.Lib.Map.html:Common.Lib._Map.html'
2N/A cp docs/*.* a-docs/
2N/A
2N/A###############################
2N/A### release management
2N/A
2N/AderivedSources: $(derived_sources)
2N/A
2N/Autils/DrIFT: $(DRIFT_deps)
2N/A (cd utils/DrIFT-src; $(HC) --make DrIFT.hs -o ../DrIFT && \
2N/A strip ../DrIFT)
2N/A
2N/Autils/genRules: $(GENERATERULES_deps)
2N/A (cd utils/GenerateRules; \
2N/A $(HC) --make -i../DrIFT-src -i../.. $(HC_WARN) \
2N/A GenerateRules.hs -o ../genRules && strip ../genRules)
2N/A
2N/A$(INLINEAXIOMS): $(INLINEAXIOMS_deps)
2N/A $(HC) --make utils/InlineAxioms/InlineAxioms.hs $(HC_WARN) \
2N/A -i../.. -o $(INLINEAXIOMS)
2N/A strip $(INLINEAXIOMS)
2N/A
2N/Arelease:
2N/A $(RM) -r HetCATS
2N/A cvs -d :pserver:cvsread@cvs-agbkb.informatik.uni-bremen.de:/repository\
2N/A co -P HetCATS
2N/A $(RM) -r uni
2N/A if [ -d ../uni ] ; then ln -s ../uni uni ; fi
2N/A $(RM) -r programatica
2N/A if [ -d ../programatica ] ; then \
2N/A mkdir programatica; \
2N/A ln -s ../../programatica/tools programatica/tools ; fi
2N/A (cd HetCATS; $(MAKE) derivedSources; \
2N/A $(MAKE) clean; ./clean.sh; \
2N/A find . -name CVS -o -name \*.o -o -name \*.hi | xargs $(RM) -r; \
2N/A $(RM) clean.*; mv Makefile Makefile.orig; \
2N/A mv ReleaseMakefile Makefile)
2N/A tar cvf HetCATS.tar HetCATS
2N/A
2N/Ainstall-hets:
2N/A chmod g+w hets
cp -p hets $(INSTALLDIR)/versions/hets-`cat version_nr`
cp -p version_nr $(INSTALLDIR)
(cd $(INSTALLDIR); $(RM) hets; \
ln -s versions/hets-`cat version_nr` hets; $(RM) version_nr)
install: hets-opt install-hets
#############################
### ATC DrIFT-rule generation
genRules: $(generated_rule_files)
$(atc_der_files): $(atc_files) $(genrule_header_files) utils/genRules
$(foreach file,$(atc_files),$(gen_atc_files))
CASL/ATC_CASL.der.hs: $(CASL_files) utils/genRules
utils/genRules -r $(rule) -o CASL $(CASL_files)
HasCASL/ATC_HasCASL.der.hs: $(HasCASL_files) utils/genRules
utils/genRules -r $(rule) -o HasCASL $(HasCASL_files)
Modal/ATC_Modal.der.hs: $(Modal_files) utils/genRules
utils/genRules -r $(rule) -o Modal $(Modal_files)
CoCASL/ATC_CoCASL.der.hs: $(CoCASL_files) utils/genRules
utils/genRules -r $(rule) -o CoCASL $(CoCASL_files)
COL/ATC_COL.der.hs: $(COL_files) utils/genRules
utils/genRules -r $(rule) -o COL $(COL_files)
CspCASL/ATC_CspCASL.der.hs: $(CspCASL_files) utils/genRules
utils/genRules -r $(rule) -o CspCASL $(CspCASL_files)
Hatchet/ATC_Hatchet.der.hs: $(Hatchet_files) utils/genRules
utils/genRules -r $(rule) -o Hatchet -h ATC/Hatchet.header.hs \
$(Hatchet_files)
rule:= ShATermConvertible
gen_atc_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 ;
clean_genRules:
$(RM) $(generated_rule_files) $(gendrifted_files)
###############
### clean up
clean: bin_clean o_clean
### removes *.hi and *.o in all include directories
o_clean:
for p in $(CLEAN_PATH) ; do \
(cd $$p ; $(RM) *.hi *.o *.hspp) ; done
### remove binaries
bin_clean:
$(RM) hets
$(RM) test_parser
$(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) hetpa
$(RM) hetana
$(RM) hetdg
$(RM) atctest2
$(RM) atctest
$(RM) Common/annos
$(RM) Haskell/Hatchet/hatch
$(RM) ToHaskell/translateAna
$(RM) Taxonomy/taxonomyTool
### additonally removes *.d (dependency files) in every include directory
### also delete *.d.bak (dependency file backups)
d_clean: clean
for p in $(CLEAN_PATH) ; do \
(cd $$p ; $(RM) *.d *.d.bak) ; done
### remove files also in own libraries
lib_clean:
for p in $(COMMONLIB_PATH) ; do \
(cd $$p ; $(RM) *.hi *.d *.o) ; done
### additionally removes the files that define the sources-variable
real_clean: bin_clean lib_clean clean
$(RM) hetcats-make sources_hetcats.mk
### additionally removes files not in CVS tree
distclean: real_clean clean_genRules d_clean
$(RM) $(derived_sources)
$(RM) utils/DrIFT utils/genRules $(INLINEAXIOMS)
####################################################################
### test targets
####################################################################
### a parser to test annotation parser and Id parsers
test_parser: Common/test_parser
Common/test_parser: Common/test_parser.hs Common/AS_Annotation.der.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### interactive
ghci:
$(HC)i $(HCI_OPTS)
### christian's target
### CASL parser
capa: CASL/capa
CASL/capa: CASL/capa.hs Common/*.hs CASL/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HasCASL parser
hacapa: HasCASL/hacapa
HasCASL/hacapa: HasCASL/hacapa.hs Common/*.hs HasCASL/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### Haskell analysis
hana: Haskell/hana
Haskell/hana: Haskell/hana.hs Haskell/HatAna.hs Haskell/PreludeString.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HasCASL to Haskell translation
h2h: ToHaskell/h2h
ToHaskell/h2h: ToHaskell/h2h.hs ToHaskell/*.hs Haskell/*.hs HasCASL/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL parser
hetpa: Syntax/hetpa.hs Syntax/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL parser
hetana: Static/hetana.hs Static/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### ATC test system
atctest: ATC/ATCTest.hs ATC/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
atctest2: ATC/ATCTest2.hs Common/SimpPretty.hs \
Common/ATerm/*.hs Common/Lib/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### ATerm.Lib test system
atermlibtest: Common/ATerm/ATermLibTest.hs Common/SimpPretty.hs \
Common/ATerm/*.hs Common/Lib/*.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### HetCASL with dev graph
hetdg: GUI/hetdg.hs $(drifted_files) *.hs
$(HC) --make -o $@ $< $(HC_OPTS)
### run tests in other directories
check:
for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
####################################################################
## Preparing the version of HetCATS
Driver/Version.hs: Driver/Version.in version_nr
$(PERL) utils/build_version.pl version_nr < Driver/Version.in > $@
## 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
####################################################################
## rules for DrIFT
.SUFFIXES:
%: %.hs
$(HC) --make -o $@ $<
%.hs: %.ly
$(HAPPY) $<
%.hs: %.y
$(HAPPY) -o $@ $<
%.hs: %.der.hs utils/DrIFT
($(DRIFT_ENV); export DERIVEPATH; $(DRIFT) $(DRIFT_OPTS) $< > $@)
## rules for inlineAxioms
%.hs: %.inline.hs $(INLINEAXIOMS)
$(INLINEAXIOMS) $< > $@
## rule for cpp and haddock
%.hspp: %.hs
$(HC) -E -cpp -DUNI_PACKAGE -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 for Modal/ModalSystems.hs needed for ModalLogic Translation
Modal/ModalSystems.hs: Modal/GeneratePatterns.inline.hs.in \
utils/genTransMFormFunc.pl $(INLINEAXIOMS)
$(PERL) utils/genTransMFormFunc.pl $< $@
# hetcats-make is created as side-effect of hets or hets-optimized
sources_hetcats.mk: hetcats-make utils/create_sources.pl
$(PERL) utils/create_sources.pl hetcats-make sources_hetcats.mk