Home | History | Annotate | Download | only in xa-vmwgfx
      1 TOP = ../../../..
      2 include $(TOP)/configs/current
      3 
      4 ##### MACROS #####
      5 
      6 XA_MAJOR = 1
      7 XA_MINOR = 0
      8 XA_TINY = 0
      9 XA_CFLAGS = -Wall -pedantic
     10 
     11 XA_INCLUDES= -I$(TOP)/src/gallium/ \
     12 	-I$(TOP)/src/gallium/auxiliary \
     13 	-I$(TOP)/src/gallium/include \
     14 	-I$(TOP)/src/gallium/winsys \
     15 	-I$(TOP)/src/gallium/drivers
     16 
     17 XA_LIB = xatracker
     18 XA_LIB_NAME = lib$(XA_LIB).so
     19 XA_LIB_GLOB = lib$(XA_LIB)*.so*
     20 XA_LIB_DEPS = \
     21 	$(TOP)/src/gallium/state_trackers/xa/libxatracker.o \
     22 	$(TOP)/src/gallium/winsys/svga/drm/libsvgadrm.a \
     23 	$(TOP)/src/gallium/drivers/svga/libsvga.a \
     24 	$(TOP)/src/gallium/drivers/trace/libtrace.a \
     25 	$(TOP)/src/gallium/drivers/rbug/librbug.a
     26 
     27 
     28 COMMON_GALLIUM_SOURCES=
     29 
     30 SOURCES = vmw_target.c
     31 OBJECTS = $(SOURCES:.c=.o)
     32 
     33 ifeq ($(MESA_LLVM),1)
     34 LDFLAGS += $(LLVM_LDFLAGS)
     35 GALLIUM_AUXILIARIES += $(LLVM_LIBS)
     36 LD=$(CXX)
     37 else
     38   ifeq ($(LINK_WITH_CXX),1)
     39     LD=$(CXX)
     40   else
     41     LD=$(CC)
     42   endif
     43 endif
     44 
     45 ##### RULES #####
     46 
     47 .c.o:
     48 	$(CC) -c $(XA_CFLAGS) $(CFLAGS) $(XA_INCLUDES) $<
     49 
     50 
     51 ##### TARGETS #####
     52 
     53 default: $(TOP)/$(LIB_DIR)/gallium/$(XA_LIB_NAME)
     54 
     55 # Generate list of library visible symbols
     56 xa_symbols: $(TOP)/src/gallium/state_trackers/xa/libxatracker.o
     57 	$(NM) $< | $(GREP) ' T ' | $(AWK) '{print $$3}' > $@
     58 
     59 # Make the library
     60 $(TOP)/$(LIB_DIR)/gallium/$(XA_LIB_NAME): depend $(OBJECTS) $(XA_LIB_DEPS) \
     61 	xa_symbols
     62 	$(MKLIB) -o $(XA_LIB) -linker $(LD) -ldflags '$(LDFLAGS)' \
     63 		-major $(XA_MAJOR) -minor $(XA_MINOR) -patch $(XA_TINY) \
     64 		$(MKLIB_OPTIONS) \
     65 		-exports xa_symbols \
     66 		 -install $(TOP)/$(LIB_DIR)/gallium \
     67 		$(OBJECTS) $(XA_LIB_DEPS) $(GALLIUM_AUXILIARIES)
     68 
     69 # xa pkgconfig file
     70 pcedit = sed \
     71 	-e 's,@INSTALL_DIR@,$(INSTALL_DIR),g' \
     72 	-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),g' \
     73 	-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),g' \
     74 	-e 's,@VERSION@,$(XA_MAJOR).$(XA_MINOR).$(XA_TINY),g' \
     75 	-e 's,@XA_PC_REQ_PRIV@,$(XA_PC_REQ_PRIV),g' \
     76 	-e 's,@XA_PC_LIB_PRIV@,$(XA_PC_LIB_PRIV),g' \
     77 	-e 's,@XA_PC_CFLAGS@,$(XA_PC_CFLAGS),g' \
     78 	-e 's,@XA_LIB@,$(XA_LIB),g'
     79 xatracker.pc: xatracker.pc.in
     80 	$(pcedit) $< > $@
     81 
     82 install: xatracker.pc
     83 	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)
     84 	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
     85 	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
     86 	$(INSTALL) -m 644 $(TOP)/src/gallium/state_trackers/xa/xa_tracker.h $(DESTDIR)$(INSTALL_INC_DIR)
     87 	$(INSTALL) -m 644 $(TOP)/src/gallium/state_trackers/xa/xa_context.h $(DESTDIR)$(INSTALL_INC_DIR)
     88 	$(INSTALL) -m 644 $(TOP)/src/gallium/state_trackers/xa/xa_composite.h $(DESTDIR)$(INSTALL_INC_DIR)
     89 	$(MINSTALL) -m 755 $(TOP)/$(LIB_DIR)/gallium/$(XA_LIB_GLOB) $(DESTDIR)$(INSTALL_LIB_DIR)
     90 	$(INSTALL) -m 644 xatracker.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
     91 
     92 clean:
     93 	-rm -f *.o *~
     94 	-rm -f *.lo
     95 	-rm -f *.la
     96 	-rm -f *.pc
     97 	-rm -rf .libs
     98 	-rm -f depend depend.bak exptmp xa_symbols
     99 
    100 
    101 depend: $(SOURCES)
    102 	@ echo "running $(MKDEP)"
    103 	@ rm -f depend
    104 	@ touch depend
    105 	@ $(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(XA_INCLUDES) $(SOURCES) \
    106 		> /dev/null
    107 
    108 -include depend
    109 
    110 FORCE:
    111