1 # Makefile for building pipe driver shared libraries.
3 # Input variables: PIPE_INSTALL_DIR, PIPE_PREFIX (optional)
6 include $(TOP
)/configs
/current
15 -I
$(TOP
)/src
/gallium
/auxiliary \
16 -I
$(TOP
)/src
/gallium
/drivers \
17 -I
$(TOP
)/src
/gallium
/include \
18 -I
$(TOP
)/src
/gallium
/winsys
21 $(TOP
)/src
/gallium
/drivers
/identity
/libidentity.a \
22 $(TOP
)/src
/gallium
/drivers
/galahad
/libgalahad.a \
23 $(TOP
)/src
/gallium
/drivers
/trace
/libtrace.a \
24 $(TOP
)/src
/gallium
/drivers
/rbug
/librbug.a \
25 $(GALLIUM_AUXILIARIES
)
27 PIPE_SYS
= $(LIBDRM_LIB
) -lm
-lpthread
$(DLOPEN_LIBS
)
29 PIPE_CFLAGS
= $(LIBDRM_CFLAGS
)
31 PIPE_LDFLAGS
= -Wl
,--no-undefined
35 $(TOP
)/src
/gallium
/winsys
/i915
/drm
/libi915drm.a \
36 $(TOP
)/src
/gallium
/drivers
/i915
/libi915.a
37 i915_SYS
= -ldrm_intel
41 $(TOP
)/src
/gallium
/winsys
/nouveau
/drm
/libnouveaudrm.a \
42 $(TOP
)/src
/gallium
/drivers
/nv30
/libnv30.a \
43 $(TOP
)/src
/gallium
/drivers
/nv50
/libnv50.a \
44 $(TOP
)/src
/gallium
/drivers
/nvc0
/libnvc0.a \
45 $(TOP
)/src
/gallium
/drivers
/nouveau
/libnouveau.a
46 nouveau_SYS
= -ldrm_nouveau
50 $(TOP
)/src
/gallium
/winsys
/radeon
/drm
/libradeonwinsys.a \
51 $(TOP
)/src
/gallium
/drivers
/r300
/libr300.a
52 r300_SYS
+= -ldrm_radeon
56 $(TOP
)/src
/gallium
/winsys
/radeon
/drm
/libradeonwinsys.a \
57 $(TOP
)/src
/gallium
/drivers
/r600
/libr600.a
58 r600_SYS
+= -ldrm_radeon
62 $(TOP
)/src
/gallium
/winsys
/svga
/drm
/libsvgadrm.a \
63 $(TOP
)/src
/gallium
/drivers
/svga
/libsvga.a
65 ifneq ($(findstring llvmpipe
,$(GALLIUM_DRIVERS_DIRS
)),)
66 swrast_LIBS
= $(TOP
)/src
/gallium
/drivers
/llvmpipe
/libllvmpipe.a
67 PIPE_CFLAGS
+= -DGALLIUM_LLVMPIPE
68 else ifneq ($(findstring softpipe
,$(GALLIUM_DRIVERS_DIRS
)),)
69 swrast_LIBS
= $(TOP
)/src
/gallium
/drivers
/softpipe
/libsoftpipe.a
70 PIPE_CFLAGS
+= -DGALLIUM_SOFTPIPE
75 PIPE_SYS
+= $(LLVM_LIBS
)
76 PIPE_LDFLAGS
+= $(LLVM_LDFLAGS
)
79 # determine the targets/sources
84 ifneq ($(findstring i915
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
85 _PIPE_TARGETS_CC
+= $(PIPE_PREFIX
)i915.so
86 PIPE_SOURCES
+= pipe_i915.c
89 ifneq ($(findstring nouveau
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
90 _PIPE_TARGETS_CXX
+= $(PIPE_PREFIX
)nouveau.so
91 PIPE_SOURCES
+= pipe_nouveau.c
94 ifneq ($(findstring radeon
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
95 ifneq ($(findstring r300
,$(GALLIUM_DRIVERS_DIRS
)),)
96 _PIPE_TARGETS_CC
+= $(PIPE_PREFIX
)r300.so
97 PIPE_SOURCES
+= pipe_r300.c
101 ifneq ($(findstring radeon
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
102 ifneq ($(findstring r600
,$(GALLIUM_DRIVERS_DIRS
)),)
103 _PIPE_TARGETS_CC
+= $(PIPE_PREFIX
)r600.so
104 PIPE_SOURCES
+= pipe_r600.c
108 ifneq ($(findstring svga
/drm
,$(GALLIUM_WINSYS_DIRS
)),)
109 _PIPE_TARGETS_CC
+= $(PIPE_PREFIX
)vmwgfx.so
110 PIPE_SOURCES
+= pipe_vmwgfx.c
113 ifneq ($(filter llvmpipe softpipe
,$(GALLIUM_DRIVERS_DIRS
)),)
114 _PIPE_TARGETS_CC
+= $(PIPE_PREFIX
)swrast.so
115 PIPE_SOURCES
+= pipe_swrast.c
118 PIPE_OBJECTS
:= $(PIPE_SOURCES
:.c
=.o
)
120 ifeq ($(MESA_LLVM
),1)
121 PIPE_TARGETS_CXX
= $(_PIPE_TARGETS_CXX
) $(_PIPE_TARGETS_CC
)
124 PIPE_TARGETS_CXX
= $(_PIPE_TARGETS_CXX
)
125 PIPE_TARGETS_CC
= $(_PIPE_TARGETS_CC
)
128 PIPE_TARGETS
= $(PIPE_TARGETS_CC
) $(PIPE_TARGETS_CXX
)
130 default
: depend
$(PIPE_TARGETS
)
134 $(PIPE_TARGETS_CC
): $(PIPE_PREFIX
)%.so
: pipe_
%.o
$(PIPE_LIBS
) $$(%_LIBS
)
135 $(MKLIB
) -o
$@
-noprefix
-linker
'$(CC)' \
136 -ldflags '-L$(TOP)/$(LIB_DIR) $(PIPE_LDFLAGS) $(LDFLAGS)' \
137 $(MKLIB_OPTIONS
) $< \
138 -Wl
,--start-group
$(PIPE_LIBS
) $($*_LIBS
) -Wl
,--end-group \
139 $(PIPE_SYS
) $($*_SYS
)
141 $(PIPE_TARGETS_CXX
): $(PIPE_PREFIX
)%.so
: pipe_
%.o
$(PIPE_LIBS
) $$(%_LIBS
)
142 $(MKLIB
) -o
$@
-noprefix
-linker
'$(CXX)' \
143 -ldflags '-L$(TOP)/$(LIB_DIR) $(PIPE_LDFLAGS) $(LDFLAGS)' \
144 $(MKLIB_OPTIONS
) $< \
145 -Wl
,--start-group
$(PIPE_LIBS
) $($*_LIBS
) -Wl
,--end-group \
146 $(PIPE_SYS
) $($*_SYS
)
148 $(PIPE_OBJECTS
): %.o
: %.c
149 $(CC
) -c
-o
$@
$< $(PIPE_CPPFLAGS
) $(PIPE_CFLAGS
) $(CFLAGS
)
151 install: $(PIPE_TARGETS
)
152 $(INSTALL
) -d
$(DESTDIR
)/$(PIPE_INSTALL_DIR
)
153 for tgt in
$(PIPE_TARGETS
); do \
154 $(MINSTALL
) "$$tgt" $(DESTDIR
)/$(PIPE_INSTALL_DIR
); \
158 rm -f
$(PIPE_TARGETS
) $(PIPE_OBJECTS
) depend depend.bak
160 depend
: $(PIPE_SOURCES
)
163 $(MKDEP
) $(MKDEP_OPTIONS
) $(PIPE_CPPFLAGS
) $(PIPE_SOURCES
) 2>/dev
/null