gallium: Don't depend directly on staging dir in Xorg template makefile
[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_LINKS are flags given to the linker
13
14 ### Basic defines ###
15
16 OBJECTS = $(C_SOURCES:.c=.o) \
17 $(CPP_SOURCES:.cpp=.o) \
18 $(ASM_SOURCES:.S=.o)
19
20 INCLUDES = \
21 $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
22 -I$(TOP)/src/gallium/include \
23 -I$(TOP)/src/gallium/drivers \
24 -I$(TOP)/src/gallium/auxiliary \
25 $(DRIVER_INCLUDES)
26
27 LIBNAME_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET)
28
29
30 ##### TARGETS #####
31
32 default: depend $(TOP)/$(LIB_DIR)/gallium $(LIBNAME) $(LIBNAME_STAGING)
33
34 $(LIBNAME): $(OBJECTS) Makefile $(LIBS)
35 $(MKLIB) -noprefix -o $@ $(OBJECTS) $(DRIVER_LINKS)
36
37 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
38 rm -f depend
39 touch depend
40 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
41
42 $(LIBNAME_STAGING): $(LIBNAME)
43 $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR)/gallium
44
45 $(TOP)/$(LIB_DIR)/gallium:
46 mkdir -p $@
47
48 clean:
49 rm -f $(OBJECTS) $(GENERATED_SOURCES) $(LIBNAME).a depend depend.bak
50
51 install:
52 $(INSTALL) -d $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR)
53 $(MINSTALL) -m 755 $(LIBNAME) $(DESTDIR)/$(XORG_DRIVER_INSTALL_DIR)
54
55
56 ##### RULES #####
57
58 %.s: %.c
59 $(CC) -S $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
60
61 %.o: %.c
62 $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
63
64 %.o: %.cpp
65 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@
66
67 %.o: %.S
68 $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
69
70 sinclude depend
71
72 .PHONY: default clean install