translator: rearrange code in kotstd, fix makefiles and run tests

This commit is contained in:
Alexey Stepanov
2016-09-02 19:22:26 +03:00
parent c1b8bcb517
commit a53e173433
29 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -34,4 +34,4 @@ proto/compiler/google/src/google/protobuf/compiler/kotlin/bin
proto/compiler/google/src/google/protobuf/compiler/kotlin/protoc
# translator auto generated artifacts
kotstd/lib/arm/memory.ll
kotstd/ll
+2 -5
View File
@@ -1,10 +1,10 @@
BUILD_DIR=$(PWD)/build
INCLUDE_DIR=$(PWD)/include
LIB_DIR=$(PWD)/lib
LIB_DIR=$(PWD)/ll
LIB_ARM_DIR=$(LIB_DIR)/arm
LIB_X86_DIR=$(LIB_DIR)/x86
LIBC=$(PWD)/libc
LIBC=$(PWD)/c
LLVM_ARM_FILES = $(patsubst $(LIBC)/%.c,$(LIB_ARM_DIR)/%.ll,$(wildcard $(LIBC)/*.c))
LLVM_X86_FILES = $(patsubst $(LIBC)/%.c,$(LIB_X86_DIR)/%.ll,$(wildcard $(LIBC)/*.c))
@@ -53,8 +53,5 @@ clean:
rm -rf $(BUILD_DIR)
rm -rf $(LIB_DIR)
aaa:
@echo $(LLVM_ARM_FILES)
.PHONY: all clean
+11 -2
View File
@@ -16,6 +16,15 @@ stdlib:
tests: stdlib $(OBJECTS)
@date
.DEFAULT_GOAL := tests
.PHONY: tests, stdlib
build:
./gradlew jar
all: build tests;
clean:
./gradlew clean
.DEFAULT_GOAL := all
.FORCE: build, all
.PHONY: tests, stdlib, build, all
+2 -1
View File
@@ -3,6 +3,7 @@ green='\033[0;32m'
red='\033[0;31m'
lightRed='\033[1;31m'
orange='\033[0;33m'
KOTSTD='../kotstd/kt'
cd ../translator
@@ -57,7 +58,7 @@ if [ -f "$DIRECTORY/$TEST/$TEST.c" ]
fi
fi
java -jar build/libs/translator-1.0.jar -I ../kotstd/include $DIRECTORY/$TEST/$TEST.kt > $DIRECTORY/$TEST/linked/$TEST.ll
java -jar build/libs/translator-1.0.jar -I $KOTSTD $DIRECTORY/$TEST/$TEST.kt > $DIRECTORY/$TEST/linked/$TEST.ll
if [ $? -ne 0 ]; then
echo -e "${orange}test: ${TEST}${nc}"
+2 -1
View File
@@ -4,6 +4,7 @@ red='\033[0;31m'
lightRed='\033[1;31m'
orange='\033[0;33m'
nc='\033[0m'
KOTSTD='../kotstd/kt'
if [ "$3" == "--debug" ]; then
cd ../kotstd && make clean && make debug
@@ -74,7 +75,7 @@ for i in $TESTS; do
fi
fi
java -jar build/libs/translator-1.0.jar -I ../kotstd/include $DIRECTORY/$TEST/$TEST.kt > $DIRECTORY/$TEST/linked/$TEST.ll
java -jar build/libs/translator-1.0.jar -I $KOTSTD $DIRECTORY/$TEST/$TEST.kt > $DIRECTORY/$TEST/linked/$TEST.ll
if [ $? -ne 0 ]; then
echo -e "${red}Translation error: ${DIRECTORY}/$TEST/${TEST}.kt${nc}"