2021-01-24 20:54:09 +01:00
|
|
|
NAME=img_example
|
|
|
|
CC = kos32-gcc
|
|
|
|
LD = kos32-ld
|
|
|
|
|
|
|
|
SDK_DIR:= $(abspath ../../../sdk)
|
|
|
|
CLAYER:= $(abspath ../../)
|
|
|
|
|
|
|
|
LDFLAGS = -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app.lds \
|
|
|
|
--image-base 0
|
|
|
|
|
2021-02-06 00:27:15 +01:00
|
|
|
CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -fno-ident -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -std=c99
|
2021-01-24 20:54:09 +01:00
|
|
|
|
|
|
|
INCLUDES= -I. -I$(SDK_DIR)/sources/newlib/libc/include -I$(CLAYER)/INCLUDE
|
|
|
|
LIBPATH:= -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib
|
|
|
|
|
|
|
|
OBJPATH = $(CLAYER)/OBJ
|
|
|
|
|
|
|
|
all:
|
|
|
|
$(CC) $(CFLAGS) $(INCLUDES) $(SOURCES) main.c
|
2021-02-06 00:27:15 +01:00
|
|
|
$(LD) $(LIBPATH) $(LDFLAGS) --subsystem native main.o $(OBJPATH)/loadlibimg.obj $(OBJPATH)/loadboxlib.obj -o $(NAME) -lgcc -lc.dll
|
2021-01-24 20:54:09 +01:00
|
|
|
strip -S $(NAME)
|
|
|
|
objcopy $(NAME) -O binary
|
|
|
|
|
|
|
|
clean:
|
2021-02-06 00:27:15 +01:00
|
|
|
-rm -f *.o $(NAME)
|