OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 SOURCES_COMMON = xlib_window.cc utils.cc | 5 SOURCES_COMMON = xlib_window.cc utils.cc |
6 SOURCES_GL_BENCH = main.cc bench.cc shaders.cc | 6 SOURCES_GL_BENCH = main.cc bench.cc shaders.cc |
7 SOURCES_TEARTEST = teartest.cc | 7 SOURCES_TEARTEST = teartest.cc |
8 SOURCES_WINDOWMANAGERTEST = windowmanagertest.cc | 8 SOURCES_WINDOWMANAGERTEST = windowmanagertest.cc |
9 SOURCES_ALL = $(SOURCES_COMMON) \ | 9 SOURCES_ALL = $(SOURCES_COMMON) \ |
10 $(SOURCES_GL_BENCH) \ | 10 $(SOURCES_GL_BENCH) \ |
11 $(SOURCES_TEARTEST) \ | 11 $(SOURCES_TEARTEST) \ |
12 $(SOURCES_WINDOWMANAGERTEST) | 12 $(SOURCES_WINDOWMANAGERTEST) |
13 | 13 |
14 CXXFLAGS = -g -Wall -Werror -I$(GCLIENT_ROOT)/src/third_party/chrome/files | 14 CXXFLAGS = -g -Wall -Werror -I$(GCLIENT_ROOT)/src/third_party/chrome/files |
15 LDFLAGS = -lGL -lX11 | 15 LDFLAGS = -lGL -lX11 |
16 LDFLAGS += -L$(GCLIENT_ROOT)/src/third_party/chrome -lbase -lrt -lgflags | 16 LDFLAGS += -L$(GCLIENT_ROOT)/src/third_party/chrome -lbase -lrt -lgflags |
17 GL_BENCH = ../glbench | 17 GL_BENCH = ../glbench |
18 TEARTEST = ../teartest | 18 TEARTEST = ../teartest |
19 WINDOWMANAGERTEST = ../windowmanagertest | 19 WINDOWMANAGERTEST = ../windowmanagertest |
20 | 20 |
21 GCLIENT_ROOT ?= ../../../../../../../.. | 21 GCLIENT_ROOT ?= ../../../../../../../.. |
22 | 22 |
23 ifdef USE_EGL | 23 ifdef USE_EGL |
24 CXXFLAGS += -I$(GCLIENT_ROOT)/src/third_party/khronos/files/include | 24 CXXFLAGS += -I$(GCLIENT_ROOT)/src/third_party/khronos/files/include -DUSE_EGL |
25 SOURCES_COMMON += egl_stuff.cc | 25 SOURCES_COMMON += egl_stuff.cc |
26 SOURCES_TEARTEST += teartest_egl.cc | 26 SOURCES_TEARTEST += teartest_egl.cc |
27 LDFLAGS += -L$(GCLIENT_ROOT)/src/third_party/khronos/files -lEGL | 27 LDFLAGS += -L$(GCLIENT_ROOT)/src/third_party/khronos/files -lEGL |
28 else | 28 else |
29 SOURCES_COMMON += glx_stuff.cc | 29 SOURCES_COMMON += glx_stuff.cc |
30 SOURCES_TEARTEST += teartest_glx.cc | 30 SOURCES_TEARTEST += teartest_glx.cc |
31 endif | 31 endif |
32 | 32 |
33 OBJS_COMMON = $(SOURCES_COMMON:.cc=.o) | 33 OBJS_COMMON = $(SOURCES_COMMON:.cc=.o) |
34 OBJS_GL_BENCH = $(SOURCES_GL_BENCH:.cc=.o) | 34 OBJS_GL_BENCH = $(SOURCES_GL_BENCH:.cc=.o) |
35 OBJS_TEARTEST = $(SOURCES_TEARTEST:.cc=.o) | 35 OBJS_TEARTEST = $(SOURCES_TEARTEST:.cc=.o) |
36 OBJS_WINDOWMANAGERTEST = $(SOURCES_WINDOWMANAGERTEST:.cc=.o) | 36 OBJS_WINDOWMANAGERTEST = $(SOURCES_WINDOWMANAGERTEST:.cc=.o) |
37 OBJS_ALL = $(SOURCES_ALL:.cc=.o) | 37 OBJS_ALL = $(SOURCES_ALL:.cc=.o) |
38 DEPS_ALL = $(SOURCES_ALL:.cc=.d) | 38 DEPS_ALL = $(SOURCES_ALL:.cc=.d) |
39 | 39 |
40 .PHONY: all clean | 40 .PHONY: all clean |
41 | 41 |
42 all: $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST) | 42 all: $(GL_BENCH) $(TEARTEST) |
| 43 |
| 44 ifndef USE_EGL |
| 45 all: $(WINDOWMANAGERTEST) |
| 46 endif |
43 | 47 |
44 $(TEARTEST): $(OBJS_COMMON) $(OBJS_TEARTEST) | 48 $(TEARTEST): $(OBJS_COMMON) $(OBJS_TEARTEST) |
45 $(GL_BENCH): $(OBJS_COMMON) $(OBJS_GL_BENCH) | 49 $(GL_BENCH): $(OBJS_COMMON) $(OBJS_GL_BENCH) |
46 $(WINDOWMANAGERTEST): $(OBJS_COMMON) $(OBJS_WINDOWMANAGERTEST) | 50 $(WINDOWMANAGERTEST): $(OBJS_COMMON) $(OBJS_WINDOWMANAGERTEST) |
47 | 51 |
48 clean: | 52 clean: |
49 $(RM) $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST) | 53 $(RM) $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST) |
50 $(RM) $(OBJS_ALL) $(DEPS_ALL) | 54 $(RM) $(OBJS_ALL) $(DEPS_ALL) |
51 | 55 |
52 $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST): | 56 $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST): |
53 $(CXX) $^ -o $@ $(CXXFLAGS) $(LDFLAGS) | 57 $(CXX) $^ -o $@ $(CXXFLAGS) $(LDFLAGS) |
54 | 58 |
55 $(OBJS_ALL): %.o: %.cc | 59 $(OBJS_ALL): %.o: %.cc |
56 $(CXX) $(CXXFLAGS) -c $< -o $@ -MMD | 60 $(CXX) $(CXXFLAGS) -c $< -o $@ -MMD |
57 | 61 |
58 -include $(DEPS_ALL) | 62 -include $(DEPS_ALL) |
OLD | NEW |