mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 16:31:16 +00:00
39dcf0e016
Utilize new stkrc -O4 option for optimization during translation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16168 91177308-0d34-0410-b5e6-96231b3b80d8
68 lines
1.9 KiB
Makefile
68 lines
1.9 KiB
Makefile
##===- projects/Stacker/test/Makefile ----------------------*- Makefile -*-===##
|
|
#
|
|
# This is the makefile that tests the various facilities of the Stacker language
|
|
#
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
#
|
|
# Indicates our relative path to the top of the project's root directory.
|
|
#
|
|
LEVEL = ../
|
|
|
|
#
|
|
# Directories that need to be built.
|
|
#
|
|
DIRS =
|
|
|
|
#
|
|
# Include the Master Makefile that knows how to build all.
|
|
#
|
|
include $(LEVEL)/Makefile.common
|
|
|
|
LOGIC_TESTS = eq ne le ge gt lt false true
|
|
BITWISE_TESTS = shl shr xor or and
|
|
ARITHMETIC_TESTS = abs neg add sub mul div mod star_slash incr decr min max
|
|
STACK_TESTS = drop drop2 nip nip2 dup dup2 swap swap2 over over2 rot rot2 \
|
|
rrot rrot2 tuck tuck2 roll pick select
|
|
MEMORY_TESTS = memory
|
|
CONTROL_TESTS = while return
|
|
IO_TESTS = space tab out_chr out_num out_str
|
|
|
|
TESTS = $(LOGIC_TESTS) $(ARITHMETIC_TESTS) $(BITWISE_TESTS) $(STACK_TESTS) \
|
|
$(MEMORY_TESTS) $(CONTROL_TESTS) $(IO_TESTS)
|
|
|
|
STKRC_EXEC = $(BUILD_OBJ_ROOT)/tools/$(CONFIGURATION)/stkrc
|
|
|
|
all :: test_each
|
|
|
|
test_each: $(TESTS)
|
|
@$(ECHO) "Running Tests..."
|
|
$(VERB) LD_LIBRARY_PATH=$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) $(BUILD_SRC_DIR)/runtests $(BUILD_OBJ_DIR) $(TESTS)
|
|
|
|
%.bc : %.st Makefile
|
|
@$(ECHO) "Compiling And Optimizing $< to $*.bc"
|
|
$(VERB)$(STKRC_EXEC) -f -O4 -s 2048 -o $*.bc $(BUILD_SRC_DIR)/$*.st
|
|
|
|
%.s : %.bc
|
|
@$(ECHO) "Assembling $< to $*.s"
|
|
$(VERB)$(LLC) -f -o $*.s $*.bc
|
|
|
|
% : %.s testing.s
|
|
@$(ECHO) "Linking $*"
|
|
$(VERB)$(CC) -ggdb -L$(BUILD_OBJ_ROOT)/lib/$(CONFIGURATION) testing.s -lstkr_runtime -o $* $*.s
|
|
|
|
%.ll : %.bc
|
|
@$(ECHO) "Disassembling $< to $*.ll"
|
|
$(VERB)$(LDIS) -dis -o $*.ll $<
|
|
|
|
TESTS_LL = $(TESTS:%=%.ll)
|
|
TESTS_BC = $(TESTS:%=%.bc)
|
|
TESTS_S = $(TESTS:%=%.s)
|
|
|
|
clean ::
|
|
$(VERB)rm -f gmon.out $(TESTS_LL) $(TESTS_BC) $(TESTS_S) $(TESTS) testing.bc testing.s testing.ll
|
|
|
|
.SUFFIXES: .st .s .ll .bc
|
|
.PRECIOUS: %.s %.ll %.bc %.st
|
|
.PHONY: test_each
|