Merge branch 'llvm-cliptest-viewport'
[mesa.git] / src / gallium / state_trackers / xorg / Makefile
index a00ea3e2a4e4661c7c7982c144d0369217e7d4cb..7a44d28017bf87e9f4ee0685f786146ef456d29d 100644 (file)
@@ -1,29 +1,23 @@
-TARGET     = libxorgtracker.a
-CFILES     = $(wildcard ./*.c)
-OBJECTS    = $(patsubst ./%.c,./%.o,$(CFILES))
-GALLIUMDIR = ../..
-TOP        = ../../../..
-
+TOP = ../../../..
 include $(TOP)/configs/current
 
-CFLAGS = -DHAVE_CONFIG_H \
-         -g -Wall -Wimplicit-function-declaration -fPIC \
-         $(shell pkg-config --cflags pixman-1 xorg-server libdrm xproto) \
-         -I$(GALLIUMDIR)/include \
-         -I$(GALLIUMDIR)/auxiliary \
-         -I$(TOP)/src/mesa/drivers/dri/common \
-         -I$(TOP)/src/mesa \
-         -I$(TOP)/include \
-         -I$(TOP)/src/egl/main
-
-#############################################
-
-.PHONY = all clean
+LIBNAME = xorgtracker
 
-all: $(TARGET)
+LIBRARY_INCLUDES = \
+       -DHAVE_CONFIG_H \
+       $(shell pkg-config xextproto --atleast-version=7.0.99.1 \
+                               && echo "-DHAVE_XEXTPROTO_71") \
+       $(shell pkg-config libkms --atleast-version=1.0 \
+                               && echo "-DHAVE_LIBKMS") \
+       $(shell pkg-config libkms --silence-errors --cflags-only-I) \
+       $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto dri2proto) \
+       -I$(TOP)/src/gallium/include \
+       -I$(TOP)/src/gallium/auxiliary \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/drivers/dri/common \
+       -I$(TOP)/src/mesa/main
 
-$(TARGET): $(OBJECTS)
-       ar rcs $(TARGET) $(OBJECTS)
+C_SOURCES = $(wildcard ./*.c)
 
-clean:
-       rm -rf $(OBJECTS) $(TARGET)
+include ../../Makefile.template