Samples fix #2 + fridge makefile change

git-svn-id: svn://kolibrios.org@9759 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack 2022-04-06 15:32:56 +00:00
parent 87d53e5e74
commit 4e324c8612
4 changed files with 19 additions and 20 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 -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)
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
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 $@ $<