Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

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