diff --git a/programs/develop/tinybasic-1.0.4/Makefile b/programs/develop/tinybasic-1.0.4/Makefile deleted file mode 100755 index 5f72fe988c..0000000000 --- a/programs/develop/tinybasic-1.0.4/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -KTCC_DIR=../ktcc/trunk -KLIBC_DIR = $(KTCC_DIR)/libc.obj - -NAME=bin/tinybas.kex - -KTCC=$(KTCC_DIR)/bin/kos32-tcc -KPACK=kpack - -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 - -CFLAGS= -D_KOLIBRI -I$(KLIBC_DIR)/include -I inc -LFLAGS= -nobss -nostdlib -L $(KLIBC_DIR)/lib $(KLIBC_DIR)/lib/crt0.o -LIBS = -ltcc -lc.obj - -all: - $(KTCC) $(CFLAGS) $(SRC) $(LFLAGS) $(LIBS) -o $(NAME) - $(KPACK) $(NAME) - -clean: - rm $(NAME) diff --git a/programs/develop/tinybasic-1.0.4/Tupfile.lua b/programs/develop/tinybasic-1.0.4/Tupfile.lua index 4ac3f02fbe..7693aeb861 100644 --- a/programs/develop/tinybasic-1.0.4/Tupfile.lua +++ b/programs/develop/tinybasic-1.0.4/Tupfile.lua @@ -1,26 +1,25 @@ -if tup.getconfig("NO_TCC") ~= "" then return end - -TCC="kos32-tcc" - -CFLAGS = "-D_KOLIBRI -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") +if tup.getconfig("NO_TCC") ~= "" then return end +if tup.getconfig("HELPERDIR") == "" +then + HELPERDIR = "../../../programs" +end +tup.include(HELPERDIR .. "/use_tcc.lua") + +CFLAGS = CFLAGS .. " -Iinc " + +SRCS = { + "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" +} + +link_tcc(SRCS, "tinybasic"); diff --git a/programs/develop/tinybasic-1.0.4/src/tinybasic.c b/programs/develop/tinybasic-1.0.4/src/tinybasic.c index 5f375cff3e..fcb69dca97 100644 --- a/programs/develop/tinybasic-1.0.4/src/tinybasic.c +++ b/programs/develop/tinybasic-1.0.4/src/tinybasic.c @@ -22,7 +22,7 @@ #ifdef _KOLIBRI #include #define KTCC_BIN "/kolibrios/develop/tcc/tcc" - #define KTCC_FLAGS "-nobss %s -o %s -ltcc -lc.obj" + #define KTCC_FLAGS "-nobss %s -o %s" #endif /* static variables */