draw: Add inline keyword to inline function.
[mesa.git] / src / gallium / targets / egl / Makefile
1 # src/gallium/targets/egl/Makefile
2 #
3 # This is the Makefile for EGL Gallium driver package. The package consists of
4 #
5 # egl_gallium.so - EGL driver
6 # pipe_<HW>.so - pipe drivers
7 # st_<API>.so - client API state trackers
8 #
9 # The following variables are examined
10 #
11 # EGL_PLATFORMS - platforms to support
12 # GALLIUM_WINSYS_DIRS - pipe drivers to support
13 # EGL_CLIENT_APIS - state trackers to support
14 #
15
16 TOP = ../../../..
17 include $(TOP)/configs/current
18
19 ST_PREFIX := st_
20 PIPE_PREFIX := pipe_
21
22 common_CPPFLAGS := \
23 -I$(TOP)/include \
24 -I$(TOP)/src/gallium/auxiliary \
25 -I$(TOP)/src/gallium/drivers \
26 -I$(TOP)/src/gallium/include \
27 -I$(TOP)/src/gallium/winsys
28 common_SYS :=
29 common_LIBS := \
30 $(TOP)/src/gallium/drivers/identity/libidentity.a \
31 $(TOP)/src/gallium/drivers/trace/libtrace.a \
32 $(TOP)/src/gallium/drivers/rbug/librbug.a \
33 $(GALLIUM_AUXILIARIES)
34
35 # EGL driver
36 egl_CPPFLAGS := \
37 -I$(TOP)/src/gallium/state_trackers/egl \
38 -I$(TOP)/src/egl/main \
39 -DPIPE_PREFIX=\"$(PIPE_PREFIX)\" -DST_PREFIX=\"$(ST_PREFIX)\"
40 egl_SYS := -lm -ldl -L$(TOP)/$(LIB_DIR) -lEGL
41 egl_LIBS := $(TOP)/src/gallium/state_trackers/egl/libegl.a
42
43 ifneq ($(findstring x11, $(EGL_PLATFORMS)),)
44 egl_SYS += -lX11 -lXext -lXfixes
45 egl_LIBS += $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a
46 endif
47 ifneq ($(findstring kms, $(EGL_PLATFORMS)),)
48 egl_SYS += -ldrm
49 endif
50 ifneq ($(findstring fbdev, $(EGL_PLATFORMS)),)
51 egl_LIBS += $(TOP)/src/gallium/winsys/sw/fbdev/libfbdev.a
52 endif
53
54 # EGL_RENDERABLE_TYPE is a compile time attribute
55 egl_CPPFLAGS += $(API_DEFINES)
56 ifneq ($(filter $(GL_LIB), $(EGL_CLIENT_APIS)),)
57 egl_CPPFLAGS += -DFEATURE_GL=1
58 endif
59 ifneq ($(filter $(GLESv1_CM_LIB), $(EGL_CLIENT_APIS)),)
60 egl_CPPFLAGS += -DFEATURE_ES1=1
61 endif
62 ifneq ($(filter $(GLESv2_LIB), $(EGL_CLIENT_APIS)),)
63 egl_CPPFLAGS += -DFEATURE_ES2=1
64 endif
65 ifneq ($(filter $(VG_LIB), $(EGL_CLIENT_APIS)),)
66 egl_CPPFLAGS += -DFEATURE_VG=1
67 endif
68 egl_CPPFLAGS := $(sort $(egl_CPPFLAGS))
69
70 # i915 pipe driver
71 i915_CPPFLAGS :=
72 i915_SYS := -ldrm_intel
73 i915_LIBS := \
74 $(TOP)/src/gallium/winsys/i915/drm/libi915drm.a \
75 $(TOP)/src/gallium/drivers/i915/libi915.a
76
77 # i965 pipe driver
78 i965_CPPFLAGS :=
79 i965_SYS := -ldrm_intel
80 i965_LIBS := \
81 $(TOP)/src/gallium/winsys/i965/drm/libi965drm.a \
82 $(TOP)/src/gallium/drivers/i965/libi965.a
83
84 # nouveau pipe driver
85 nouveau_CPPFLAGS :=
86 nouveau_SYS := -ldrm_nouveau
87 nouveau_LIBS := \
88 $(TOP)/src/gallium/winsys/nouveau/drm/libnouveaudrm.a \
89 $(TOP)/src/gallium/drivers/nvfx/libnvfx.a \
90 $(TOP)/src/gallium/drivers/nv50/libnv50.a \
91 $(TOP)/src/gallium/drivers/nouveau/libnouveau.a
92
93 # radeon pipe driver
94 radeon_CPPFLAGS :=
95 radeon_SYS := -ldrm -ldrm_radeon
96 radeon_LIBS := \
97 $(TOP)/src/gallium/winsys/radeon/drm/libradeonwinsys.a \
98 $(TOP)/src/gallium/drivers/r300/libr300.a
99
100 # vmwgfx pipe driver
101 vmwgfx_CPPFLAGS :=
102 vmwgfx_SYS :=
103 vmwgfx_LIBS := \
104 $(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
105 $(TOP)/src/gallium/drivers/svga/libsvga.a
106
107 # swrast (pseudo) pipe driver
108 swrast_CPPFLAGS := -DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE
109 swrast_SYS := -lm
110 swrast_LIBS := $(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
111
112 # LLVM
113 ifeq ($(MESA_LLVM),1)
114 common_SYS += $(LLVM_LIBS)
115 swrast_CPPFLAGS += -DGALLIUM_LLVMPIPE
116 swrast_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
117 LDFLAGS += $(LLVM_LDFLAGS)
118 endif
119
120 # OpenGL state tracker
121 GL_CPPFLAGS := -I$(TOP)/src/mesa $(API_DEFINES)
122 GL_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
123 GL_LIBS := $(TOP)/src/mesa/libmesagallium.a
124
125 # OpenGL ES 1.x state tracker
126 GLESv1_CM_CPPFLAGS := -I$(TOP)/src/mesa
127 GLESv1_CM_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv1_CM_LIB)
128 GLESv1_CM_LIBS := $(TOP)/src/mesa/libes1gallium.a
129
130 # OpenGL ES 2.x state tracker
131 GLESv2_CPPFLAGS := -I$(TOP)/src/mesa
132 GLESv2_SYS := -lpthread -lm -L$(TOP)/$(LIB_DIR) -l$(GLESv2_LIB)
133 GLESv2_LIBS := $(TOP)/src/mesa/libes2gallium.a
134
135 # OpenVG state tracker
136 OpenVG_CPPFLAGS := -I$(TOP)/src/gallium/state_trackers/vega
137 OpenVG_SYS := -lm -L$(TOP)/$(LIB_DIR) -l$(VG_LIB)
138 OpenVG_LIBS := $(TOP)/src/gallium/state_trackers/vega/libvega.a
139
140
141 OUTPUT_PATH := $(TOP)/$(LIB_DIR)/egl
142
143 # determine the outputs
144 ifneq ($(findstring i915,$(GALLIUM_WINSYS_DIRS)),)
145 OUTPUTS += i915
146 endif
147 ifneq ($(findstring i965,$(GALLIUM_WINSYS_DIRS)),)
148 OUTPUTS += i965
149 endif
150 ifneq ($(findstring nouveau,$(GALLIUM_WINSYS_DIRS)),)
151 OUTPUTS += nouveau
152 endif
153 ifneq ($(findstring r300,$(GALLIUM_WINSYS_DIRS)),)
154 OUTPUTS += radeon
155 endif
156 ifneq ($(findstring svga,$(GALLIUM_WINSYS_DIRS)),)
157 OUTPUTS += vmwgfx
158 endif
159 OUTPUTS += swrast
160 OUTPUTS := $(addprefix $(PIPE_PREFIX), $(OUTPUTS))
161
162 # EGL driver and state trackers
163 OUTPUTS += egl_gallium $(addprefix $(ST_PREFIX), $(EGL_CLIENT_APIS))
164
165 OUTPUTS := $(addsuffix .so, $(OUTPUTS))
166 OUTPUTS := $(addprefix $(OUTPUT_PATH)/, $(OUTPUTS))
167
168 default: $(OUTPUTS)
169
170 define mklib
171 $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
172 -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) $< \
173 -Wl,--start-group $(common_LIBS) $($(1)_LIBS) -Wl,--end-group \
174 $(common_SYS) $($(1)_SYS)
175 endef
176
177 # EGL driver
178 $(OUTPUT_PATH)/egl_gallium.so: egl.o $(egl_LIBS)
179 $(call mklib,egl)
180
181 # pipe drivers
182 $(OUTPUT_PATH)/$(PIPE_PREFIX)i915.so: pipe_i915.o $(i915_LIBS)
183 $(call mklib,i915)
184
185 $(OUTPUT_PATH)/$(PIPE_PREFIX)i965.so: pipe_i965.o $(i965_LIBS)
186 $(call mklib,i965)
187
188 $(OUTPUT_PATH)/$(PIPE_PREFIX)nouveau.so: pipe_nouveau.o $(nouveau_LIBS)
189 $(call mklib,nouveau)
190
191 $(OUTPUT_PATH)/$(PIPE_PREFIX)radeon.so: pipe_radeon.o $(radeon_LIBS)
192 $(call mklib,radeon)
193
194 $(OUTPUT_PATH)/$(PIPE_PREFIX)vmwgfx.so: pipe_vmwgfx.o $(vmwgfx_LIBS)
195 $(call mklib,vmwgfx)
196
197 $(OUTPUT_PATH)/$(PIPE_PREFIX)swrast.so: pipe_swrast.o $(swrast_LIBS)
198 $(call mklib,swrast)
199
200 # state trackers
201 $(OUTPUT_PATH)/$(ST_PREFIX)$(GL_LIB).so: st_GL.o $(GL_LIBS)
202 $(call mklib,GL)
203
204 $(OUTPUT_PATH)/$(ST_PREFIX)$(GLESv1_CM_LIB).so: st_GLESv1_CM.o $(GLESv1_CM_LIBS)
205 $(call mklib,GLESv1_CM)
206
207 $(OUTPUT_PATH)/$(ST_PREFIX)$(GLESv2_LIB).so: st_GLESv2.o $(GLESv2_LIBS)
208 $(call mklib,GLESv2)
209
210 $(OUTPUT_PATH)/$(ST_PREFIX)$(VG_LIB).so: st_OpenVG.o $(OpenVG_LIBS)
211 $(call mklib,OpenVG)
212
213 egl.o: egl.c
214 $(CC) -c -o $@ $< $(common_CPPFLAGS) $(egl_CPPFLAGS) $(DEFINES) $(CFLAGS)
215
216 pipe_%.o: pipe_%.c
217 $(CC) -c -o $@ $< $(common_CPPFLAGS) $($*_CPPFLAGS) $(DEFINES) $(CFLAGS)
218
219 st_%.o: st_%.c
220 $(CC) -c -o $@ $< $(common_CPPFLAGS) $($*_CPPFLAGS) $(DEFINES) $(CFLAGS)
221
222 install: $(OUTPUTS)
223 $(INSTALL) -d $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR)
224 for out in $(OUTPUTS); do \
225 $(MINSTALL) -m 755 "$$out" $(DESTDIR)$(EGL_DRIVER_INSTALL_DIR); \
226 done
227
228 clean:
229 rm -f *.o