1 # This makefile template is used to build libvdpau_g3dvl.so 2 3 LIBNAME = lib$(LIBBASENAME).so 4 VDPAU_LIB_GLOB=lib$(LIBBASENAME).*so* 5 VDPAU_MAJOR = 1 6 VDPAU_MINOR = 0 7 INCLUDES = -I$(TOP)/src/gallium/include \ 8 -I$(TOP)/src/gallium/drivers \ 9 -I$(TOP)/src/gallium/auxiliary \ 10 -I$(TOP)/src/gallium/winsys \ 11 $(DRIVER_INCLUDES) 12 DEFINES = -DGALLIUM_TRACE -DVER_MAJOR=$(VDPAU_MAJOR) -DVER_MINOR=$(VDPAU_MINOR) $(DRIVER_DEFINES) 13 LIBS = $(DRIVER_LIBS) -lvdpau -lX11-xcb -lxcb-dri2 -lm -lrt 14 STATE_TRACKER_LIB = $(TOP)/src/gallium/state_trackers/vdpau/libvdpautracker.a 15 16 ifeq ($(MESA_LLVM),1) 17 LDFLAGS += $(LLVM_LDFLAGS) 18 DRIVER_EXTRAS = $(LLVM_LIBS) 19 LD=$(CXX) 20 else 21 ifeq ($(LINK_WITH_CXX),1) 22 LD=$(CXX) 23 else 24 LD=$(CC) 25 endif 26 endif 27 28 # XXX: Hack, VDPAU public funcs aren't exported if we link to libvdpautracker.a :( 29 C_SOURCES += $(TOP)/src/gallium/state_trackers/vdpau/device.c 30 OBJECTS = $(C_SOURCES:.c=.o) \ 31 $(ASM_SOURCES:.S=.o) 32 33 ##### RULES ##### 34 35 .c.o: 36 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ 37 38 .S.o: 39 $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ 40 41 ##### TARGETS ##### 42 43 default: depend symlinks $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME) 44 45 $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME): $(OBJECTS) $(PIPE_DRIVERS) $(STATE_TRACKER_LIB) Makefile 46 $(MKLIB) -o $(LIBBASENAME) -linker '$(LD)' -ldflags '$(LDFLAGS)' \ 47 -major $(VDPAU_MAJOR) -minor $(VDPAU_MINOR) $(MKLIB_OPTIONS) \ 48 -install $(TOP)/$(LIB_DIR)/gallium \ 49 $(OBJECTS) $(STATE_TRACKER_LIB) $(PIPE_DRIVERS) $(LIBS) $(DRIVER_EXTRAS) 50 51 $(TOP)/$(LIB_DIR)/gallium: 52 mkdir -p $@ 53 54 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) 55 rm -f depend 56 touch depend 57 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(C_SOURCES) \ 58 $(ASM_SOURCES) 2> /dev/null 59 60 # Emacs tags 61 tags: 62 etags `find . -name \*.[ch]` `find ../include` 63 64 # Remove .o and backup files 65 clean: 66 -rm -f $(OBJECTS) *~ *.so $(SYMLINKS) 67 -rm -f depend depend.bak 68 69 install: default 70 $(INSTALL) -d $(DESTDIR)$(VDPAU_LIB_INSTALL_DIR) 71 $(MINSTALL) -m 755 $(TOP)/$(LIB_DIR)/gallium/$(VDPAU_LIB_GLOB) $(DESTDIR)$(VDPAU_LIB_INSTALL_DIR) 72 73 include depend 74