Merge remote branch 'origin/7.8'
[mesa.git] / src / gallium / targets / Makefile.egl
1 # src/gallium/winsys/drm/Makefile.egl
2
3 # The driver Makefile should define
4 #
5 # EGL_DRIVER_NAME, the name of the driver
6 # EGL_DRIVER_SOURCES, the sources of the driver
7 # EGL_DRIVER_LIBS, extra libraries needed by the driver
8 # EGL_DRIVER_PIPES, the pipe drivers of the driver
9 #
10 # before including this file.
11
12 EGL_DRIVER_OBJECTS = $(EGL_DRIVER_SOURCES:.c=.o)
13
14 common_LIBS = -ldrm -lm -ldl
15
16 # ximage backend calls gallium_wrap_screen, which requires libidentity.a and
17 # libtrace.a
18 x11_ST = $(TOP)/src/gallium/state_trackers/egl/libeglx11.a \
19 $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a \
20 $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
21 $(TOP)/src/gallium/drivers/identity/libidentity.a \
22 $(TOP)/src/gallium/drivers/trace/libtrace.a
23
24 x11_LIBS = $(common_LIBS) -lX11 -lXext -lXfixes
25
26 kms_ST = $(TOP)/src/gallium/state_trackers/egl/libeglkms.a
27 kms_LIBS = $(common_LIBS)
28
29 ##### RULES #####
30
31 .c.o:
32 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
33
34
35 ##### TARGETS #####
36
37 EGL_DISPLAY_DRIVERS = $(foreach dpy, $(EGL_DISPLAYS), egl_$(dpy)_$(EGL_DRIVER_NAME).so)
38
39 EGL_DISPLAY_LIBS = $(foreach drv, $(EGL_DISPLAY_DRIVERS), $(TOP)/$(LIB_DIR)/$(drv))
40
41 default: $(EGL_DISPLAY_LIBS)
42
43 $(EGL_DISPLAY_LIBS): $(TOP)/$(LIB_DIR)/%.so: %.so
44 $(INSTALL) $< $(TOP)/$(LIB_DIR)
45
46 define mklib-egl
47 $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
48 $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) \
49 -Wl,--start-group $($(1)_ST) $(EGL_DRIVER_PIPES) \
50 $(GALLIUM_AUXILIARIES) -Wl,--end-group \
51 $($(1)_LIBS) $(EGL_DRIVER_LIBS)
52 endef
53
54 egl_x11_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(x11_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile
55 $(call mklib-egl,x11)
56
57 egl_kms_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(kms_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile
58 $(call mklib-egl,kms)
59
60 clean:
61 -rm -f $(EGL_DRIVER_OBJECTS)
62 -rm -f $(EGL_DISPLAY_DRIVERS)
63
64 install: $(EGL_DISPLAY_LIBS)
65 $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
66 for lib in $(EGL_DISPLAY_LIBS); do \
67 $(MINSTALL) -m 755 "$$lib" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
68 done
69
70 depend: