draw: corrections to allow for different cliptest cases
[mesa.git] / src / gallium / targets / Makefile.xorg
1 # src/gallium/targets/Makefile.xorg
2
3 # Template makefile for gallium xorg drivers.
4 #
5 # Usage:
6 # The minimum that the including makefile needs to define
7 # is TOP, LIBNAME and one of of the *_SOURCES.
8 #
9 # Optional defines:
10 # DRIVER_INCLUDES are appended to the list of includes directories.
11 # DRIVER_DEFINES is not used for makedepend, but for compilation.
12 # DRIVER_PIPES are pipe drivers and modules that the driver depends on.
13 # DRIVER_LINKS are flags given to the linker.
14
15 ### Basic defines ###
16
17 OBJECTS = $(C_SOURCES:.c=.o) \
18 $(CPP_SOURCES:.cpp=.o) \
19 $(ASM_SOURCES:.S=.o)
20
21 INCLUDES = \
22 $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
23 -I$(TOP)/src/gallium/include \
24 -I$(TOP)/src/gallium/drivers \
25 -I$(TOP)/src/gallium/auxiliary \
26 -I$(TOP)/src/gallium/winsys \
27 $(DRIVER_INCLUDES)
28
29 LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET)
30
31 ifeq ($(MESA_LLVM),1)
32 LD = g++
33 LDFLAGS += $(LLVM_LDFLAGS)
34 USE_CXX=1
35 DRIVER_PIPES += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
36 DRIVER_LINKS += $(LLVM_LIBS) -lm -ldl
37 endif
38
39
40 ##### TARGETS #####
41
42 default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
43
44 $(LIBNAME): $(OBJECTS) Makefile ../Makefile.xorg $(LIBS) $(DRIVER_PIPES)
45 $(MKLIB) -noprefix -o $@ $(LDFLAGS) $(OBJECTS) $(DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $(DRIVER_LINKS)
46
47 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
48 rm -f depend
49 touch depend
50 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
51
52 $(LIBNAME_STAGING): $(LIBNAME)
53 $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium
54
55 $(TOP)/$(LIB_DIR)/gallium:
56 mkdir -p $@
57
58 clean:
59 rm -f $(OBJECTS) $(GENERATED_SOURCES) $(LIBNAME).a depend depend.bak
60
61 install:
62 $(INSTALL) -d $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR)
63 $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR)
64
65
66 ##### RULES #####
67
68 %.s: %.c
69 $(CC) -S $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
70
71 %.o: %.c
72 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
73
74 %.o: %.cpp
75 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
76
77 %.o: %.S
78 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
79
80 sinclude depend
81
82 .PHONY: default clean install