File: Makefile

package info (click to toggle)
jocaml 3.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,740 kB
  • sloc: ml: 107,815; ansic: 36,537; sh: 5,467; asm: 5,359; lisp: 4,041; makefile: 2,527; perl: 45; fortran: 21; sed: 19; cs: 9; tcl: 2
file content (25 lines) | stat: -rw-r--r-- 926 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
default: compile run

compile:
	@for f in *.ml; do \
	  $(OCAMLC) -w a -o `basename $$f ml`bytecode $$f; \
	  $(OCAMLOPT) -w a -o `basename $$f ml`native $$f; \
	done
	@if [ ! `grep -c HAS_STACK_OVERFLOW_DETECTION ../../../config/s.h` ]; then \
	  rm -f stackoverflow.byte stackoverflow.native; \
	fi

run:
	@for f in *.bytecode; do \
	  printf " ... testing '$$f':"; \
	  (./$$f > $$f.result 2>&1; true); \
	  diff -q $$f.reference $$f.result > /dev/null || (echo " => failed" && exit 1) && echo " => passed"; \
	  printf " ... testing '`basename $$f bytecode`native':"; \
	  (./`basename $$f bytecode`native > `basename $$f bytecode`native.result 2>&1; true); \
	  diff -q `basename $$f bytecode`native.reference `basename $$f bytecode`native.result > /dev/null || (echo " => failed" && exit 1) && echo " => passed"; \
	done

clean: defaultclean
	@rm -f *.bytecode *.native *.result

include ../../makefiles/Makefile.common