rules revision 0153ddd703818536e4ddfe7cbad9dd6d5b4f6292
822b18599d1c9465449c7111fe7e7b86fbf44a57Lennart Poettering# Author: (c) Klaus L�ttich, Christian Maeder, Uni Bremen 2002-2004
822b18599d1c9465449c7111fe7e7b86fbf44a57Lennart Poettering# This Makefile will compile the new hetcats system and provides also
822b18599d1c9465449c7111fe7e7b86fbf44a57Lennart Poettering# targets for test programs during implementation phases.
822b18599d1c9465449c7111fe7e7b86fbf44a57Lennart Poettering# !!! Note: This makefile is written for GNU make !!!
822b18599d1c9465449c7111fe7e7b86fbf44a57Lennart Poettering# (gmake on solaris ; make on linux)
082694b75f0217f1c5b8b89590e5018f6d8b0949Lennart Poettering####################################################################
CLEAN_PATH = utils/DrIFT-src:utils/GenerateRules:Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Modal:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:Isabelle:$(INCLUDE_PATH):Haskell/Hatchet
LINUX_IMPORTS = $(wildcard /home/linux-bkb/ghc/ghc-latest/lib/ghc-*/imports)
DRIFT_deps = utils/DrIFT-src/*hs
GENERATERULES_deps = utils/GenerateRules/*hs $(DRIFT_deps)
DRIFT = $(DRIFT_ENV) utils/DrIFT
# -fglasgow-exts comes in via ../uni/uni-package.conf
HC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci \
ifneq ($(MAKECMDGOALS),utils/genRules)
include sources_hetcats.mk
genrule_header_files = $(wildcard ATC/*.header.hs)
generated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
happy_files = Haskell/Hatchet/HsParser.hs
doc_sources = $(filter-out ./Isabelle/IsaSign.hs ,$(sources))
#.PRECIOUS: sources_hetcats.mk
$(HC) --make -o $@ hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
hets-opt: hetcats/Version.hs
$(HC) --make -O2 -o hets hets.hs $(HC_OPTS) 2>&1 | tee hetcats-make
$(RM) hetcats-make sources_hetcats.mk
hetcats.TAGS: $(sources)
$(sources); mv TAGS $@; mv tags hetcats.tags
doc: docs/index.html
docs/index.html: $(doc_sources)
-i docs/base.haddock \
$(PERL) utils/post_process_docs.pl docs \
$(RM) docs/index.html
derivedSources: $(drifted_files) $(happy_files) hetcats/Version.hs
utils/DrIFT: $(DRIFT_deps)
utils/genRules: $(GENERATERULES_deps)
(cd utils/GenerateRules; \
$(HC) --make '-i../..:../DrIFT-src' -package text GenerateRules.hs -o ../genRules && \
(cd HetCATS; $(MAKE) derivedSources; ./clean.sh; \
tar cvf HetCATS.tar HetCATS
genRules: $(generated_rule_files) utils/genRules
$(generated_rule_files): $(genrule_files) utils/genRules #$(genrule_header_files)
utils/genRules -r $(rule) -o CASL $(casl_files)
utils/genRules -r $(rule) -o Modal $(modal_files)
utils/genRules -r $(rule) -o CspCASL $(cspcasl_files)
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); \
utils/genRules -r $(rule) -o ATC $(file); \
$(RM) CASL/capa
$(RM) HasCASL/hacapa
$(RM) Haskell/hapa
$(RM) Haskell/wrap
$(RM) Syntax/hetpa
$(RM) Static/hetana
$(RM) Static/hetana
$(RM) GUI/hetdg
### also delete *.d.bak (dependency file backups)
(cd $$p ; $(RM) *.d *.d.bak) ; done
$(RM) hetcats-make sources_hetcats.mk
$(RM) hetcats/Version.hs
test_parser: Common/test_parser
capa: CASL/capa
hacapa: HasCASL/hacapa
hapa: Haskell/hapa
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
$(HC) --make -o $@ $< $(HC_OPTS) -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
## two hardcoded dependencies for a correct generation of Version.hs
ifneq ($(MAKECMDGOALS),utils/genRules)
sources_hetcats.mk: hetcats-make hetcats/Version.hs hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)