Makefile revision ef67402074be14deb95e4ff564737d5593144130
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen# Author: Klaus L�ttich
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo Sirainen# This Makefile will compile the new hetcats system and provides also
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen# targets for test programs during implementation phases.
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen# !!! Note: This makefile is written for GNU make !!!
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo Sirainen# (gmake on solaris ; make on linux)
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen####################################################################
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen## Some varibles, which control the compilation
956a62e2b68e1c042bf2bcddd6f4ba79fec9745aTimo SirainenCOMMONLIB_PATH = Common/Lib:Common/Lib/Parsec:Common/ATerm
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo SirainenCLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:Haskell/Language:Modal:CspCASL:$(INCLUDE_PATH)
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo SirainenHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
00b10a9ca50bca190e72a19aa6571ea612701d82Aki Tuomi### Profiling and Warnings (only for debugging)
00b10a9ca50bca190e72a19aa6571ea612701d82Aki Tuomi### Attention every module must be compiled with profiling or the linker
00b10a9ca50bca190e72a19aa6571ea612701d82Aki Tuomi### cannot link the various .o files properly. So after switching on
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen### Profiling, do an 'gmake clean; gmake'
5fbccc935e3f7b916aa7c6e302a212821072e83aTimo Sirainen### If you need Profiling comment out the following line
402e999a878e0cc41a0afb830fea0a93afc75f0dTimo Sirainen#HC_PROF = -prof -auto-all -Wall
61cf001f1944d92eb25f113ba4c08985d6e30d53Timo SirainenHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen### list of directories to run checks in
68a3f1b03fb0014b856abd2fee4932a0576bbe89Timo Sirainen####################################################################
68a3f1b03fb0014b856abd2fee4932a0576bbe89Timo Sirainen## sources for hetcats (semi - manually produced with a perl script)
396e6d4f586f137f9f43b62f3d0502edbdc6c854Martti Rannanjärviobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
ec1fe002da484f4c06f0c072d673abac74b66b9eTimo Sirainendrifted_files = Syntax/AS_Architecture.hs Syntax/AS_Library.hs\
ceb8c97c6c9fe0ee7eb544645c6bdb74dfcb519dJosef 'Jeff' Sipek Common/AS_Annotation.hs CASL/AS_Basic_CASL.hs Syntax/AS_Structured.hs
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen# this variable holds the modules that should be documented
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen# the imported parsec library is not included!
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainendoc_sources = $(filter-out Nothing/Nothing% ,$(sources))
b932ee7fbbec6e79b777dcc7ba613b9e99f8337bTimo Sirainen####################################################################
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen.PHONY : clean d_clean real_clean bin_clean check
68a3f1b03fb0014b856abd2fee4932a0576bbe89Timo Sirainenhetcats-make: hets.hs utils/create_sources.pl $(drifted_files)
68a3f1b03fb0014b856abd2fee4932a0576bbe89Timo Sirainen $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make && \
68a3f1b03fb0014b856abd2fee4932a0576bbe89Timo Sirainen $(PERL) utils/create_sources.pl hetcats-make sources_hetcats.mk
b932ee7fbbec6e79b777dcc7ba613b9e99f8337bTimo Sirainen###############################
1ea57ace3467dc68582e12349f2de7771f4dde78Timo Sirainen### TAGS files for (x)emacs
b932ee7fbbec6e79b777dcc7ba613b9e99f8337bTimo Sirainen# load them with "M-x" "visit-tags-table" from
b932ee7fbbec6e79b777dcc7ba613b9e99f8337bTimo Sirainen# use "M-." to search for a tag
b932ee7fbbec6e79b777dcc7ba613b9e99f8337bTimo Sirainen# !!Beware this is somewhat instable, because it uses an absolute path!!
b932ee7fbbec6e79b777dcc7ba613b9e99f8337bTimo Sirainen /home/ger/linux/ghc-5.04.2/bin/i386-unknown-linux/hasktags \
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen###############################
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen### Documentation via haddock
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen -t 'hets -- a heterogenous Specification (CASL) tool set'
6a262c9bd8f57cf1e57112e0522dbdab28ae8c29Timo Sirainen###############
bf7dc750b95039981c0e9d728f313d50cf38a156Martti Rannanjärvi### removes *.hi and *.o in all include directories
956a62e2b68e1c042bf2bcddd6f4ba79fec9745aTimo Sirainen### remove binaries
1b7e7ff3c57f4ff0ba5f8b8a2a26e8669f0ba7fdTimo Sirainen### additonally removes *.d (dependency files) in every include directory
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen### also delete *.d.bak (dependency file backups)
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen### remove files also in own libraries
1a3f9d72e15fb931edf58f104fb7ff12d238f051Timo Sirainen for p in $(subst :, ,$(COMMONLIB_PATH):$(CLEANPATH)) . ; do \
b932ee7fbbec6e79b777dcc7ba613b9e99f8337bTimo Sirainen### additionally removes the files that define the sources-variable
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen### additionally removes files not in CVS tree
956a62e2b68e1c042bf2bcddd6f4ba79fec9745aTimo Sirainen####################################################################
956a62e2b68e1c042bf2bcddd6f4ba79fec9745aTimo Sirainen### test targets
956a62e2b68e1c042bf2bcddd6f4ba79fec9745aTimo Sirainen####################################################################
f23baa3b53b1dd4eb19729e99a43937fa3c7f309Timo Sirainen### a parser to test annotation parser and Id parsers
c57ba1788a6598993a9625bbf26a4fedca23815eTimo SirainenCommon/test_parser: Common/test_parser.hs Common/AS_Annotation.der.hs
ghci:
$(RM) $@
$(RM) $@
$(RM) $@
$(HAPPY) $<
$(RM) $@
$(RM) $@
$(RM) $@
$(RM) $@
$(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
$(HAPPY) $<
$(AG) $<
$(DRIFT) $< > $@
$(AG) $< -o $@
$(DRIFT) $< > $@
%.d : %.hs
%.d : %.lhs