220N/A# This Makefile will compile the new hetcats system and provides also
220N/A# targets for test programs during implementation phases.
220N/A# !!! Note: This makefile is written for GNU make !!!
220N/A# (gmake on solaris ; make on linux)
220N/A####################################################################
220N/A## Some varibles, which control the compilation
220N/AINCLUDE_PATH = ghc:hetcats
220N/ACLEAN_PATH = Common:Logic:CASL:Syntax:Static:GUI:HasCASL:Haskell:
Haskell/Language:Modal:CspCASL:$(INCLUDE_PATH)
220N/AHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
220N/AHC_INCLUDE = -i$(INCLUDE_PATH)
220N/A### Profiling and Warnings (only for debugging)
220N/A### Attention every module must be compiled with profiling or the linker
220N/A### cannot link the various .o files properly. So after switching on
220N/A### Profiling, do an 'gmake clean; gmake'
220N/A### If you need Profiling comment out the following line
220N/A#HC_PROF = -prof -auto-all -Wall
220N/AHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
417N/AHC_OPTS = $(HCI_OPTS) $(HC_PROF)
220N/A### list of directories to run checks in
220N/ATESTDIRS = CASL HasCASL test
220N/A####################################################################
220N/A## sources for hetcats (semi - manually produced with a perl script)
220N/Aifneq ($(MAKECMDGOALS),clean)
220N/Aifneq ($(MAKECMDGOALS),bin_clean)
220N/Aifneq ($(MAKECMDGOALS),d_clean)
220N/Aifneq ($(MAKECMDGOALS),real_clean)
220N/Aifneq ($(MAKECMDGOALS),distclean)
220N/Aobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
220N/A# this variable holds the modules that should be documented
220N/A# the imported parsec library is not included!
220N/A####################################################################
220N/A.PHONY : clean d_clean real_clean bin_clean check
220N/A $(HC) -o $@ $(HC_OPTS) $(objects)
220N/A $(HC) --make -o hets $< $(HC_OPTS) 2>&1 | tee hetcats-make && \
220N/A###############################
220N/A### TAGS files for (x)emacs
220N/A# load them with "M-x" "visit-tags-table" from
220N/A# use "M-." to search for a tag
220N/A# !!Beware this is somewhat instable, because it uses an absolute path!!
417N/A###############################
417N/A### Documentation via haddock
417N/A $(HADDOCK) $(doc_sources) -o docs -h \
417N/A -t 'hets -- a heterogenous Specification (CASL) tool set'
220N/A### removes *.hi and *.o in all include directories
220N/A for p in $(subst :, ,$(CLEAN_PATH)) . ; do \
220N/A (cd $$p ; $(RM) *.hi *.o) ; done
220N/A### additonally removes *.d (dependency files) in every include directory
220N/A for p in $(subst :, ,$(CLEAN_PATH)) . ; do \
220N/A### remove files also in own libraries
220N/A for p in $(subst :, ,$(COMMONLIB_PATH):$(CLEANPATH)) . ; do \
220N/A (cd $$p ; $(RM) *.hi *.d *.o) ; done
220N/A### additionally removes the files that define the sources-variable
220N/Areal_clean: bin_clean lib_clean
220N/A### additionally removes files not in CVS tree
220N/A####################################################################
220N/A####################################################################
220N/A### a parser to test annotation parser and Id parsers
220N/A $(HC) --make -o $@ $< $(HC_OPTS)
220N/A $(HC) --make -o $@ $< $(HC_OPTS)
220N/A $(HC) --make -o $@ $< $(HC_OPTS)
220N/A $(HC) --make -o $@ $< $(HC_OPTS)
220N/A $(HC) --make -o $@ $< $(HC_OPTS)
220N/A $(HC) --make -o $@ $< $(HC_OPTS)
220N/A $(HC) --make -o $@ $< $(HC_OPTS)
220N/A### HetCASL with dev graph
220N/A### run tests in other directories
417N/A for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
220N/A####################################################################
220N/A## Preparing the version of HetCATS
220N/A####################################################################
220N/A## compiling rules for object and interface files
220N/A## compiling rules for dependencies
220N/A $(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
220N/A $(HC) -M $< $(HC_OPTS) -optdep-f -optdep$@
220N/A####################################################################
220N/A## Setting a global search path (for dependency files)
220N/Aifneq ($(MAKECMDGOALS),clean)
220N/Aifneq ($(MAKECMDGOALS),real_clean)
220N/Aifneq ($(MAKECMDGOALS),d_clean)
220N/Aifneq ($(MAKECMDGOALS),real_clean)
220N/Aifneq ($(MAKECMDGOALS),distclean)
220N/A## include every .d file in INCLUDE_PATH
220N/A-include $(objects:.o=.d)