Makefile revision 5d4038657f6a63e131f5804af2f7957b69e15a43
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# hetcats/Makefile
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder# $Id$
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# Author: Klaus L�ttich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# Year: 2003
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# This Makefile will compile the new hetcats system and provides also
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# targets for test programs during implementation phases.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# !!! Note: This makefile is written for GNU make !!!
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# (gmake on solaris ; make on linux)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## Some varibles, which control the compilation
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b9625461755578f3eed04676d42a63fd2caebd0cChristian MaederINCLUDE_PATH = ghc:hetcats
b9625461755578f3eed04676d42a63fd2caebd0cChristian MaederCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja GröningCLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Haskell/Language:Modal:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:$(INCLUDE_PATH):Haskell/Hatchet
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
e1905890322767ae24c4594d80e31877037f4055Klaus LuettichDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:/home/linux-bkb/ghc/ghc-latest/lib/ghc-6.0.1/imports'
88c800932dd7053322501ea2039d9f234be6866cKlaus Luettich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC = ghc
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederPERL = perl
d67a33b40578beef2e255a274f89bb9c34aaf056Christian MaederHAPPY = happy
88c800932dd7053322501ea2039d9f234be6866cKlaus LuettichDRIFT = $(DRIFT_ENV) $(PERL) utils/DrIFT
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederAG = $(PERL) utils/ag
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersHADDOCK = $(PERL) utils/haddock
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus LuettichHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall -O2
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich# please remove '-O2' if compilation lasts to long on your system
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich# but please don't commit to cvs server
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_INCLUDE = -i$(INCLUDE_PATH)
caf544dc9b8f02e05e37786681153f5660e67f64Martin KühlHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederAG_FLAGS = -mdcfs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Profiling and Warnings (only for debugging)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Attention every module must be compiled with profiling or the linker
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### cannot link the various .o files properly. So after switching on
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Profiling, do an 'gmake clean; gmake'
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### If you need Profiling comment out the following line
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich#HC_PROF = -prof -auto-all
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b0294d73dcefc502ddaa13e18b46103a5916971fTill MossakowskiHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_OPTS = $(HCI_OPTS) $(HC_PROF)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersDRIFT_OPTS = +RTS -K10 -RTS
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### list of directories to run checks in
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix ReckersTESTDIRS = CASL HasCASL test
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## sources for hetcats (semi - manually produced with a perl script)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),bin_clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),d_clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),real_clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),distclean)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersifneq ($(MAKECMDGOALS),genRules)
ebe517300051f765f2ed856a789dd5613d681ab0Klaus Luettichifneq ($(MAKECMDGOALS),apache_doc)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersifneq ($(MAKECMDGOALS),clean_genRules)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederinclude sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
ebe517300051f765f2ed856a789dd5613d681ab0Klaus Luettichendif
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersendif
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs\
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(gendrifted_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettichgenrule_header_files = $(wildcard ATC/*.header.hs)
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersgenrule_files = Common/Lib/Graph.hs Common/Id.hs Common/Result.hs Common/AS_Annotation.der.hs Common/Named.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers CASL/Morphism.hs CASL/StaticAna.hs CASL/AS_Basic_CASL.der.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers HasCASL/Le.hs HasCASL/As.hs HasCASL/Symbol.hs HasCASL/Morphism.hs \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning CspCASL/AS_CSP_CASL.hs \
8659594bb40eb5f3da5439692f0908300947191eSonja Gröning Static/DevGraph.hs \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning Haskell/Hatchet/AnnotatedHsSyn.hs Haskell/Hatchet/MultiModuleBasics.hs \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning Haskell/Hatchet/HsSyn.hs \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning Haskell/Hatchet/Representation.hs\
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning Haskell/Hatchet/Class.hs Haskell/Hatchet/KindInference.hs \
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning Haskell/Hatchet/Env.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersgendrifted_files = ATC/Graph.hs ATC/Id.hs ATC/Result.hs ATC/AS_Annotation.hs ATC/Named.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers ATC/AS_Library.hs ATC/GlobalAnnotations.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers ATC/AS_Structured.hs ATC/AS_Architecture.hs ATC/DevGraph.hs \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers CASL/ATC_CASL.hs Haskell/ATC_Haskell.hs HasCASL/ATC_HasCASL.hs CspCASL/ATC_CspCASL.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersgenerated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröninghappy_files = Haskell/Language/Parser.hs Haskell/Hatchet/HsParser.hs
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# this variable holds the modules that should be documented
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# the imported parsec library is not included!
0e012772df2ce0dc7e8f0fe3acf458c2871dcfbcChristian Maederdoc_sources = $(filter-out Nothing/Nothing% ,$(sources))
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### targets
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich.PHONY : clean d_clean real_clean bin_clean check hetana hetpa hetdg clean_genRules genRules
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers.SECONDARY : %.hs %.d $(generated_rule_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder#.PRECIOUS: sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersall: hets
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder
88c800932dd7053322501ea2039d9f234be6866cKlaus Luettichhets: $(sources)
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder $(HC) --make -o $@ hets.hs $(HC_OPTS)
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maederhets-opt: $(sources)
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder $(MAKE) distclean
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder $(MAKE) hets-optimized
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maederhets-optimized: $(sources)
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder $(HC) --make -O -o $@ hets.hs $(HC_OPTS)
fa21fba9ceb1ddf7b3efd54731a12ed8750191d8Christian Maeder
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederhets-old: $(objects)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder $(HC) -o hets $(HC_OPTS) $(objects)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederhetcats-make: hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) hetcats-make sources_hetcats.mk
f29371d8bd5a232c974e736b06d0d8a655d320fbKlaus Luettich $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder###############################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### TAGS files for (x)emacs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# load them with "M-x" "visit-tags-table" from
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# "HetCATS/hetcats/hetcats.TAGS"
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# use "M-." to search for a tag
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder# !!Beware this is somewhat instable, because it uses an absolute path!!
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhetcats.TAGS: $(sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(sources); mv TAGS $@; mv tags hetcats.tags
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder###############################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Documentation via haddock
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederdoc: docs/index.html utils/hd-lib
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederdocs/index.html: $(doc_sources)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HADDOCK) $(doc_sources) -o docs -h \
670691f757fefac75f63a15f6aa14706e05fe155Klaus Luettich --read-interface=http://www.haskell.org/ghc/docs/latest/html/base,/home/linux-bkb/ghc/ghc-6.0.1/share/ghc-6.0.1/html/base/base.haddock \
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich -t 'hets -- a heterogenous Specification (CASL) tool set'
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich
ef67402074be14deb95e4ff564737d5593144130Klaus Luettichapache_doc:
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich cvs up -d
19933e754a6a244efca3b63184fb191668e08931Klaus Luettich $(MAKE) distclean
75cda7e5b890d050d560d970af244a183f28328fKlaus Luettich $(MAKE) hetcats-make
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich $(RM) docs/*.html
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich $(MAKE) doc
1323eba62fc519b068f5aaec4f9d2be05ffabea9Klaus Luettich $(MAKE) post_doc4apache
1323eba62fc519b068f5aaec4f9d2be05ffabea9Klaus Luettich
1323eba62fc519b068f5aaec4f9d2be05ffabea9Klaus Luettichpost_doc4apache:
725a68ec81cba9b8aa8647bebfb5baa449803e7eKlaus Luettich $(PERL) utils/post_process_docs.pl docs \
d579f5b263e6c73d466c265f2fbfd45b0e69ca64Klaus Luettich 'Common.Lib.Map.html:Common.Lib._Map.html'
bf731ab5ef055c75bf26e8e5b2eb4a4a11ab61ebKlaus Luettich mv docs/* a-docs/
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
ac43fa22d2d3f91a17674ac164cba3cf39a17795Klaus Luettich#############################
ac43fa22d2d3f91a17674ac164cba3cf39a17795Klaus Luettich### ATC DrIFT-rule generation
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus LuettichgenRules: $(generated_rule_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich$(generated_rule_files): $(genrule_files) $(genrule_header_files)
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich $(MAKE) clean_genRules
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(foreach file,$(atc_files),$(gen_atc_files))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers utils/genRules -r $(rule) -o CASL -h ATC/CASL.header.hs $(casl_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers utils/genRules -r $(rule) -o HasCASL -h ATC/HasCASL.header.hs $(hascasl_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers utils/genRules -r $(rule) -o CspCASL -h ATC/CspCASL.header.hs $(cspcasl_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers utils/genRules -r $(rule) -o Haskell -h ATC/Haskell.header.hs $(haskell_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersrule = ShATermConvertible
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
ac43fa22d2d3f91a17674ac164cba3cf39a17795Klaus Luettichgen_atc_files = if [ -f ATC/$(basename $(basename $(notdir $(file)))).header.hs ]; then \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers utils/genRules -r $(rule) -o ATC -h ATC/$(basename $(basename $(notdir $(file)))).header.hs $(file); \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers else \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers utils/genRules -r $(rule) -o ATC $(file); \
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers fi ;
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersatc_files := $(filter-out CASL/% HasCASL/% CspCASL/% Haskell/% ,$(genrule_files))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckerscasl_files := $(filter CASL/% ,$(genrule_files))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckershascasl_files := $(filter HasCASL/% ,$(genrule_files))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckerscspcasl_files := $(filter CspCASL/% ,$(genrule_files))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckershaskell_files := $(filter Haskell/%,$(genrule_files))
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettichclean_genRules:
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich $(RM) $(generated_rule_files)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder###############
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### clean up
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### removes *.hi and *.o in all include directories
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maederclean: bin_clean
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder for p in $(subst :, ,$(CLEAN_PATH)) . ; do \
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder (cd $$p ; $(RM) *.hi *.o) ; done
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder### remove binaries
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maederbin_clean:
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) hets
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(RM) test_parser
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) CASL/capa
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) HasCASL/hacapa
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder $(RM) Haskell/hapa
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder $(RM) Haskell/wrap
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder $(RM) Syntax/hetpa
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder $(RM) Static/hetana
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder $(RM) Static/hetana
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder $(RM) GUI/hetdg
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder $(RM) hetpa
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder $(RM) hetana
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder $(RM) hetdg
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### additonally removes *.d (dependency files) in every include directory
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### also delete *.d.bak (dependency file backups)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederd_clean: clean
26f228bf3a3fea810223396e5794c217a79a8d5bChristian Maeder for p in $(subst :, ,$(CLEAN_PATH)) . ; do \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder (cd $$p ; $(RM) *.d *.d.bak) ; done
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder### remove files also in own libraries
75cda7e5b890d050d560d970af244a183f28328fKlaus Luettichlib_clean: clean
75cda7e5b890d050d560d970af244a183f28328fKlaus Luettich for p in $(subst :, ,$(COMMONLIB_PATH)) . ; do \
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder (cd $$p ; $(RM) *.hi *.d *.o) ; done
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### additionally removes the files that define the sources-variable
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maederreal_clean: bin_clean lib_clean
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) hetcats-make sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### additionally removes files not in CVS tree
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersdistclean: real_clean clean_genRules d_clean
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) hetcats/Version.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $(drifted_files)
96ef2e46d048c357927f2795a40e9e66f21b85fbSonja Gröning $(RM) $(happy_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### test targets
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### a parser to test annotation parser and Id parsers
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian Maedertest_parser: Common/test_parser
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian Maeder
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian MaederCommon/test_parser: Common/test_parser.hs Common/AS_Annotation.der.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### interactive
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederghci:
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC)i $(HCI_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### christian's target
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### CASL parser
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maedercapa: CASL/capa
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian MaederCASL/capa: CASL/capa.lhs Common/*.hs CASL/*.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### HasCASL parser
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhacapa: HasCASL/hacapa
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian MaederHasCASL/hacapa: HasCASL/hacapa.lhs CASL/capa HasCASL/*.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### Haskell parser
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhapa: Haskell/hapa
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b49276c9f50038e0bd499ad49f7bd6444566a834Christian MaederHaskell/hapa: Haskell/hapa.lhs Haskell/*.hs Haskell/Language/*.hs $(happy_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder### Haskell wrap parser
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederwrap: Haskell/wrap
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian MaederHaskell/wrap: Haskell/wrap.lhs Haskell/*.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### HetCASL parser
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederhetpa: Syntax/hetpa.hs Syntax/*.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### HetCASL parser
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maederhetana: Static/hetana.hs Static/*.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers### ATC test system
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersatctest: ATC/ATCTest.hs ATC/*.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(RM) $@
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(HC) --make -o $@ $< $(HC_OPTS)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich### ATerm.Lib test system
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettichatermlibtest: Common/ATerm/ATermLibTest.hs Common/ATerm/*.hs Common/SimpPretty.hs
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich $(RM) $@
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich $(HC) --make -o $@ $< $(HC_OPTS)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### HetCASL with dev graph
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhetdg: GUI/hetdg.hs $(drifted_files) *.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS) -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### run tests in other directories
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maedercheck: hetcats
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## Preparing the version of HetCATS
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhetcats/Version.hs: hetcats/Version.in version_nr
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(PERL) utils/build_version.pl version_nr < hetcats/Version.in > $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## two hardcoded dependencies for a correct generation of Version.hs
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettichhetcats/Options.hs hetcats/WriteFn.hs hetcats/ReadFn.hs: hetcats/Version.hs
efa8f9db01f64e2c719c201e4037743caefae045Klaus Luettichhets.hs: hetcats/Version.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## rules for DrIFT
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
b49276c9f50038e0bd499ad49f7bd6444566a834Christian Maeder%.hs: %.ly
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder $(HAPPY) $<
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich#%.hs: %.ag.hs
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich# $(AG) $<
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.hs: %.der.hs
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers $(DRIFT) $(DRIFT_OPTS) $< > $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich#%.hs: %.ag
ba0ec5e897ef99d420c8c14c2374e0f32b7043dbKlaus Luettich# $(AG) $< -o $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.lhs: %.der.lhs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(DRIFT) $< > $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## compiling rules for object and interface files
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.o %.hi: %.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) -c $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.o %.hi: %.lhs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) -c $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## compiling rules for dependencies
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.d : %.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.d : %.lhs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## Setting a global search path (for dependency files)
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),real_clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),d_clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),real_clean)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederifneq ($(MAKECMDGOALS),distclean)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersifneq ($(MAKECMDGOALS),genRules)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersifneq ($(MAKECMDGOALS),clean_genRules)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersifeq ($(MAKECMDGOALS),hets-old)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## include every .d file in INCLUDE_PATH
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder-include $(objects:.o=.d)
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersendif
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder
f29371d8bd5a232c974e736b06d0d8a655d320fbKlaus Luettichsources_hetcats.mk: hetcats-make hetcats/Version.hs hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)
f29371d8bd5a232c974e736b06d0d8a655d320fbKlaus Luettich $(PERL) utils/create_sources.pl hetcats-make sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckersendif
88c800932dd7053322501ea2039d9f234be6866cKlaus Luettichendif