e6ac399d08805d082fc009c85d6642184b5f8c8f
[mesa.git] / src / gallium / aux / llvm / 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
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/aux \
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|llvm2cpp -gen-contents -o=$@ -f -for=shader -funcname=createGallivmBuiltins
69
70
71 # Emacs tags
72 tags:
73 etags `find . -name \*.[ch]` `find ../include`
74
75
76 # Remove .o and backup files
77 clean:
78 -rm -f *.o */*.o *~ *.so *~ server/*.o
79 -rm -f depend depend.bak
80 -rm -f gallivm_builtins.cpp
81
82 symlinks:
83
84
85 include depend