diff --git a/programs/develop/tinybasic-1.0.4/Makefile b/programs/develop/tinybasic-1.0.4/Makefile index 6167905caf..5f72fe988c 100755 --- a/programs/develop/tinybasic-1.0.4/Makefile +++ b/programs/develop/tinybasic-1.0.4/Makefile @@ -1,5 +1,5 @@ KTCC_DIR=../ktcc/trunk -KLIBC_DIR = ../libraries/kolibri-libc +KLIBC_DIR = $(KTCC_DIR)/libc.obj NAME=bin/tinybas.kex diff --git a/programs/develop/tinybasic-1.0.4/Tupfile.lua b/programs/develop/tinybasic-1.0.4/Tupfile.lua new file mode 100644 index 0000000000..82726802a7 --- /dev/null +++ b/programs/develop/tinybasic-1.0.4/Tupfile.lua @@ -0,0 +1,26 @@ +if tup.getconfig("NO_TCC") ~= "" then return end + +TCC="kos32-tcc" + +CFLAGS = "-I../ktcc/trunk/libc.obj/include -I inc" +LDFLAGS = "-nostdlib -L../ktcc/trunk/bin/lib ../ktcc/trunk/bin/lib/crt0.o" + +LIBS = "-ltcc -lc.obj" + +SRC={"src/common.c", + "src/errors.c", + "src/expression.c", + "src/formatter.c", + "src/generatec.c", + "src/interpret.c", + "src/options.c", + "src/parser.c", + "src/statement.c", + "src/tinybasic.c", + "src/token.c", + "src/tokeniser.c", +}; + + +COMMAND=string.format("%s %s %s %s %s", TCC, CFLAGS, LDFLAGS, "%f -o %o", LIBS) +tup.rule(SRC, COMMAND .. tup.getconfig("KPACK_CMD"), "tinybasic") diff --git a/programs/develop/tinybasic-1.0.4/src/tinybasic.c b/programs/develop/tinybasic-1.0.4/src/tinybasic.c index 355cadc841..5f375cff3e 100644 --- a/programs/develop/tinybasic-1.0.4/src/tinybasic.c +++ b/programs/develop/tinybasic-1.0.4/src/tinybasic.c @@ -20,8 +20,9 @@ #include "generatec.h" #ifdef _KOLIBRI + #include #define KTCC_BIN "/kolibrios/develop/tcc/tcc" - #define KTCC_FLAGS "%s -o %s -lck" + #define KTCC_FLAGS "-nobss %s -o %s -ltcc -lc.obj" #endif /* static variables */ @@ -300,15 +301,12 @@ static void output_exe (char *command, char *basic_filename) { #else sprintf(final_command, KTCC_FLAGS, c_filename, exe_filename); if(!_ksys_exec(KTCC_BIN, final_command)){ - printf(final_command); - }else{ printf("Bad command: %s %s\n", KTCC_BIN, final_command); exit(0); } #endif } - /* * Top Level Routine */