Home | History | Annotate | Download | only in targets
      1 # This makefile template is used to build "driver"_drv_video.so
      2 
      3 LIBNAME = lib$(LIBBASENAME).so
      4 VA_LIB_GLOB= lib$(LIBBASENAME).*so*
      5 VA_MAJOR = 0
      6 VA_MINOR = 3
      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=$(VA_MAJOR) -DVER_MINOR=$(VA_MINOR) $(DRIVER_DEFINES)
     13 LIBS = $(DRIVER_LIBS) -lva -lXext -lX11 -lm
     14 STATE_TRACKER_LIB = $(TOP)/src/gallium/state_trackers/va/libvatracker.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, VA public funcs aren't exported
     29 OBJECTS = $(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 
     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 $(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 
     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)$(VA_LIB_INSTALL_DIR)
     71 	$(MINSTALL) -m 755 $(TOP)/$(LIB_DIR)/gallium/$(VA_LIB_GLOB) $(DESTDIR)$(VA_LIB_INSTALL_DIR)
     72 
     73 include depend
     74