mesa: Don't bind DRAW/READ_FRAMEBUFFER separately without FBO blit support
[mesa.git] / src / gallium / auxiliary / gallivm / Makefile
1 # -*-makefile-*-
2 TOP = ../../../..
3 include $(TOP)/configs/current
4
5 LIBNAME = gallivm
6
7
8 GALLIVM_SOURCES = \
9 gallivm.cpp \
10 gallivm_cpu.cpp \
11 instructions.cpp \
12 loweringpass.cpp \
13 tgsitollvm.cpp \
14 storage.cpp \
15 storagesoa.cpp \
16 instructionssoa.cpp
17
18 INC_SOURCES = gallivm_builtins.cpp gallivmsoabuiltins.cpp
19
20 CPP_SOURCES = \
21 $(GALLIVM_SOURCES)
22
23 C_SOURCES =
24 ASM_SOURCES =
25
26 OBJECTS = $(C_SOURCES:.c=.o) \
27 $(CPP_SOURCES:.cpp=.o) \
28 $(ASM_SOURCES:.S=.o)
29
30 ### Include directories
31 INCLUDES = \
32 -I. \
33 -I$(TOP)/src/gallium/drivers \
34 -I$(TOP)/src/gallium/auxiliary \
35 -I$(TOP)/src/gallium/include \
36 -I$(TOP)/src/mesa \
37 -I$(TOP)/include
38
39
40 ##### RULES #####
41
42 .c.o:
43 $(CC) -c $(INCLUDES) $(LLVM_CFLAGS) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
44
45 .cpp.o:
46 $(CXX) -c $(INCLUDES) $(LLVM_CXXFLAGS) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
47
48 .S.o:
49 $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
50
51 ##### TARGETS #####
52
53 default:: depend symlinks $(LIBNAME)
54
55
56 $(LIBNAME): $(OBJECTS) Makefile
57 $(TOP)/bin/mklib -o $@ -static $(OBJECTS)
58
59
60 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(INC_SOURCES)
61 rm -f depend
62 touch depend
63 $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) \
64 $(ASM_SOURCES) $(INC_SOURCES) 2> /dev/null
65
66
67 gallivm_builtins.cpp: llvm_builtins.c
68 clang --emit-llvm < $< |llvm-as|opt -std-compile-opts > temp1.bin
69 (echo "static const unsigned char llvm_builtins_data[] = {"; od -txC temp1.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/,0x00};/") >$@
70 rm temp1.bin
71
72 gallivmsoabuiltins.cpp: soabuiltins.c
73 clang --emit-llvm < $< |llvm-as|opt -std-compile-opts > temp2.bin
74 (echo "static const unsigned char soabuiltins_data[] = {"; od -txC temp2.bin | sed -e "s/^[0-9]*//" -e s"/ \([0-9a-f][0-9a-f]\)/0x\1,/g" -e"\$$d" | sed -e"\$$s/,$$/,0x00};/") >$@
75 rm temp2.bin
76
77 # Emacs tags
78 tags:
79 etags `find . -name \*.[ch]` `find ../include`
80
81
82 # Remove .o and backup files
83 clean:
84 -rm -f *.o */*.o *~ *.so *~ server/*.o
85 -rm -f depend depend.bak
86 -rm -f gallivm_builtins.cpp
87 -rm -f gallivmsoabuiltins.cpp
88
89 symlinks:
90
91
92 include depend