Tested the engine on linux
This commit is contained in:
@@ -14,11 +14,13 @@ OBJ = $(addprefix $(ODIR)/,$(TARGETS:../core/%.c=%.o)) $(addprefix $(ODIR)/,$(TE
|
||||
all: $(OBJ) $(TESTS:%.c=../$(OUTDIR)/%.exe)
|
||||
|
||||
../$(OUTDIR)/%.exe: $(ODIR)/%.o
|
||||
@$(CC) -o $@ $< $(TARGETS:../core/%.c=$(ODIR)/%.o) $(CFLAGS) -L../$(LIBDIR) $(LIBS)
|
||||
cp ../$(LIBDIR)/*.dll ../$(OUTDIR)
|
||||
ifeq ($(shell uname),Linux)
|
||||
@$(CC) -o $@ $< $(TARGETS:../core/%.c=$(ODIR)/%.o) $(CFLAGS) -Wl,-rpath,../out -L../$(LIBDIR) $(LIBS)
|
||||
cp ../$(LIBDIR)/*.so ../$(OUTDIR)
|
||||
valgrind --leak-check=full --track-origins=yes $@
|
||||
else
|
||||
@$(CC) -o $@ $< $(TARGETS:../core/%.c=$(ODIR)/%.o) $(CFLAGS) -L../$(LIBDIR) $(LIBS)
|
||||
cp ../$(LIBDIR)/*.dll ../$(OUTDIR)
|
||||
$@
|
||||
endif
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
//suppress the print keyword
|
||||
static void noPrintFn(const char* output) {
|
||||
//NO OP
|
||||
}
|
||||
|
||||
//compilation functions
|
||||
char* readFile(char* path, size_t* fileSize) {
|
||||
FILE* file = fopen(path, "rb");
|
||||
@@ -87,6 +92,7 @@ int main() {
|
||||
//setup interpreter
|
||||
Interpreter interpreter;
|
||||
initInterpreter(&interpreter);
|
||||
setInterpreterPrint(&interpreter, noPrintFn);
|
||||
|
||||
size_t size = 0;
|
||||
|
||||
@@ -113,6 +119,7 @@ int main() {
|
||||
//setup interpreter
|
||||
Interpreter interpreter;
|
||||
initInterpreter(&interpreter);
|
||||
setInterpreterPrint(&interpreter, noPrintFn);
|
||||
|
||||
size_t size = 0;
|
||||
|
||||
@@ -134,6 +141,8 @@ int main() {
|
||||
resetInterpreter(&interpreter);
|
||||
|
||||
pushEngineNode(&node, &child);
|
||||
|
||||
free((void*)source);
|
||||
}
|
||||
|
||||
//test the calls
|
||||
|
||||
Reference in New Issue
Block a user