2014-08-29 17:41:48 +02:00
|
|
|
CC = kos32-gcc
|
|
|
|
AR = kos32-ar
|
|
|
|
LD = kos32-ld
|
2020-12-30 14:55:24 +01:00
|
|
|
CPP = kos32-g++
|
2014-08-29 17:41:48 +02:00
|
|
|
STRIP = kos32-strip
|
|
|
|
|
|
|
|
CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer
|
|
|
|
|
|
|
|
ARFLAG = crs
|
|
|
|
|
2020-12-30 14:55:24 +01:00
|
|
|
SDK_DIR = $(abspath ../../..)
|
|
|
|
LIB_DIR = $(SDK_DIR)/lib
|
2014-08-29 17:41:48 +02:00
|
|
|
|
|
|
|
DEFINES = -D__unix__ -DMESA_EGL_NO_X11_HEADERS
|
|
|
|
|
2020-12-30 14:55:24 +01:00
|
|
|
INCLUDES = -I. -I$(SDK_DIR)/sources/newlib/libc/include -I$(SDK_DIR)/sources/Mesa/mesa-9.2.5/include -I$(SDK_DIR)/sources/eglut
|
2014-08-29 17:41:48 +02:00
|
|
|
|
2020-12-30 14:55:24 +01:00
|
|
|
LIBS_EGL = -leglut -legl.dll
|
|
|
|
LIBS_OSM = -losmesa.dll
|
|
|
|
LIBS = -lGL.dll -lpixlib3 -lgcc -lc.dll
|
2014-08-29 17:41:48 +02:00
|
|
|
|
2020-12-30 14:55:24 +01:00
|
|
|
LIBPATH = -L$(LIB_DIR) -L/home/autobuild/tools/win32/mingw32/lib
|
2014-08-29 17:41:48 +02:00
|
|
|
|
2020-12-30 14:55:24 +01:00
|
|
|
LDFLAGS = -static -nostdlib --stack 0x200000 -T$(SDK_DIR)/sources/newlib/app.lds --image-base 0 --subsystem native
|
2014-08-29 17:41:48 +02:00
|
|
|
|
2020-12-30 14:55:24 +01:00
|
|
|
SOURCES = gears.c \
|
2014-08-29 17:41:48 +02:00
|
|
|
eglgears.c \
|
|
|
|
osgears.c
|
|
|
|
|
|
|
|
OBJECTS = $(patsubst %.asm, %.o, $(patsubst %.c, %.o, $(SOURCES)))
|
|
|
|
|
|
|
|
|
|
|
|
# targets
|
|
|
|
|
|
|
|
all: demos
|
|
|
|
|
|
|
|
demos: eglgears osgears
|
|
|
|
|
|
|
|
eglgears: gears.o eglgears.o Makefile
|
|
|
|
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ gears.o eglgears.o $(LIBS_EGL) $(LIBS)
|
|
|
|
kos32-objcopy $@ -O binary
|
|
|
|
|
|
|
|
osgears: gears.o osgears.o Makefile
|
|
|
|
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ gears.o osgears.o $(LIBS_OSM) $(LIBS)
|
|
|
|
kos32-objcopy $@ -O binary
|
|
|
|
|
|
|
|
%.o : %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|