2013-12-19 09:49:07 +01:00
|
|
|
|
2014-04-21 19:06:44 +02:00
|
|
|
export CC = kos32-gcc
|
|
|
|
export AR = kos32-ar
|
|
|
|
export LD = kos32-ld
|
|
|
|
export STRIP = kos32-strip
|
|
|
|
|
|
|
|
export SDK_DIR:= $(abspath ../..)
|
2013-12-19 09:49:07 +01:00
|
|
|
|
2014-04-21 19:06:44 +02:00
|
|
|
EGL = egl
|
2013-12-19 09:49:07 +01:00
|
|
|
|
2014-01-23 12:18:35 +01:00
|
|
|
CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os
|
2014-08-07 13:48:01 +02:00
|
|
|
CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields
|
2013-12-19 09:49:07 +01:00
|
|
|
CFLAGS = -c $(CFLAGS_OPT)
|
|
|
|
|
2014-04-21 19:06:44 +02:00
|
|
|
LDFLAGS = -nostdlib -shared -s --image-base 0 -T ../newlib/dll.lds -e _DllStartup
|
|
|
|
LDFLAGS+= --out-implib lib$(EGL).dll.a
|
2014-04-04 23:41:12 +02:00
|
|
|
|
2014-05-21 22:47:51 +02:00
|
|
|
INC_MESA= -I../newlib/libc/include -I./include -I./src -I./src/glsl -I./src/mesa -I./src/mapi
|
|
|
|
INC_EGL= -I../newlib/libc/include -I../../includes -I./include -I../libdrm -I../libdrm/include/drm -I./src/egl/main -I./src/gbm/backends/dri -I./src/gbm/main
|
2013-12-19 09:49:07 +01:00
|
|
|
|
2014-04-21 19:06:44 +02:00
|
|
|
LIBPATH:= -L../../lib -L/home/autobuild/tools/win32/mingw32/lib
|
2013-12-19 09:49:07 +01:00
|
|
|
|
|
|
|
LIBS:= -ldll -ldrm.dll -lc.dll -lgcc
|
|
|
|
|
|
|
|
MESA_DEFS= -DMESA_DLL -DBUILD_GL32 -DMAPI_MODE_UTIL -DMAPI_TABLE_NUM_STATIC=87 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_SSE_ASM -DMAPI_TABLE_NUM_DYNAMIC=256
|
2013-12-24 13:45:42 +01:00
|
|
|
MESA_DEFS+= -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_VERSION=\"9.2.5\" -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi\?product=Mesa\"
|
|
|
|
MESA_DEFS+= -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"9.2.5\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
|
2013-12-19 09:49:07 +01:00
|
|
|
MESA_DEFS+= -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
|
|
|
|
|
|
|
|
EGL_DEFS = -DHAVE_DRM_PLATFORM -D__unix__ -DMESA_EGL_NO_X11_HEADERS -D_EGL_BUILT_IN_DRIVER_DRI2
|
|
|
|
|
2014-04-04 23:41:12 +02:00
|
|
|
SUBDIRS = src/egl src/glsl src/mapi src/mesa
|
2013-12-19 09:49:07 +01:00
|
|
|
|
|
|
|
# targets
|
|
|
|
|
2014-04-04 23:41:12 +02:00
|
|
|
all:
|
|
|
|
@echo $(SDK_DIR); \
|
|
|
|
for i in $(SUBDIRS); do \
|
|
|
|
$(MAKE) -C $$i; \
|
|
|
|
done
|
|
|
|
|
2013-12-19 09:49:07 +01:00
|
|
|
$(EGL).dll: $(EGL_OBJS) Makefile
|
2013-12-19 14:27:08 +01:00
|
|
|
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ egl.def $(EGL_OBJS) $(LIBS)
|
2014-04-21 19:06:44 +02:00
|
|
|
# $(STRIP) $@
|
2013-12-19 09:49:07 +01:00
|
|
|
# sed -e "s/ @[^ ]*//" egl1.def > egl.def
|
|
|
|
mv -f $@ ../../bin
|
|
|
|
mv -f lib$(EGL).dll.a ../../lib
|
2014-01-23 12:18:35 +01:00
|
|
|
|
|
|
|
libglsl.a : $(GLSL_OBJS) Makefile
|
2014-04-21 19:06:44 +02:00
|
|
|
$(AR) libglsl.a $(GLSL_OBJS)
|
2014-01-23 12:18:35 +01:00
|
|
|
mv -f libglsl.a ../../lib
|
|
|
|
|
2014-03-11 08:02:04 +01:00
|
|
|
libGL.dll: $(LIBGL_OBJS) Makefile
|
|
|
|
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ $(LIBGL_OBJS) $(LIBS)
|
2014-04-21 19:06:44 +02:00
|
|
|
# $(STRIP) $@
|
2014-03-11 08:02:04 +01:00
|
|
|
# sed -e "s/ @[^ ]*//" egl1.def > egl.def
|
|
|
|
mv -f $@ ../../bin
|
|
|
|
mv -f libGL.dll.a ../../lib
|
|
|
|
|
2014-01-23 12:18:35 +01:00
|
|
|
src/glsl/glcpp/%.o : src/glsl/glcpp/%.c Makefile
|
|
|
|
$(CC) $(CFLAGS) -std=c99 $(MESA_DEFS) $(INC_MESA) -o $@ $<
|
|
|
|
|
|
|
|
src/glsl/%.o : src/glsl/%.c Makefile
|
|
|
|
$(CC) $(CFLAGS) -std=c99 $(MESA_DEFS) $(INC_MESA) -o $@ $<
|
2014-03-11 08:02:04 +01:00
|
|
|
|
|
|
|
src/mapi/glapi/%.o : src/mapi/glapi/%.c Makefile
|
|
|
|
$(CC) $(CFLAGS) -std=c99 $(MESA_DEFS) $(INC_MESA) -o $@ $<
|
2013-12-19 09:49:07 +01:00
|
|
|
|
|
|
|
%.o : %.c Makefile
|
2014-01-23 12:18:35 +01:00
|
|
|
$(CC) $(CFLAGS) $(MESA_DEFS) $(EGL_DEFS) $(INC_EGL) -o $@ $<
|
|
|
|
|
2013-12-19 09:49:07 +01:00
|
|
|
|
2014-01-23 12:18:35 +01:00
|
|
|
%.o : %.cpp Makefile
|
|
|
|
$(CC) $(CFLAGS) $(MESA_DEFS) $(INC_MESA) -o $@ $<
|
2013-12-19 09:49:07 +01:00
|
|
|
|