1# This makefile template is used to build "driver"_drv_video.so 2 3LIBNAME = lib$(LIBBASENAME).so 4VA_LIB_GLOB= lib$(LIBBASENAME).*so* 5VA_MAJOR = 0 6VA_MINOR = 3 7INCLUDES = -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) 12DEFINES = -DGALLIUM_TRACE -DVER_MAJOR=$(VA_MAJOR) -DVER_MINOR=$(VA_MINOR) $(DRIVER_DEFINES) 13LIBS = $(DRIVER_LIBS) -lva -lXext -lX11 -lm 14STATE_TRACKER_LIB = $(TOP)/src/gallium/state_trackers/va/libvatracker.a 15 16ifeq ($(MESA_LLVM),1) 17LDFLAGS += $(LLVM_LDFLAGS) 18DRIVER_EXTRAS = $(LLVM_LIBS) 19LD=$(CXX) 20else 21 ifeq ($(LINK_WITH_CXX),1) 22 LD=$(CXX) 23 else 24 LD=$(CC) 25 endif 26endif 27 28# XXX: Hack, VA public funcs aren't exported 29OBJECTS = $(C_SOURCES:.c=.o) \ 30 $(ASM_SOURCES:.S=.o) \ 31 $(TOP)/src/gallium/state_trackers/va/*.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 43default: 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 $(VA_MAJOR) -minor $(VA_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 54depend: $(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 61tags: 62 etags `find . -name \*.[ch]` `find ../include` 63 64# Remove .o and backup files 65clean: 66 -rm -f $(OBJECTS) *~ *.so $(SYMLINKS) 67 -rm -f depend depend.bak 68 69install: default 70 $(INSTALL) -d $(DESTDIR)$(VA_LIB_INSTALL_DIR) 71 $(MINSTALL) -m 755 $(TOP)/$(LIB_DIR)/gallium/$(VA_LIB_GLOB) $(DESTDIR)$(VA_LIB_INSTALL_DIR) 72 73include depend 74