Subversion Repositories Kolibri OS

Rev

Rev 6114 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. SRC_DIR:=$(SDK_DIR)/sources
  3. MESA_SRC:= $(SRC_DIR)/Mesa/mesa-9.2.5/src
  4.  
  5. CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os
  6. CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields
  7. CFLAGS   = -c $(CFLAGS_OPT)
  8.  
  9. LDFLAGS = -shared -s --image-base 0 -T dll.lds --out-implib libegl.dll.a -e _DllStartup
  10.  
  11. INC_EGL:= -I$(SRC_DIR)/newlib/libc/include -I$(SDK_DIR)/includes -I$(SRC_DIR)/Mesa/mesa-9.2.5/include
  12. INC_EGL+= -I$(SRC_DIR)/libdrm -I$(SRC_DIR)/libdrm/include/drm -I./main -I./wayland
  13. INC_EGL+= -I$(MESA_SRC)/gbm/backends/dri -I$(MESA_SRC)/gbm/main
  14.  
  15. LIBS:=  -ldll -ldrm.dll -lgcc -lc.dll
  16.  
  17. 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
  18. MESA_DEFS+= -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_VERSION=\"9.2.5\" -DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi\?product=Mesa\"
  19. 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
  20. MESA_DEFS+= -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
  21.  
  22. EGL_DEFS = -DHAVE_DRM_PLATFORM -D__unix__ -DMESA_EGL_NO_X11_HEADERS -D_EGL_BUILT_IN_DRIVER_DRI2
  23.  
  24. EGL_SRC =                                       \
  25.         drivers/dri2/egl_dri2.c         \
  26.         drivers/dri2/platform_drm.c     \
  27.         main/eglapi.c                   \
  28.         main/eglarray.c                 \
  29.         main/eglconfig.c                \
  30.         main/eglcontext.c               \
  31.         main/eglcurrent.c               \
  32.         main/egldisplay.c               \
  33.         main/egldriver.c                \
  34.         main/eglfallbacks.c             \
  35.         main/eglglobals.c               \
  36.         main/eglimage.c                 \
  37.         main/egllog.c                   \
  38.         main/eglmisc.c                  \
  39.         main/eglmode.c                  \
  40.         main/eglscreen.c                \
  41.         main/eglstring.c                \
  42.         main/eglsurface.c               \
  43.         main/eglsync.c                  \
  44.         $(MESA_SRC)/gbm/backends/dri/driver_name.c      \
  45.         $(MESA_SRC)/gbm/backends/dri/gbm_dri.c          \
  46.         $(MESA_SRC)/gbm/main/backend.c                  \
  47.         $(MESA_SRC)/gbm/main/gbm.c                      \
  48.         $(NULL)
  49.  
  50.  
  51. EGL_OBJS   =  $(patsubst %.c, %.o, $(EGL_SRC))
  52.  
  53. # targets
  54.  
  55. all: libegl.dll
  56.  
  57. libegl.dll: $(EGL_OBJS) Makefile
  58.         $(LD) $(LDFLAGS) -o $@ $(MESA_SRC)/../egl.def $(EGL_OBJS) $(LIBS)
  59. #       $(STRIP) $@
  60. #       sed -e "s/ @[^ ]*//" egl1.def > egl.def
  61.         mv -f $@ $(SDK_DIR)/bin
  62.         mv -f libegl.dll.a $(INSTALLDIR)
  63.  
  64. %.o : %.c Makefile
  65.         $(CC) $(CFLAGS) $(MESA_DEFS) $(EGL_DEFS) $(INC_EGL) -o $@ $<
  66.  
  67.  
  68.