translator: fix memory lib in makefile and test engine

This commit is contained in:
Alexey Stepanov
2016-08-18 18:55:13 +03:00
parent 502384f382
commit 8c3f100d24
6 changed files with 12 additions and 8 deletions
+2 -2
View File
@@ -11,14 +11,14 @@ CC=clang-3.6
CCFLAGS_ARM=-g -S -Wall -m32 -emit-llvm -nostdlib -ffreestanding -march=armv7-m -mthumb -flto -O0 -target arm-none-eabi -DARM
CCFLAGS=-g -O0 -S -Wall -emit-llvm -nostdlib -ffreestanding
CCFLAGS_DEBUG=-g -O0 -S -Wall -emit-llvm -nostdlib -ffreestanding -DDEBUG
CCFLAGS_DEBUG=-g -O0 -S -Wall -emit-llvm -nostdlib -ffreestanding -DDBG
LLINK_FLAGS=-S
KT_ALL_DEPS=java -jar $(KT)
LLINK_ALL_DEPS=$(LLINK) $(LLINK_FLAGS) $(filter %.ll,$^) > $@
all: memory $(BUILD_DIR) $(BUILD_DIR)/stdlib_arm.ll $(BUILD_DIR)/stdlib_x86.ll
debug: memory_debug
debug: memory_debug $(BUILD_DIR) $(BUILD_DIR)/stdlib_arm.ll $(BUILD_DIR)/stdlib_x86.ll
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
+3 -2
View File
@@ -25,8 +25,9 @@ int dynamic_heap_max = 0;
char* malloc(int);
#endif
#ifdef DEBUG
#ifdef DBG
static int total = 0;
int printf(const char * restrict format, ... );
#endif
char* malloc_heap(int size) {
@@ -37,7 +38,7 @@ char* malloc_heap(int size) {
return ptr;
#else
#ifdef DEBUG
#ifdef DBG
total = total + size;
printf("Alloc [%d] TOTAL: [%d]\n", size, total);
#endif
-1
View File
@@ -8,6 +8,5 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="protokot-runtime" level="project" />
</component>
</module>
-1
View File
@@ -16,6 +16,5 @@
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-runtime:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="protokot-runtime" level="project" />
</component>
</module>
+1 -1
View File
@@ -10,13 +10,13 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="translator_main" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-compiler:1.0.3" level="project" />
<orderEntry type="library" name="Gradle: com.github.jshmrsn:karg:a636b3e" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-runtime:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="protokot-runtime" level="project" />
</component>
<component name="TestModuleProperties" production-module="translator_main" />
</module>
+6 -1
View File
@@ -14,7 +14,12 @@ if [ $? -ne 0 ]; then
exit 1
fi
cd ../kotstd && make clean && make
if [ "$3" == "--debug" ]; then
cd ../kotstd && make clean && make debug
else
cd ../kotstd && make clean && make
fi
if [ $? -ne 0 ]; then
echo -e "${red}Error building kotstd lib${nc}"
exit 1