revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / gallium / targets / egl-static / Makefile
blob5b7b330a1cd945f6f5748c12f6c85cee7853813a
1 # src/gallium/targets/egl-static/Makefile
3 # This is Makefile for egl_gallium.so. It is static in that all state trackers
4 # and pipe drivers are linked statically when possible.
6 # The following variables are examined
8 # EGL_PLATFORMS - platforms to support
9 # EGL_CLIENT_APIS - state trackers to support
10 # GALLIUM_WINSYS_DIRS - pipe drivers to support
11 # SHARED_GLAPI - st/mesa can be statically linked or not
14 TOP = ../../../..
15 include $(TOP)/configs/current
17 OUTPUTS := egl_gallium
19 egl_CPPFLAGS := \
20 -I$(TOP)/include \
21 -I$(TOP)/src/gallium/auxiliary \
22 -I$(TOP)/src/gallium/drivers \
23 -I$(TOP)/src/gallium/include \
24 -I$(TOP)/src/gallium/winsys
25 egl_LIBS := \
26 $(TOP)/src/gallium/drivers/identity/libidentity.a \
27 $(TOP)/src/gallium/drivers/trace/libtrace.a \
28 $(TOP)/src/gallium/drivers/rbug/librbug.a \
29 $(GALLIUM_AUXILIARIES)
30 egl_SYS :=
32 egl_SOURCES := \
33 egl.c \
34 egl_pipe.c \
35 egl_st.c
37 egl_OBJECTS := $(egl_SOURCES:%.c=%.o)
39 # st/egl
40 egl_CPPFLAGS += \
41 -I$(TOP)/src/gallium/state_trackers/egl \
42 -I$(TOP)/src/egl/main \
43 -D_EGL_MAIN=_eglMain
44 egl_LIBS += $(TOP)/src/gallium/state_trackers/egl/libegl.a
45 egl_SYS += $(LIBUDEV_LIBS) $(DLOPEN_LIBS) -lEGL -lm -lpthread
47 # EGL platforms
48 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
49 egl_CPPFLAGS += $(LIBDRM_CFLAGS)
50 egl_LIBS += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a
51 egl_SYS += -lX11 -lXext -lXfixes $(LIBDRM_LIB)
52 endif
53 ifneq ($(findstring wayland, $(EGL_PLATFORMS)),)
54 egl_CPPFLAGS += $(LIBDRM_CFLAGS)
55 egl_LIBS += $(TOP)/src/gallium/winsys/sw/wayland/libws_wayland.a
56 egl_LIBS += $(TOP)/src/egl/wayland/wayland-drm/libwayland-drm.a
57 egl_SYS += $(LIBDRM_LIB) $(WAYLAND_LIBS)
58 endif
59 ifneq ($(findstring drm, $(EGL_PLATFORMS)),)
60 egl_CPPFLAGS += $(LIBDRM_CFLAGS)
61 egl_SYS += $(LIBDRM_LIB) -lgbm
62 endif
63 ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
64 egl_LIBS += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a
65 endif
67 # st/mesa
68 ifneq ($(filter $(GL_LIB), $(EGL_CLIENT_APIS)),)
69 egl_CPPFLAGS += -I$(TOP)/src/mesa $(API_DEFINES)
70 # make st/mesa built-in when there is a single glapi provider
71 ifeq ($(SHARED_GLAPI),1)
72 egl_LIBS += $(TOP)/src/mesa/libmesagallium.a
73 egl_SYS += -lm -lpthread $(DLOPEN_LIBS) -l$(GLAPI_LIB)
74 else
75 egl_CPPFLAGS += -D_EGL_EXTERNAL_GL=1
76 OUTPUTS += st_GL
77 endif # SHARED_GLAPI
78 endif
80 # st/vega
81 ifneq ($(filter $(VG_LIB), $(EGL_CLIENT_APIS)),)
82 egl_CPPFLAGS += -I$(TOP)/src/gallium/state_trackers/vega -DFEATURE_VG=1
83 egl_LIBS += $(TOP)/src/gallium/state_trackers/vega/libvega.a
84 egl_SYS += -lm -l$(VG_LIB)
85 endif
87 # i915
88 ifneq ($(findstring i915/drm,$(GALLIUM_WINSYS_DIRS)),)
89 egl_CPPFLAGS += -D_EGL_PIPE_I915=1
90 egl_LIBS += \
91 $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
92 $(TOP)/src/gallium/drivers/i915/libi915.a
93 egl_SYS += -ldrm_intel
94 endif
96 # i965
97 ifneq ($(findstring i965/drm,$(GALLIUM_WINSYS_DIRS)),)
98 egl_CPPFLAGS += -D_EGL_PIPE_I995=1
99 egl_LIBS += \
100 $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
101 $(TOP)/src/gallium/drivers/i965/libi965.a \
102 $(TOP)/src/gallium/winsys/sw/wrapper/libwsw.a
103 egl_SYS += -ldrm_intel
104 endif
106 # nouveau
107 ifneq ($(findstring nouveau/drm,$(GALLIUM_WINSYS_DIRS)),)
108 egl_CPPFLAGS += -D_EGL_PIPE_NOUVEAU=1
109 egl_LIBS += \
110 $(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
111 $(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
112 $(TOP)/src/gallium/drivers/nv50/libnv50.a \
113 $(TOP)/src/gallium/drivers/nvc0/libnvc0.a \
114 $(TOP)/src/gallium/drivers/nouveau/libnouveau.a
115 egl_SYS += -ldrm_nouveau
116 endif
118 # r300
119 ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
120 egl_CPPFLAGS += -D_EGL_PIPE_R300=1
121 egl_LIBS += \
122 $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
123 $(TOP)/src/gallium/drivers/r300/libr300.a
124 egl_SYS += -ldrm_radeon
125 endif
127 # r600
128 ifneq ($(findstring r600/drm,$(GALLIUM_WINSYS_DIRS)),)
129 egl_CPPFLAGS += -D_EGL_PIPE_R600=1
130 egl_LIBS += \
131 $(TOP)/src/gallium/winsys/r600/drm/libr600winsys.a \
132 $(TOP)/src/gallium/drivers/r600/libr600.a
133 egl_SYS += -ldrm_radeon
134 endif
136 # vmwgfx
137 ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),)
138 egl_CPPFLAGS += -D_EGL_PIPE_VMWGFX=1
139 egl_LIBS += \
140 $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
141 $(TOP)/src/gallium/drivers/svga/libsvga.a
142 endif
144 # softpipe
145 ifneq ($(findstring softpipe,$(GALLIUM_DRIVERS_DIRS)),)
146 egl_CPPFLAGS += -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
147 egl_LIBS += $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
148 egl_SYS += -lm
149 endif
151 # llvmpipe
152 ifneq ($(findstring llvmpipe,$(GALLIUM_DRIVERS_DIRS)),)
153 egl_CPPFLAGS += -DGALLIUM_LLVMPIPE
154 egl_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
155 endif
157 # sort to remove duplicates
158 egl_CPPFLAGS := $(sort $(egl_CPPFLAGS))
159 egl_LIBS := $(sort $(egl_LIBS))
160 egl_SYS := $(sort $(egl_SYS))
162 # st_GL, built only when shared glapi is not enabled
163 st_GL_CPPFLAGS := -I $(TOP)/src/mesa -I$(TOP)/src/gallium/include
164 st_GL_LIBS := $(TOP)/src/mesa/libmesagallium.a $(GALLIUM_AUXILIARIES)
165 st_GL_SYS := -lm -lpthread $(DLOPEN_LIBS)
167 # LLVM
168 ifeq ($(MESA_LLVM),1)
169 egl_SYS += $(LLVM_LIBS)
170 LDFLAGS += $(LLVM_LDFLAGS)
172 st_GL_SYS += $(LLVM_LIBS)
173 endif
175 OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl
176 OUTPUTS := $(addprefix $(OUTPUT_PATH)/, $(addsuffix .so, $(OUTPUTS)))
178 default: $(OUTPUTS)
180 $(OUTPUT_PATH)/egl_gallium.so: $(egl_OBJECTS) $(egl_LIBS)
181 $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
182 -ldflags '-L$(TOP)/$(LIB_DIR) -Wl,--no-undefined $(LDFLAGS)' \
183 -cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
184 $(egl_OBJECTS) -Wl,--start-group $(egl_LIBS) -Wl,--end-group \
185 $(egl_SYS)
187 $(OUTPUT_PATH)/st_GL.so: st_GL.o $(st_GL_LIBS)
188 $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' \
189 -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \
190 -cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) \
191 $< -Wl,--start-group $(st_GL_LIBS) -Wl,--end-group \
192 $(st_GL_SYS)
194 $(egl_OBJECTS): %.o: %.c
195 $(CC) -c -o $@ $< $(egl_CPPFLAGS) $(DEFINES) $(CFLAGS)
197 st_GL.o: st_GL.c
198 $(CC) -c -o $@ $< $(st_GL_CPPFLAGS) $(DEFINES) $(CFLAGS)
200 install: $(OUTPUTS)
201 $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
202 for out in $(OUTPUTS); do \
203 $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
204 done
206 clean:
207 rm -f *.o