tock-mirror/Makefile
Neil Brown 935d69d544 C++CSP Backend Added
C++CSP backend has been added.  It consists of a support header file and one new Haskell module: GenerateCPPCSP

The module is largely based on GenerateC, changed as needed.  
There is a large section at the bottom of the file with verbatim copy-and-paste from GenerateC,
due to wanting the same functionality, but for calls to use my C++CSP generation not the C generation -- 
hence I cannot simply import those functions.

The backend can generate code for cgtests 0 through 16 (incl) that will compile as valid C++.  The majority of the
tests pass when run (some do segfault, admittedly).  However some arrays still need more testing/work, particularly:
- timers
- array slices
- retyping

The tock_support_cppcsp.h header makes use of tock_support.h, but I had to add a few #ifnders to the latter
file so that I can use it with C++CSP and block out some of the CIF stuff.
2007-07-26 21:11:01 +00:00

67 lines
1.2 KiB
Makefile

targets = tock
all: $(targets)
sources = \
AST.hs \
CompState.hs \
Errors.hs \
EvalConstants.hs \
EvalLiterals.hs \
GenerateC.hs \
GenerateCPPCSP.hs \
Indentation.hs \
Intrinsics.hs \
Main.hs \
Metadata.hs \
Parse.hs \
Pass.hs \
PrettyShow.hs \
SimplifyExprs.hs \
SimplifyProcs.hs \
SimplifyTypes.hs \
TLP.hs \
Types.hs \
Unnest.hs \
Utils.hs
# profile_opts = -prof -auto-all
$(targets): $(sources)
ghc -fglasgow-exts -fallow-undecidable-instances $(profile_opts) -o tock --make Main
CFLAGS = \
-O2 \
-g -Wall \
-std=gnu99 -fgnu89-inline \
`kroc --cflags` `kroc --ccincpath`
%.tock.c: %.occ tock
./tock -v -o $@ $<
indent -kr -pcs $@
%: %.tock.o tock_support.h kroc-wrapper-c.o kroc-wrapper.occ
kroc -o $@ kroc-wrapper.occ $< kroc-wrapper-c.o -lcif
cgtests = $(wildcard cgtests/cgtest??.occ)
cgtests_targets = $(patsubst %.occ,%,$(cgtests))
get-cgtests:
svn co https://subversion.frmb.org/svn/cgtests/trunk cgtests
all-cgtests: $(cgtests_targets)
clean-cgtests:
rm -f cgtests/cgtest?? cgtests/*.tock.*
haddock:
@mkdir -p doc
haddock -o doc --html $(sources)
clean:
rm -f $(targets) *.o *.hi
# Don't delete intermediate files.
.SECONDARY: