From 4e324c86129d46d9cec9adddec0bce82fd7bd0fb Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Wed, 6 Apr 2022 15:32:56 +0000 Subject: [PATCH] Samples fix #2 + fridge makefile change git-svn-id: svn://kolibrios.org@9759 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/sdk/samples/cpp_hello/Makefile | 3 ++- contrib/sdk/samples/hello/Makefile | 3 ++- contrib/sdk/samples/hello/Makefile.static | 3 ++- programs/games/fridge/Makefile | 30 ++++++++++------------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/contrib/sdk/samples/cpp_hello/Makefile b/contrib/sdk/samples/cpp_hello/Makefile index ab23095dc0..14b5a6c299 100755 --- a/contrib/sdk/samples/cpp_hello/Makefile +++ b/contrib/sdk/samples/cpp_hello/Makefile @@ -1,7 +1,8 @@ CC = kos32-gcc LD = kos32-ld -SDK_DIR = $(abspath ../..) +CONTRIB_DIR = $(abspath ../../..) +SDK_DIR = $(CONTRIB_DIR)/sdk CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -Wno-pointer-arith LDFLAGS = -static -S -Tapp-dynamic.lds --image-base 0 diff --git a/contrib/sdk/samples/hello/Makefile b/contrib/sdk/samples/hello/Makefile index 05f65d0b9b..ab001dc1fc 100755 --- a/contrib/sdk/samples/hello/Makefile +++ b/contrib/sdk/samples/hello/Makefile @@ -3,7 +3,8 @@ CC = kos32-gcc LD = kos32-ld -SDK_DIR = $(abspath ../..) +CONTRIB_DIR = $(abspath ../../..) +SDK_DIR = $(CONTRIB_DIR)/sdk CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 LDFLAGS = -static -S -Tapp-dynamic.lds --image-base 0 diff --git a/contrib/sdk/samples/hello/Makefile.static b/contrib/sdk/samples/hello/Makefile.static index fb888568b2..33ff19c4f0 100644 --- a/contrib/sdk/samples/hello/Makefile.static +++ b/contrib/sdk/samples/hello/Makefile.static @@ -3,7 +3,8 @@ CC = kos32-gcc LD = kos32-ld -SDK_DIR = $(abspath ../..) +CONTRIB_DIR = $(abspath ../../..) +SDK_DIR = $(CONTRIB_DIR)/sdk CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 LDFLAGS = -static -Tapp-static.lds diff --git a/programs/games/fridge/Makefile b/programs/games/fridge/Makefile index 5a24688200..c5d656f5de 100755 --- a/programs/games/fridge/Makefile +++ b/programs/games/fridge/Makefile @@ -1,29 +1,25 @@ CC = kos32-gcc LD = kos32-ld -CONTRIB_DIR:= $(abspath ../../../contrib) -SDK_DIR:= $(CONTRIB_DIR)/sdk -C_LAYER:= $(CONTRIB_DIR)/C_Layer +CONTRIB_DIR = $(abspath ../../../contrib) +SDK_DIR = $(CONTRIB_DIR)/sdk +C_LAYER = $(CONTRIB_DIR)/C_Layer -LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds --image-base 0 +CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 +LDFLAGS = -static -S -Tapp-dynamic.lds --image-base 0 -CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -fno-ident -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 - -INCLUDES= -I $(SDK_DIR)/sources/newlib/libc/include -I $(C_LAYER)/INCLUDE -LIBPATH:= -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib - -SOURCES = fridge.c \ - $(NULL) - +INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include -I $(C_LAYER)/INCLUDE +LIBPATH = -L $(SDK_DIR)/lib +SOURCES = fridge.c OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) -default: fridge.kex +default: hello -fridge.kex: $(OBJECTS) Makefile - $(LD) $(LDFLAGS) $(LIBPATH) --subsystem native -o fridge.kex $(OBJECTS) $(C_LAYER)/OBJ/loadlibimg.obj -lgcc -lc.dll - objcopy fridge.kex -O binary - rm fridge.o +hello: $(OBJECTS) Makefile + $(LD) $(LDFLAGS) $(LIBPATH) --subsystem native -o fridge $(OBJECTS) $(C_LAYER)/OBJ/loadlibimg.obj -lgcc -lc.dll + strip -s fridge -o fridge + objcopy fridge -O binary %.o : %.c Makefile $(SOURCES) $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<