Merge branch 'mesa_7_7_branch'
[mesa.git] / src / gallium / winsys / drm / 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 x11_ST = $(TOP)/src/gallium/state_trackers/egl/libeglx11.a
17 x11_LIBS = $(common_LIBS) -lX11 -lXext -lXfixes
18
19 kms_ST = $(TOP)/src/gallium/state_trackers/egl/libeglkms.a
20 kms_LIBS = $(common_LIBS)
21
22 ##### RULES #####
23
24 .c.o:
25 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
26
27
28 ##### TARGETS #####
29
30 EGL_DISPLAY_DRIVERS = $(foreach dpy, $(EGL_DISPLAYS), egl_$(dpy)_$(EGL_DRIVER_NAME).so)
31
32 LIB_GALLIUM_DIR = $(TOP)/$(LIB_DIR)/gallium
33 EGL_DISPLAY_LIBS = $(foreach drv, $(EGL_DISPLAY_DRIVERS), $(LIB_GALLIUM_DIR)/$(drv))
34
35 default: $(EGL_DISPLAY_LIBS)
36
37 $(EGL_DISPLAY_LIBS): $(LIB_GALLIUM_DIR)/%.so: %.so
38 @mkdir -p $(LIB_GALLIUM_DIR)
39 $(INSTALL) $^ $(LIB_GALLIUM_DIR)
40
41 define mklib-egl
42 $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
43 $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) \
44 -Wl,--whole-archive $($(1)_ST) -Wl,--no-whole-archive \
45 $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $($(1)_LIBS) $(EGL_DRIVER_LIBS)
46 endef
47
48 egl_x11_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(x11_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile
49 $(call mklib-egl,x11)
50
51 egl_kms_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(kms_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile
52 $(call mklib-egl,kms)
53
54 clean:
55 -rm -f $(EGL_DRIVER_OBJECTS)
56 -rm -f $(EGL_DISPLAY_DRIVERS)
57
58 install: $(EGL_DISPLAY_LIBS)
59 @$(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
60 @echo "Install $(EGL_DISPLAY_DRIVERS)"
61 @for lib in "$(EGL_DISPLAY_LIBS)"; do \
62 $(MINSTALL) -m 755 "$$lib" $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR); \
63 done
64
65 depend: