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