Makefile revision 9db48b4604636bfdf03e60890fc094b7bec775dc
e6d40133bc9f858308654afb1262b8b483ec5922Till Mossakowski# Author: Klaus L�ttich
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder# This Makefile will compile the new hetcats system and provides also
3f69b6948966979163bdfe8331c38833d5d90ecdChristian Maeder# targets for test programs during implementation phases.
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder# !!! Note: This makefile is written for GNU make !!!
f3a94a197960e548ecd6520bb768cb0d547457bbChristian Maeder# (gmake on solaris ; make on linux)
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder####################################################################
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder## Some varibles, which control the compilation
9929f81562adecc8aafaefb14a0159afcf4a3351Christian MaederINCLUDE_PATH = ../parsec:../haterm-1.0/src:../fgl:../pretty:..:../CASL:../HasCASL:../aterm_conv:../ghc
9929f81562adecc8aafaefb14a0159afcf4a3351Christian MaederHC_FLAGS = -fglasgow-exts -fallow-overlapping-instances -Wall
e83ed59502a681713982f25c559aae77a4145734Christian Maeder### Profiling and Warnings (only for debugging)
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### Attention every module must be compiled with profiling or the linker
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### cannot link the various .o files properly. So after switching on
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### Profiling, do an 'gmake clean; gmake'
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### If you need Profiling comment out the following line
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder# HC_PROF = -prof -auto-all -Wall
e83ed59502a681713982f25c559aae77a4145734Christian MaederHCI_OPTS = $(HC_FLAGS) $(HC_PACKAGE) $(HC_INCLUDE)
e83ed59502a681713982f25c559aae77a4145734Christian Maeder### list of directories to run checks in
e83ed59502a681713982f25c559aae77a4145734Christian Maeder####################################################################
e83ed59502a681713982f25c559aae77a4145734Christian Maeder## sources for hetcats (semi - manually produced with a perl script)
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maederobjects = $(patsubst %.lhs,%.o,$(sources:%.hs=%.o))
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maederdrifted_files = ../AS_Architecture.hs ../AS_Library.hs ../AS_Annotation.hs\
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder../CASL/AS_Basic_CASL.hs ../AS_Structured.hs
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder####################################################################
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder.PHONY : clean d_clean real_clean bin_clean check
2eb84fc82d3ffa9116bc471fda3742bd9e5a24bbChristian Maederhetcats-make: hetcats.lhs ../utils/create_sources.pl $(drifted_files)
749d29b3119ff42bf90ccf341892ef91df8269a2Christian Maeder $(HC) --make -o hetcats $< $(HC_OPTS) 2>&1 | tee hetcats-make && \
35db0960aa2e2a13652381c756fae5fb2b27213bChristian Maeder $(PERL) ../utils/create_sources.pl hetcats-make sources_hetcats.mk
42c01284bba8d7c8d995c8dfb96ace57d28ed1bcTill Mossakowski###############
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### removes *.hi and *.o in all include directories
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder for p in $(subst :, ,$(INCLUDE_PATH)) . ; do \
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### additionally removes binaries
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder### additonally removes *.d (dependency files) in every include directory
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### also delete *.d.bak (dependency file backups)
083679daeba30fce9d60f7170a2cfd9f9c80bfb2Till Mossakowski for p in $(subst :, ,$(INCLUDE_PATH)) . ; do \
e33e3b425e953236b4617870f995d263ac35b883Christian Maeder### additionally removes the files that define the sources-variable
3a3bbc51abf804d91bc9d8e0f2ce745cfae4c9c7Christian Maeder### additionally removes files not in CVS tree
e83ed59502a681713982f25c559aae77a4145734Christian Maeder####################################################################
083679daeba30fce9d60f7170a2cfd9f9c80bfb2Till Mossakowski### test targets
083679daeba30fce9d60f7170a2cfd9f9c80bfb2Till Mossakowski####################################################################
e83ed59502a681713982f25c559aae77a4145734Christian Maeder### a parser to test annotation parser and Id parsers
3a3bbc51abf804d91bc9d8e0f2ce745cfae4c9c7Christian Maedertest_parser: ../test_parser.hs $(drifted_files)
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### interactive
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder### christian's target
1865083b72c1307e9040d78c2743abd5a54ee260Christian Maeder### CASL parser
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### HasCASL parser
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maederhacapa: ../HasCASL/hacapa.lhs $(drifted_files)
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder $(HC) --make -o ../HasCASL/$@ $< $(HC_OPTS)
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder### run tests in other directories
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder for i in $(TESTDIRS); do $(MAKE) -C $$i check; done
e83ed59502a681713982f25c559aae77a4145734Christian Maeder####################################################################
e83ed59502a681713982f25c559aae77a4145734Christian Maeder## Preparing the version of HetCATS
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder $(PERL) ../utils/build_version.pl version_nr < Version.in > $@
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder## two hardcoded dependencies for a correct generation of Version.hs
1509ea46b471bef1c5e70864fb1cfc0a5280266bChristian Maeder####################################################################
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder## rules for DrIFT
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder## compiling rules for object and interface files
9929f81562adecc8aafaefb14a0159afcf4a3351Christian Maeder## compiling rules for dependencies
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder####################################################################
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder## Setting a global search path (for dependency files)
eb483f2216949400bfef8f6deb5320f071445626Christian Maeder## include every .d file in INCLUDE_PATH