From 2095b1381318a6f810dfd619f292eac98dc77e14 Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Fri, 11 Dec 2020 08:41:36 +0000 Subject: [PATCH] Add newlib example to bcc32 git-svn-id: svn://kolibrios.org@8364 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/bcc32/newlib_example/Makefile | 25 +++++++++++++++++++++++++ programs/bcc32/newlib_example/main.c | 6 ++++++ 2 files changed, 31 insertions(+) create mode 100755 programs/bcc32/newlib_example/Makefile create mode 100755 programs/bcc32/newlib_example/main.c diff --git a/programs/bcc32/newlib_example/Makefile b/programs/bcc32/newlib_example/Makefile new file mode 100755 index 0000000000..5fc1b03d34 --- /dev/null +++ b/programs/bcc32/newlib_example/Makefile @@ -0,0 +1,25 @@ +CC = wine bcc32 +MSVC = wine link +LD = kos32-ld + +SDK_DIR = $(abspath ../../../contrib/sdk) + +LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds --image-base 0 + +INCLUDES = -I$(SDK_DIR)/sources/newlib/libc/include +LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib + +SRC = main.c + +OBJ = $(patsubst %.c, %.obj, $(SRC)) + +default: $(patsubst %.c,%.obj,$(SRC)) + $(MSVC) -edit $(OBJ) + kos32-ld $(LDFLAGS) $(LIBPATH) --subsystem console -o main $(OBJ) -lgcc -lc.dll + objcopy main -O binary + +%.obj : %.c Makefile $(SRC) + $(CC) -c $(INCLUDES) $< + +clean: + rm *.o diff --git a/programs/bcc32/newlib_example/main.c b/programs/bcc32/newlib_example/main.c new file mode 100755 index 0000000000..21fa5cac09 --- /dev/null +++ b/programs/bcc32/newlib_example/main.c @@ -0,0 +1,6 @@ +int main() +{ + printf("hello"); + return 0; +} +