2013-12-19 09:49:07 +01:00
|
|
|
|
|
|
|
EGL = egl
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
|
2014-01-23 12:18:35 +01:00
|
|
|
CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os
|
2013-12-19 14:27:08 +01:00
|
|
|
CFLAGS_OPT+= -fomit-frame-pointer -mno-ms-bitfields
|
2013-12-19 09:49:07 +01:00
|
|
|
CFLAGS = -c $(CFLAGS_OPT)
|
|
|
|
|
|
|
|
LD = ld
|
2013-12-19 14:27:08 +01:00
|
|
|
LDFLAGS = -nostdlib -shared -s --image-base 0 -T ../newlib/dll.lds --out-implib lib$(EGL).dll.a -e _DllStartup
|
2013-12-19 09:49:07 +01:00
|
|
|
|
|
|
|
STRIP = $(PREFIX)strip
|
|
|
|
|
2014-04-04 23:41:12 +02:00
|
|
|
export SDK_DIR:= $(abspath ../..)
|
|
|
|
|
2014-01-23 12:18:35 +01:00
|
|
|
INC_MESA= -I../newlib/include -I./include -I./src -I./src/glsl -I./src/mesa -I./src/mapi
|
2014-01-29 13:35:00 +01:00
|
|
|
INC_EGL= -I../newlib/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
|
|
|
|
|
|
|
LIBPATH:= -L../../lib
|
|
|
|
|
|
|
|
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)
|
2013-12-19 09:49:07 +01:00
|
|
|
$(STRIP) $@
|
|
|
|
# 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
|
|
|
|
ar cvrs libglsl.a $(GLSL_OBJS)
|
|
|
|
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)
|
|
|
|
$(STRIP) $@
|
|
|
|
# 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
|
|
|
|