Home | History | Annotate | Download | only in csharp
      1 
      2 # default values....
      3 
      4 CSHARP_CC=$(CSHARP_PATH)/bin/mcs
      5 MONO_JIT=$(CSHARP_PATH)/bin/mono
      6 
      7 # common build environment
      8 
      9 ifeq ($(NEOTONIC_ROOT),)
     10 NEOTONIC_ROOT = ..
     11 endif
     12 
     13 include $(NEOTONIC_ROOT)/rules.mk
     14 
     15 # our targets
     16 
     17 TARGETS = clearsilver.dll cstest.exe csperftest.exe testcs
     18 
     19 all: $(TARGETS)
     20 
     21 clearsilver.dll: CS.cs
     22 	$(CSHARP_CC) -target:library -unsafe CS.cs -out:clearsilver.dll
     23 
     24 cstest.exe: clearsilver.dll ../dso/libneo.so cstest.cs
     25 	$(CSHARP_CC) -r:clearsilver.dll -unsafe cstest.cs 
     26 
     27 csperftest.exe: clearsilver.dll ../dso/libneo.so csperftest.cs
     28 	$(CSHARP_CC) -r:clearsilver.dll -unsafe csperftest.cs
     29 
     30 perf: csperftest.exe
     31 	export LD_LIBRARY_PATH=../dso; \
     32 	$(MONO_JIT) csperftest.exe 
     33 	
     34 
     35 testcs: 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 
     54 gold: cstest.exe
     55 	export LD_LIBRARY_PATH=../dso; \
     56 	$(MONO_JIT) cstest.exe > cstest.gold;
     57 	@echo "Generated gold files"
     58 
     59 
     60 clean:
     61 	rm -f core.*
     62 
     63 distclean:
     64 	rm -f $(TARGETS) core.* Makefile.depend
     65