glsl2: Add and use new variable mode ir_var_temporary
[mesa/nouveau-pmpeg.git] / src / gallium / targets / Makefile.egl
blob315856014b72293e6226b2d23ff9abd791818a1c
1 # src/gallium/winsys/drm/Makefile.egl
3 # The driver Makefile should define
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
10 # before including this file.
12 EGL_DRIVER_OBJECTS = $(EGL_DRIVER_SOURCES:.c=.o)
14 common_LIBS = -ldrm -lm -ldl
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          $(TOP)/src/gallium/drivers/rbug/librbug.a
25 x11_LIBS = $(common_LIBS) -lX11 -lXext -lXfixes
27 kms_ST = $(TOP)/src/gallium/state_trackers/egl/libeglkms.a
28 kms_LIBS = $(common_LIBS)
30 fbdev_ST = \
31         $(TOP)/src/gallium/state_trackers/egl/libeglfbdev.a \
32         $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a \
33         $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
34         $(TOP)/src/gallium/drivers/identity/libidentity.a \
35         $(TOP)/src/gallium/drivers/trace/libtrace.a \
36         $(TOP)/src/gallium/drivers/rbug/librbug.a
37 fbdev_LIBS = $(common_LIBS)
39 ifeq ($(MESA_LLVM),1)
40 x11_ST += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
41 x11_LIBS += $(LLVM_LIBS)
42 fbdev_ST += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
43 fbdev_LIBS += $(LLVM_LIBS)
44 LDFLAGS += $(LLVM_LDFLAGS)
45 endif
47 ### Include directories
48 INCLUDES = \
49         -I$(TOP)/include \
50         -I$(TOP)/src/gallium/include \
51         -I$(TOP)/src/gallium/auxiliary \
52         -I$(TOP)/src/gallium/drivers \
53         -I$(TOP)/src/gallium/winsys \
54         -I$(TOP)/src/egl/main \
55         $(LIBDRM_CFLAGS)
57 ##### RULES #####
59 .c.o:
60         $(CC) -c $(INCLUDES) $(CFLAGS) $(EGL_DRIVER_DEFINES) $< -o $@
63 ##### TARGETS #####
65 ifeq ($(EGL_DRIVER_NAME),swrast)
66 EGL_PLATFORMS := $(filter-out kms, $(EGL_PLATFORMS))
67 else
68 EGL_PLATFORMS := $(filter-out fbdev, $(EGL_PLATFORMS))
69 endif
71 EGL_PLATFORM_DRIVERS = $(foreach plat, $(EGL_PLATFORMS), egl_$(plat)_$(EGL_DRIVER_NAME).so)
73 EGL_PLATFORM_LIBS = $(foreach drv, $(EGL_PLATFORM_DRIVERS), $(TOP)/$(LIB_DIR)/egl/$(drv))
75 default: $(EGL_PLATFORM_LIBS)
77 $(EGL_PLATFORM_LIBS): $(TOP)/$(LIB_DIR)/egl/%.so: %.so
78         @$(INSTALL) -d $(TOP)/$(LIB_DIR)/egl
79         $(INSTALL) $< $(TOP)/$(LIB_DIR)/egl
81 define mklib-egl
82 $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
83         $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) \
84         -Wl,--start-group $($(1)_ST) $(EGL_DRIVER_PIPES) \
85         $(GALLIUM_AUXILIARIES) -Wl,--end-group \
86         $($(1)_LIBS) $(EGL_DRIVER_LIBS) -L$(TOP)/$(LIB_DIR) -l$(EGL_LIB)
87 endef
89 egl_x11_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(x11_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile
90         $(call mklib-egl,x11)
92 egl_kms_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(kms_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile
93         $(call mklib-egl,kms)
95 egl_fbdev_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(fbdev_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile
96         $(call mklib-egl,fbdev)
98 clean:
99         -rm -f $(EGL_DRIVER_OBJECTS)
100         -rm -f $(EGL_PLATFORM_DRIVERS)
102 install: $(EGL_PLATFORM_LIBS)
103         $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
104         for lib in $(EGL_PLATFORM_LIBS); do \
105                 $(MINSTALL) -m 755 "$$lib" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
106         done
108 depend: