Makefile revision ef67402074be14deb95e4ff564737d5593144130
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
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
09a67ca9b5cdf09e06470d4c965484783e2963f4Christian MaederCLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Haskell/Language:Modal:CspCASL:$(INCLUDE_PATH)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC = ghc
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederPERL = perl
d67a33b40578beef2e255a274f89bb9c34aaf056Christian MaederHAPPY = happy
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederDRIFT = $(PERL) utils/DrIFT
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederAG = $(PERL) utils/ag
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHADDOCK = $(PERL) utils/haddock
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_INCLUDE = -i$(INCLUDE_PATH)
d21f1db14625cb0a536fc06b46fcc115d48a25bbChristian MaederHC_PACKAGE =
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
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder#HC_PROF = -prof -auto-all -Wall
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederHC_OPTS = $(HCI_OPTS) $(HC_PROF)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### list of directories to run checks in
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederTESTDIRS = 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)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederinclude sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederdrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs\
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian 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
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder.PHONY : clean d_clean real_clean bin_clean check
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder.SECONDARY : %.hs %.d
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder#.PRECIOUS: sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhets: $(objects)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) -o $@ $(HC_OPTS) $(objects)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhetcats-make: hets.hs utils/create_sources.pl $(drifted_files)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) hetcats-make sources_hetcats.mk
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make && \
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(PERL) utils/create_sources.pl hetcats-make sources_hetcats.mk
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 \
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich -t 'hets -- a heterogenous Specification (CASL) tool set'
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich
ef67402074be14deb95e4ff564737d5593144130Klaus Luettichapache_doc:
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich cvs up -d
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich $(RM) docs/*.html
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich $(MAKE) doc
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich $(PERL) utils/post_process_docs.pl docs \
ef67402074be14deb95e4ff564737d5593144130Klaus Luettich 'Common.Lib.Map.html:Common.Lib._Map.html'
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
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
470ca7a2797069ae4b27c34c1b71419f67be1f84Christian Maeder $(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
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maederlib_clean:
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder for p in $(subst :, ,$(COMMONLIB_PATH):$(CLEANPATH)) . ; 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
b9625461755578f3eed04676d42a63fd2caebd0cChristian Maeder $(RM) AS_*.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### additionally removes files not in CVS tree
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederdistclean: real_clean
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) hetcats/Version.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $(drifted_files)
49ad22e8dae6b1ed8733a8bada2538d4713ceb34Christian Maeder $(RM) Haskell/Language/Parser.hs
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
d67a33b40578beef2e255a274f89bb9c34aaf056Christian MaederHaskell/hapa: Haskell/hapa.lhs Haskell/*.hs $(drifted_files) Haskell/Language/Parser.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian MaederHaskell/Language/Parser.hs: Haskell/Language/Parser.ly
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder $(HAPPY) $<
d67a33b40578beef2e255a274f89bb9c34aaf056Christian 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
5d6ee210ac97051e4d1830d4c346d8a8db01a6b5Christian Maederhetpa: Syntax/hetpa.hs $(drifted_files) Haskell/Language/Parser.hs *.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder### HetCASL parser
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhetana: Static/hetana.hs $(drifted_files) *.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(RM) $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(HC) --make -o $@ $< $(HC_OPTS)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
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
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhetcats/Options.hs: hetcats/Version.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederhets.hs: hetcats/Version.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder####################################################################
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## rules for DrIFT
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder%.ly: %.hs
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder $(HAPPY) $<
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.hs: %.ag.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(AG) $<
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.hs: %.der.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(DRIFT) $< > $@
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder%.hs: %.ag
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder $(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)
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder## include every .d file in INCLUDE_PATH
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder-include $(objects:.o=.d)
1a6464613c59e35072b90ca296ae402cbe956144Christian Maeder
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maedersources_hetcats.mk: hetcats-make hetcats/Version.hs
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maederendif