From aa8c3540570f535b223c0e265f20b62822983e76 Mon Sep 17 00:00:00 2001 From: turbocat Date: Tue, 18 Jan 2022 17:24:09 +0000 Subject: [PATCH] TinyBasic 1.0.4 : uses auto import(KX). git-svn-id: svn://kolibrios.org@9649 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/tinybasic-1.0.4/Makefile | 31 ----------- programs/develop/tinybasic-1.0.4/Tupfile.lua | 51 +++++++++---------- .../develop/tinybasic-1.0.4/src/tinybasic.c | 2 +- 3 files changed, 26 insertions(+), 58 deletions(-) delete mode 100755 programs/develop/tinybasic-1.0.4/Makefile 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 */