rules revision f29371d8bd5a232c974e736b06d0d8a655d320fb
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync# Author: Klaus L�ttich
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync# Year: 2003
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync# This Makefile will compile the new hetcats system and provides also
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync# targets for test programs during implementation phases.
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync# !!! Note: This makefile is written for GNU make !!!
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync# (gmake on solaris ; make on linux)
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync####################################################################
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync## Some varibles, which control the compilation
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncINCLUDE_PATH = ghc:hetcats
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncCLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Haskell/Language:Modal:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:$(INCLUDE_PATH)
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncDRIFT_ENV = DERIVEPATH='.:ghc:hetcats:/home/linux-bkb/ghc/ghc-latest/lib/ghc-6.0/imports'
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncHAPPY = happy
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncDRIFT = $(DRIFT_ENV) $(PERL) utils/DrIFT
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncHADDOCK = $(PERL) utils/haddock
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncHC_INCLUDE = -i$(INCLUDE_PATH)
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncHC_PACKAGE = -package-conf ../uni/uni-package.conf -package uni-davinci -package uni-server
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncAG_FLAGS = -mdcfs
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync### Profiling and Warnings (only for debugging)
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsync### Attention every module must be compiled with profiling or the linker
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsync### cannot link the various .o files properly. So after switching on
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsync### Profiling, do an 'gmake clean; gmake'
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsync### If you need Profiling comment out the following line
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsync#HC_PROF = -prof -auto-all -Wall
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsyncHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsyncHC_OPTS = $(HCI_OPTS) $(HC_PROF)
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsyncDRIFT_OPTS = +RTS -K10 -RTS
5b05f43fc07d02aa6997b203bad9cf92633b89d5vboxsync### list of directories to run checks in
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncTESTDIRS = CASL HasCASL test
0fbb26e55fd320c3d5c5b4bfe85e578c867c657avboxsync####################################################################
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsync## sources for hetcats (semi - manually produced with a perl script)
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncifneq ($(MAKECMDGOALS),clean)
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncifneq ($(MAKECMDGOALS),bin_clean)
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncifneq ($(MAKECMDGOALS),d_clean)
18dcd379b99cb0e85ab38652a80d48b04ce062b4vboxsyncifneq ($(MAKECMDGOALS),real_clean)
include sources_hetcats.mk
genrule_files = Common/Lib/Graph.hs Common/Id.hs Common/Result.hs Common/AS_Annotation.der.hs Common/Named.hs \
Syntax/AS_Structured.der.hs Syntax/AS_Architecture.der.hs Common/GlobalAnnotations.hs Syntax/AS_Library.der.hs \
generated_rule_files = $(patsubst %.hs,%.der.hs,$(gendrifted_files))
happy_files = Haskell/Language/Parser.hs
doc_sources = $(filter-out Nothing/Nothing% ,$(sources))
#.PRECIOUS: sources_hetcats.mk
$(HC) --make -o $@ hets.hs $(HC_OPTS)
$(RM) hetcats-make sources_hetcats.mk
hetcats.TAGS: $(sources)
$(sources); mv TAGS $@; mv tags hetcats.tags
docs/index.html: $(doc_sources)
-i/home/linux-bkb/ghc/ghc-6.0/share/ghc-6.0/html/base,/home/linux-bkb/ghc/ghc-6.0/share/ghc-6.0/html/base/base.haddock \
$(PERL) utils/post_process_docs.pl docs \
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
wrap: Haskell/wrap
hetpa: Syntax/hetpa.hs Syntax/*.hs
hetana: Static/hetana.hs Static/*.hs
atctest: ATC/ATCTest.hs ATC/*.hs
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
#%.hs: %.ag.hs
%.hs: %.der.hs
%.lhs: %.der.lhs
sources_hetcats.mk: hetcats-make hetcats/Version.hs hets.hs utils/create_sources.pl $(drifted_files) $(happy_files)