• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2# default values....
3
4CSHARP_CC=$(CSHARP_PATH)/bin/mcs
5MONO_JIT=$(CSHARP_PATH)/bin/mono
6
7# common build environment
8
9ifeq ($(NEOTONIC_ROOT),)
10NEOTONIC_ROOT = ..
11endif
12
13include $(NEOTONIC_ROOT)/rules.mk
14
15# our targets
16
17TARGETS = clearsilver.dll cstest.exe csperftest.exe testcs
18
19all: $(TARGETS)
20
21clearsilver.dll: CS.cs
22	$(CSHARP_CC) -target:library -unsafe CS.cs -out:clearsilver.dll
23
24cstest.exe: clearsilver.dll ../dso/libneo.so cstest.cs
25	$(CSHARP_CC) -r:clearsilver.dll -unsafe cstest.cs
26
27csperftest.exe: clearsilver.dll ../dso/libneo.so csperftest.cs
28	$(CSHARP_CC) -r:clearsilver.dll -unsafe csperftest.cs
29
30perf: csperftest.exe
31	export LD_LIBRARY_PATH=../dso; \
32	$(MONO_JIT) csperftest.exe
33
34
35testcs: cstest.exe
36	@echo "Running csharp test"
37	@failed=0; \
38	rm -f cstest.out; \
39	export LD_LIBRARY_PATH=../dso; \
40	$(MONO_JIT) cstest.exe > cstest.out; \
41	diff cstest.out cstest.gold > /dev/null; \
42	return_code=$$?; \
43	if [ $$return_code -ne 0 ]; then \
44	  diff cstest.out cstest.gold > cstest.err; \
45	  echo "Failed csharp test: cstest.cs"; \
46	  echo "    See cstest.out and cstest.err"; \
47	  failed=1; \
48	fi; \
49	if [ $$failed -eq 1 ]; then \
50	  exit 1; \
51	fi;
52	@echo "Passed csharp test"
53
54gold: cstest.exe
55	export LD_LIBRARY_PATH=../dso; \
56	$(MONO_JIT) cstest.exe > cstest.gold;
57	@echo "Generated gold files"
58
59
60clean:
61	rm -f core.*
62
63distclean:
64	rm -f $(TARGETS) core.* Makefile.depend
65