2 include $(TOP)/configs/current
6 -I$(TOP)/src/gallium/include \
7 -I$(TOP)/src/gallium/auxiliary \
8 -I$(TOP)/src/egl/main \
11 common_SOURCES = $(wildcard common/*.c)
12 common_OBJECTS = $(common_SOURCES:.c=.o)
15 -I$(TOP)/src/gallium/drivers \
20 $(shell pkg-config --cflags-only-I libdrm dri2proto)
22 x11_SOURCES = $(wildcard x11/*.c) \
24 x11_OBJECTS = $(x11_SOURCES:.c=.o)
27 -I$(TOP)/src/gallium/winsys \
28 -I$(TOP)/src/egl/wayland \
29 -I$(TOP)/src/egl/wayland/wayland-drm \
30 $(shell pkg-config --cflags-only-I libdrm wayland-client)
32 wayland_SOURCES = $(wildcard wayland/*.c)
33 wayland_OBJECTS = $(wayland_SOURCES:.c=.o)
35 drm_INCLUDES = -I$(TOP)/src/gallium/winsys $(shell pkg-config --cflags-only-I libdrm)
36 drm_SOURCES = $(wildcard drm/*.c)
37 drm_OBJECTS = $(drm_SOURCES:.c=.o)
40 fbdev_INCLUDES = -I$(TOP)/src/gallium/winsys/sw
41 fbdev_SOURCES = $(wildcard fbdev/*.c)
42 fbdev_OBJECTS = $(fbdev_SOURCES:.c=.o)
45 ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(drm_INCLUDES) $(fbdev_INCLUDES)
46 ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(drm_SOURCES) $(fbdev_SOURCES)
48 EGL_OBJECTS = $(common_OBJECTS)
49 EGL_CPPFLAGS = $(common_INCLUDES)
52 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
53 EGL_OBJECTS += $(x11_OBJECTS)
54 EGL_CPPFLAGS += -DHAVE_X11_BACKEND
56 ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
57 EGL_OBJECTS += $(wayland_OBJECTS)
58 EGL_CPPFLAGS += -DHAVE_WAYLAND_BACKEND
60 ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
61 EGL_OBJECTS += $(drm_OBJECTS)
62 EGL_CPPFLAGS += -DHAVE_DRM_BACKEND
64 ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
65 EGL_OBJECTS += $(fbdev_OBJECTS)
66 EGL_CPPFLAGS += -DHAVE_FBDEV_BACKEND
71 default: depend libegl.a
73 libegl.a: $(EGL_OBJECTS) Makefile
74 $(MKLIB) -o egl -static $(EGL_OBJECTS)
79 $(MKDEP) $(MKDEP_OPTIONS) $(ALL_INCLUDES) $(ALL_SOURCES) 2> /dev/null
84 rm -f depend depend.bak
93 $(CC) -c $(common_INCLUDES) $($(1)_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@
96 $(common_OBJECTS): %.o: %.c
97 $(CC) -c $(EGL_CPPFLAGS) $(DEFINES) $(CFLAGS) $< -o $@
99 $(x11_OBJECTS): %.o: %.c
102 $(wayland_OBJECTS): %.o: %.c
103 $(call egl-cc,wayland)
105 $(drm_OBJECTS): %.o: %.c
108 $(fbdev_OBJECTS): %.o: %.c