summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/Makefile.xvmc
blob: 5eafe9836e132e1bd8e0fbdbf6095a095cc1603b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This makefile template is used to build libXvMCg3dvl.so

LIBNAME = lib$(LIBBASENAME).so
LIB_GLOB=lib$(LIBBASENAME).*so*
XVMC_MAJOR = 1
XVMC_MINOR = 0
INCLUDES = -I$(TOP)/src/gallium/include \
	   -I$(TOP)/src/gallium/drivers \
	   -I$(TOP)/src/gallium/auxiliary \
	   -I$(TOP)/src/gallium/winsys \
	   -I$(TOP)/src/gallium/winsys/g3dvl \
	   $(DRIVER_INCLUDES)
DEFINES = -DGALLIUM_TRACE $(DRIVER_DEFINES)
LIBS = $(EXTRA_LIB_PATH) $(DRIVER_LIBS) -lXv -lX11-xcb -lxcb-dri2 -lm
STATE_TRACKER_LIB = $(TOP)/src/gallium/state_trackers/xvmc/libxvmctracker.a

ifeq ($(MESA_LLVM),1)
LDFLAGS += $(LLVM_LDFLAGS)
DRIVER_EXTRAS = $(LLVM_LIBS)
LD=$(CXX)
else
  ifeq ($(LINK_WITH_CXX),1)
    LD=$(CXX)
  else
    LD=$(CC)
  endif
endif

# XXX: Hack, XvMC public funcs aren't exported if we link to libxvmctracker.a :(
C_SOURCES += $(wildcard $(TOP)/src/gallium/state_trackers/xvmc/*.c)
OBJECTS = $(C_SOURCES:.c=.o) \
	  $(ASM_SOURCES:.S=.o)

##### RULES #####

.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@

.S.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@

##### TARGETS #####

default: depend symlinks $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME)

$(TOP)/$(LIB_DIR)/gallium/$(LIBNAME): $(OBJECTS) $(PIPE_DRIVERS) $(STATE_TRACKER_LIB) Makefile
	$(MKLIB) -o $(LIBBASENAME) -linker '$(LD)' -ldflags '$(LDFLAGS)' \
		-major $(XVMC_MAJOR) -minor $(XVMC_MINOR) $(MKLIB_OPTIONS) \
		-install $(TOP)/$(LIB_DIR)/gallium \
		$(OBJECTS) $(STATE_TRACKER_LIB) $(PIPE_DRIVERS) $(LIBS) $(DRIVER_EXTRAS)

$(TOP)/$(LIB_DIR)/gallium:
	mkdir -p $@

depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
	rm -f depend
	touch depend
	$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDES) $(C_SOURCES) \
		$(ASM_SOURCES) 2> /dev/null

# Emacs tags
tags:
	etags `find . -name \*.[ch]` `find ../include`

# Remove .o and backup files
clean:
	-rm -f *.o *~ *.so $(SYMLINKS)
	-rm -f depend depend.bak

install: default
	$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
	$(MINSTALL) -m 755 $(TOP)/$(LIB_DIR)/gallium/$(LIB_GLOB) $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)

include depend