1 ##===- projects/Stacker/test/Makefile ----------------------*- Makefile -*-===##
3 # This is the makefile that tests the various facilities of the Stacker language
5 ##===----------------------------------------------------------------------===##
8 # Indicates our relative path to the top of the project's root directory.
13 # Directories that need to be built.
18 # Include the Master Makefile that knows how to build all.
20 include $(LEVEL)/Makefile.common
22 LOGIC_TESTS = eq ne le ge gt lt false true
23 BITWISE_TESTS = shl shr xor or and
24 ARITHMETIC_TESTS = abs neg add sub mul div mod star_slash incr decr min max
25 STACK_TESTS = drop drop2 nip nip2 dup dup2 swap swap2 over over2 rot rot2 \
26 rrot rrot2 tuck tuck2 roll pick select
28 CONTROL_TESTS = while return
29 IO_TESTS = space tab out_chr out_num out_str
31 TESTS = $(LOGIC_TESTS) $(ARITHMETIC_TESTS) $(BITWISE_TESTS) $(STACK_TESTS) \
32 $(MEMORY_TESTS) $(CONTROL_TESTS) $(IO_TESTS)
34 LLVMC = $(LLVMToolDir)/llvmc
39 $(Echo) "Running Tests..."
40 $(Verb) LD_LIBRARY_PATH=$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) \
41 $(BUILD_SRC_DIR)/runtests $(BUILD_OBJ_DIR) $(TESTS)
43 % : %.st Makefile testing.bc
45 $(Verb)$(LLVMC) -O4 -o $@ $< testing.bc $(LibDir)/stkr_runtime.bc -lcrtend
47 testing.bc : testing.st Makefile
48 $(Echo) "Compiling $*"
49 $(Verb)$(LLVMC) -O3 -c -o $@ $<
51 TESTS_LL = $(TESTS:%=%.ll)
52 TESTS_BC = $(TESTS:%=%.bc)
53 TESTS_S = $(TESTS:%=%.s)
56 $(Verb)rm -f gmon.out $(TESTS_LL) $(TESTS_BC) $(TESTS_S) $(TESTS) \
57 testing.bc testing.s testing.ll
59 .SUFFIXES: .st .s .ll .bc
60 .PRECIOUS: %.s %.ll %.bc %.st