blob: cc7f5c12ca485450f5c474091ac179f1161829f7 (
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
TOP = .
include $(TOP)/configs/current
CL_SOURCES = \
src/api_command.cpp \
src/api_context.cpp \
src/api_device.cpp \
src/api_enqueue.cpp \
src/api_event.cpp \
src/api_flush.cpp \
src/api_kernel.cpp \
src/api_memory.cpp \
src/api_platform.cpp \
src/api_profiling.cpp \
src/api_program.cpp \
src/api_sampler.cpp
CPUWS_SOURCES = \
cpuwinsys/cpuwinsys.c
### All the core C sources
ALL_SOURCES = \
$(CL_SOURCES) \
$(CPUWS_SOURCES)
### Object files
CL_OBJECTS = \
$(CL_SOURCES:.cpp=.o) \
$(CPUWS_SOURCES:.c=.o)
### Include directories
INCLUDE_DIRS = \
-I$(TOP) \
-I$(TOP)/include \
-I$(GALLIUM)/include \
-I$(GALLIUM)/src/gallium/include \
-I$(GALLIUM)/src/gallium/auxiliary \
-I$(GALLIUM)/src/gallium/drivers
CL_LIB = OpenCL
CL_LIB_NAME = lib$(CL_LIB).so
CL_MAJOR = 1
CL_MINOR = 0
CL_TINY = 0
GALLIUM_LIBS = \
$(GALLIUM)/src/gallium/auxiliary/pipebuffer/libpipebuffer.a \
$(GALLIUM)/src/gallium/auxiliary/sct/libsct.a \
$(GALLIUM)/src/gallium/auxiliary/draw/libdraw.a \
$(GALLIUM)/src/gallium/auxiliary/rtasm/librtasm.a \
$(GALLIUM)/src/gallium/auxiliary/translate/libtranslate.a \
$(GALLIUM)/src/gallium/auxiliary/cso_cache/libcso_cache.a \
$(GALLIUM)/src/gallium/auxiliary/tgsi/libtgsi.a \
$(GALLIUM)/src/gallium/auxiliary/util/libutil.a
.SUFFIXES : .cpp
.c.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
.cpp.o:
$(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
.S.o:
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
default: depend subdirs $(TOP)/$(LIB_DIR)/$(CL_LIB_NAME)
# Make the OpenCL library
$(TOP)/$(LIB_DIR)/$(CL_LIB_NAME): $(CL_OBJECTS) $(GALLIUM_LIBS)
$(TOP)/bin/mklib -o $(CL_LIB) \
-major $(CL_MAJOR) \
-minor $(CL_MINOR) \
-patch $(CL_TINY) \
-install $(TOP)/$(LIB_DIR) \
$(CL_OBJECTS) $(GALLIUM_LIBS) \
-Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive $(SYS_LIBS)
######################################################################
# Generic stuff
depend: $(ALL_SOURCES)
@ echo "running $(MKDEP)"
@ rm -f depend # workaround oops on gutsy?!?
@ touch depend
@ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
> /dev/null 2>/dev/null
subdirs:
install: default
$(INSTALL) -d $(INSTALL_DIR)/include/OpenCL
$(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
$(INSTALL) -m 644 $(TOP)/include/OpenCL/*.h $(INSTALL_DIR)/include/OpenCL
@if [ -e $(TOP)/$(LIB_DIR)/$(CL_LIB_NAME) ]; then \
$(INSTALL) $(TOP)/$(LIB_DIR)/libOpenCL* $(INSTALL_DIR)/$(LIB_DIR); \
fi
# Emacs tags
tags:
etags `find . -name \*.[ch]` $(TOP)/include/OpenCL/*.h
clean:
-rm -f */*.o
-rm -f */*/*.o
-rm -f depend depend.bak
include depend
|