summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl/Makefile')
-rw-r--r--src/gallium/state_trackers/egl/Makefile62
1 files changed, 42 insertions, 20 deletions
diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile
index 1768241352f..8dbfc5b8e56 100644
--- a/src/gallium/state_trackers/egl/Makefile
+++ b/src/gallium/state_trackers/egl/Makefile
@@ -11,10 +11,10 @@ common_INCLUDES = \
common_SOURCES = $(wildcard common/*.c)
common_OBJECTS = $(common_SOURCES:.c=.o)
-
x11_INCLUDES = \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/glx \
+ -I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
$(X11_CFLAGS) \
$(shell pkg-config --cflags-only-I libdrm)
@@ -24,27 +24,42 @@ x11_SOURCES = $(wildcard x11/*.c) \
x11_OBJECTS = $(x11_SOURCES:.c=.o)
-kms_INCLUDES = $(shell pkg-config --cflags-only-I libdrm)
-kms_SOURCES = $(wildcard kms/*.c)
-kms_OBJECTS = $(kms_SOURCES:.c=.o)
+drm_INCLUDES = -I$(TOP)/src/gallium/winsys $(shell pkg-config --cflags-only-I libdrm)
+drm_SOURCES = $(wildcard drm/*.c)
+drm_OBJECTS = $(drm_SOURCES:.c=.o)
-ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(kms_INCLUDES)
-ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(kms_SOURCES)
-ALL_OBJECTS = $(common_OBJECTS) $(x11_OBJECTS) $(kms_OBJECTS)
+fbdev_INCLUDES = -I$(TOP)/src/gallium/winsys/sw
+fbdev_SOURCES = $(wildcard fbdev/*.c)
+fbdev_OBJECTS = $(fbdev_SOURCES:.c=.o)
-##### TARGETS #####
-EGL_DISPLAYS_MODS = $(foreach dpy, $(EGL_DISPLAYS), libegl$(dpy).a)
+ALL_INCLUDES = $(common_INCLUDES) $(x11_INCLUDES) $(drm_INCLUDES) $(fbdev_INCLUDES)
+ALL_SOURCES = $(common_SOURCES) $(x11_SOURCES) $(drm_SOURCES) $(fbdev_SOURCES)
+
+EGL_OBJECTS = $(common_OBJECTS)
+EGL_CPPFLAGS = $(common_INCLUDES)
-default: depend $(EGL_DISPLAYS_MODS)
+# add backends
+ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
+EGL_OBJECTS += $(x11_OBJECTS)
+EGL_CPPFLAGS += -DHAVE_X11_BACKEND
+endif
+ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
+EGL_OBJECTS += $(drm_OBJECTS)
+EGL_CPPFLAGS += -DHAVE_DRM_BACKEND
+endif
+ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
+EGL_OBJECTS += $(fbdev_OBJECTS)
+EGL_CPPFLAGS += -DHAVE_FBDEV_BACKEND
+endif
+##### TARGETS #####
-libeglx11.a: $(x11_OBJECTS) $(common_OBJECTS) Makefile
- $(MKLIB) -o eglx11 -static $(x11_OBJECTS) $(common_OBJECTS)
+default: depend libegl.a
-libeglkms.a: $(kms_OBJECTS) $(common_OBJECTS) Makefile
- $(MKLIB) -o eglkms -static $(kms_OBJECTS) $(common_OBJECTS)
+libegl.a: $(EGL_OBJECTS) Makefile
+ $(MKLIB) -o egl -static $(EGL_OBJECTS)
depend:
rm -f depend
@@ -52,8 +67,8 @@ depend:
$(MKDEP) $(MKDEP_OPTIONS) $(ALL_INCLUDES) $(ALL_SOURCES) 2> /dev/null
clean:
- rm -f $(ALL_OBJECTS)
- rm -f $(EGL_DISPLAYS_MODS)
+ rm -f libegl.a
+ rm -f $(EGL_OBJECTS)
rm -f depend depend.bak
# Dummy target
@@ -62,13 +77,20 @@ install:
##### RULES #####
+define egl-cc
+$(CC) -c $(common_INCLUDES) $($(1)_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@
+endef
+
$(common_OBJECTS): %.o: %.c
- $(CC) -c $(common_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@
+ $(CC) -c $(EGL_CPPFLAGS) $(DEFINES) $(CFLAGS) $< -o $@
$(x11_OBJECTS): %.o: %.c
- $(CC) -c $(common_INCLUDES) $(x11_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@
+ $(call egl-cc,x11)
+
+$(drm_OBJECTS): %.o: %.c
+ $(call egl-cc,drm)
-$(kms_OBJECTS): %.o: %.c
- $(CC) -c $(common_INCLUDES) $(kms_INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@
+$(fbdev_OBJECTS): %.o: %.c
+ $(call egl-cc,fbdev)
sinclude depend