1N/A# Author: Klaus L�ttich
1N/A# This Makefile will compile the new hetcats system and provides also
1N/A# targets for test programs during implementation phases.
1N/A# !!! Note: This makefile is written for GNU make !!!
1N/A# (gmake on solaris ; make on linux)
1N/A####################################################################
1N/A## Some varibles, which control the compilation
1N/AINCLUDE_PATH = ghc:hetcats
1N/ACLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:
Haskell/Language:Modal:CspCASL:ATC:ToHaskell:Proofs:Comorphisms:$(INCLUDE_PATH)
0N/AHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
221N/AHC_INCLUDE = -i$(INCLUDE_PATH)
14N/A### Profiling and Warnings (only for debugging)
221N/A### Attention every module must be compiled with profiling or the linker
14N/A### cannot link the various .o files properly. So after switching on
14N/A### Profiling, do an 'gmake clean; gmake'
22N/A### If you need Profiling comment out the following line
22N/A#HC_PROF = -prof -auto-all -Wall
22N/AHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
22N/AHC_OPTS = $(HCI_OPTS) $(HC_PROF)
22N/ADRIFT_OPTS = +RTS -K10 -RTS
0N/A### list of directories to run checks in
116N/ATESTDIRS = CASL HasCASL test
0N/A####################################################################
0N/A## sources for hetcats (semi - manually produced with a perl script)
192N/Aifneq ($(MAKECMDGOALS),clean)
0N/Aifneq ($(MAKECMDGOALS),bin_clean)
0N/Aifneq ($(MAKECMDGOALS),d_clean)
285N/Aifneq ($(MAKECMDGOALS),real_clean)
0N/Aifneq ($(MAKECMDGOALS),distclean)
26N/Aifneq ($(MAKECMDGOALS),genRules)
50N/Aifneq ($(MAKECMDGOALS),apache_doc)
119N/Aifneq ($(MAKECMDGOALS),clean_genRules)
301N/Aobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
285N/Agenerated_rule_files = $(patsubst %.hs,%
.der.hs,$(gendrifted_files))
0N/A# this variable holds the modules that should be documented
0N/A# the imported parsec library is not included!
116N/A####################################################################
301N/A.PHONY : clean d_clean real_clean bin_clean check hetana hetpa hetdg clean_genRules genRules
301N/A.SECONDARY : %.hs %.d $(generated_rule_files)
104N/A $(HC) -o hets $(HC_OPTS) $(objects)
221N/A $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make
221N/A###############################
301N/A### TAGS files for (x)emacs
221N/A# load them with "M-x" "visit-tags-table" from
219N/A# use "M-." to search for a tag
219N/A# !!Beware this is somewhat instable, because it uses an absolute path!!
301N/A###############################
301N/A### Documentation via haddock
219N/A $(HADDOCK) $(doc_sources) -o docs -h \
301N/A -t 'hets -- a heterogenous Specification (CASL) tool set'
301N/A $(MAKE) post_doc4apache
219N/A#############################
219N/A### ATC DrIFT-rule generation
301N/AgenRules: $(generated_rule_files)
301N/A$(generated_rule_files): $(genrule_files)
301N/A $(foreach file,$(atc_files),$(gen_atc_files))
301N/Arule = ShATermConvertible
221N/Agen_atc_files = if [ -f ATC/$(basename $(basename $(notdir $(file))))
.header.hs ]; then \
301N/Aatc_files := $(filter-out CASL/% HasCASL/% CspCASL/% Haskell/% ,$(genrule_files))
301N/Acasl_files := $(filter CASL/% ,$(genrule_files))
301N/Ahascasl_files := $(filter HasCASL/% ,$(genrule_files))
301N/Acspcasl_files := $(filter CspCASL/% ,$(genrule_files))
301N/Ahaskell_files := $(filter Haskell/%,$(genrule_files))
301N/A $(RM) $(generated_rule_files)
301N/A### removes *.hi and *.o in all include directories
301N/A for p in $(subst :, ,$(CLEAN_PATH)) . ; do \
301N/A (cd $$p ; $(RM) *.hi *.o) ; done
219N/A### additonally removes *.d (dependency files) in every include directory
221N/A for p in $(subst :, ,$(CLEAN_PATH)) . ; do \
235N/A### remove files also in own libraries
235N/A for p in $(subst :, ,$(COMMONLIB_PATH)) . ; do \
235N/A (cd $$p ; $(RM) *.hi *.d *.o) ; done
236N/A### additionally removes the files that define the sources-variable
251N/Areal_clean: bin_clean lib_clean
235N/A### additionally removes files not in CVS tree
222N/Adistclean: real_clean clean_genRules d_clean
301N/A####################################################################
301N/A####################################################################
301N/A### a parser to test annotation parser and Id parsers
301N/A $(HC) --make -o $@ $< $(HC_OPTS)
235N/A $(HC) --make -o $@ $< $(HC_OPTS)
227N/A $(HC) --make -o $@ $< $(HC_OPTS)
301N/A $(HC) --make -o $@ $< $(HC_OPTS)
301N/A $(HC) --make -o $@ $< $(HC_OPTS)
222N/A $(HC) --make -o $@ $< $(HC_OPTS)
227N/A $(HC) --make -o $@ $< $(HC_OPTS)
235N/A $(HC) --make -o $@ $< $(HC_OPTS)
235N/A### HetCASL with dev graph
227N/A### run tests in other directories
235N/A for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
301N/A####################################################################
235N/A## Preparing the version of HetCATS
227N/A####################################################################
172N/A $(DRIFT) $(DRIFT_OPTS) $< > $@
242N/A## compiling rules for object and interface files
235N/A## compiling rules for dependencies
172N/A $(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
235N/A $(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
172N/A####################################################################
172N/A## Setting a global search path (for dependency files)
172N/Aifneq ($(MAKECMDGOALS),clean)
172N/Aifneq ($(MAKECMDGOALS),real_clean)
301N/Aifneq ($(MAKECMDGOALS),d_clean)
251N/Aifneq ($(MAKECMDGOALS),real_clean)
251N/Aifneq ($(MAKECMDGOALS),distclean)
251N/Aifneq ($(MAKECMDGOALS),genRules)
251N/Aifneq ($(MAKECMDGOALS),clean_genRules)
251N/Aifeq ($(MAKECMDGOALS),hets-old)
172N/A## include every .d file in INCLUDE_PATH
104N/A-include $(objects:.o=.d)