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 swaptest.cc yuvtest.cc testbase.cc | 6 SOURCES_GL_BENCH = main.cc swaptest.cc yuvtest.cc testbase.cc |
7 SOURCES_GL_BENCH += fillratetest.cc readpixeltest.cc trianglesetuptest.cc | 7 SOURCES_GL_BENCH += readpixeltest.cc |
8 SOURCES_GL_BENCH += attributefetchtest.cc varyingsandddxytest.cc cleartest.cc | 8 SOURCES_GL_BENCH += attributefetchtest.cc varyingsandddxytest.cc cleartest.cc |
9 SOURCES_GL_BENCH += windowmanagercompositingtest.cc textureupdatetest.cc | 9 SOURCES_GL_BENCH += textureupdatetest.cc |
| 10 |
| 11 GRAPHICS_BACKEND ?= OPENGL |
| 12 |
| 13 # TODO: port these to GLES |
| 14 ifeq ($(GRAPHICS_BACKEND),OPENGL) |
| 15 SOURCES_GL_BENCH += fillratetest.cc trianglesetuptest.cc |
| 16 SOURCES_GL_BENCH += windowmanagercompositingtest.cc |
| 17 endif |
10 SOURCES_TEARTEST = teartest.cc | 18 SOURCES_TEARTEST = teartest.cc |
11 SOURCES_WINDOWMANAGERTEST = windowmanagertest.cc | 19 SOURCES_WINDOWMANAGERTEST = windowmanagertest.cc |
12 SOURCES_ALL = $(SOURCES_COMMON) \ | 20 SOURCES_ALL = $(SOURCES_COMMON) \ |
13 $(SOURCES_GL_BENCH) \ | 21 $(SOURCES_GL_BENCH) \ |
14 $(SOURCES_TEARTEST) \ | 22 $(SOURCES_TEARTEST) \ |
15 $(SOURCES_WINDOWMANAGERTEST) | 23 $(SOURCES_WINDOWMANAGERTEST) |
16 | 24 |
17 CXXFLAGS = -g -Wall -Werror -I$(GCLIENT_ROOT)/src/third_party/chrome/files | 25 CXXFLAGS = -g -Wall -Werror |
18 LDFLAGS = -lGL -lX11 | 26 LDFLAGS = -lbase -lrt -lgflags |
19 LDFLAGS += -L$(GCLIENT_ROOT)/src/third_party/chrome -lbase -lrt -lgflags | 27 # To compile outside of chroot, use the following two lines: |
| 28 #CXXFLAGS += -I../../../../../../chrome/files |
| 29 #LDFLAGS += -L../../../../../../chrome |
| 30 |
20 GL_BENCH = ../glbench | 31 GL_BENCH = ../glbench |
21 TEARTEST = ../teartest | 32 TEARTEST = ../teartest |
22 WINDOWMANAGERTEST = ../windowmanagertest | 33 WINDOWMANAGERTEST = ../windowmanagertest |
23 | 34 |
24 GCLIENT_ROOT ?= ../../../../../../../.. | 35 ifeq ($(GRAPHICS_BACKEND),OPENGLES) |
25 | 36 CXXFLAGS += -DUSE_OPENGLES |
26 ifdef USE_EGL | |
27 CXXFLAGS += -I$(GCLIENT_ROOT)/src/third_party/khronos/files/include -DUSE_EGL | |
28 SOURCES_COMMON += egl_stuff.cc | 37 SOURCES_COMMON += egl_stuff.cc |
29 SOURCES_TEARTEST += teartest_egl.cc | 38 SOURCES_TEARTEST += teartest_egl.cc |
30 LDFLAGS += -L$(GCLIENT_ROOT)/src/third_party/khronos/files -lEGL | 39 LDFLAGS += -lGLESv2 -lX11 -lEGL |
31 else | 40 else ifeq ($(GRAPHICS_BACKEND),OPENGL) |
| 41 CXXFLAGS += -DUSE_OPENGL -DI915_WORKAROUND |
32 SOURCES_COMMON += glx_stuff.cc | 42 SOURCES_COMMON += glx_stuff.cc |
33 SOURCES_TEARTEST += teartest_glx.cc | 43 SOURCES_TEARTEST += teartest_glx.cc |
| 44 LDFLAGS += -lGL -lX11 |
34 endif | 45 endif |
35 | 46 |
36 OBJS_COMMON = $(SOURCES_COMMON:.cc=.o) | 47 OBJS_COMMON = $(SOURCES_COMMON:.cc=.o) |
37 OBJS_GL_BENCH = $(SOURCES_GL_BENCH:.cc=.o) | 48 OBJS_GL_BENCH = $(SOURCES_GL_BENCH:.cc=.o) |
38 OBJS_TEARTEST = $(SOURCES_TEARTEST:.cc=.o) | 49 OBJS_TEARTEST = $(SOURCES_TEARTEST:.cc=.o) |
39 OBJS_WINDOWMANAGERTEST = $(SOURCES_WINDOWMANAGERTEST:.cc=.o) | 50 OBJS_WINDOWMANAGERTEST = $(SOURCES_WINDOWMANAGERTEST:.cc=.o) |
40 OBJS_ALL = $(SOURCES_ALL:.cc=.o) | 51 OBJS_ALL = $(SOURCES_ALL:.cc=.o) |
41 DEPS_ALL = $(SOURCES_ALL:.cc=.d) | 52 DEPS_ALL = $(SOURCES_ALL:.cc=.d) |
42 | 53 |
43 .PHONY: all clean | 54 .PHONY: all clean |
44 | 55 |
45 all: $(GL_BENCH) $(TEARTEST) | 56 all: $(GL_BENCH) $(TEARTEST) |
46 | 57 |
47 ifndef USE_EGL | 58 ifeq ($(GRAPHICS_BACKEND),OPENGL) |
48 all: $(WINDOWMANAGERTEST) | 59 all: $(WINDOWMANAGERTEST) |
49 endif | 60 endif |
50 | 61 |
51 $(TEARTEST): $(OBJS_COMMON) $(OBJS_TEARTEST) | 62 $(TEARTEST): $(OBJS_COMMON) $(OBJS_TEARTEST) |
52 $(GL_BENCH): $(OBJS_COMMON) $(OBJS_GL_BENCH) | 63 $(GL_BENCH): $(OBJS_COMMON) $(OBJS_GL_BENCH) |
53 $(WINDOWMANAGERTEST): $(OBJS_COMMON) $(OBJS_WINDOWMANAGERTEST) | 64 $(WINDOWMANAGERTEST): $(OBJS_COMMON) $(OBJS_WINDOWMANAGERTEST) |
54 | 65 |
55 clean: | 66 clean: |
56 $(RM) $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST) | 67 $(RM) $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST) |
57 $(RM) $(OBJS_ALL) $(DEPS_ALL) | 68 $(RM) $(OBJS_ALL) $(DEPS_ALL) |
| 69 $(RM) *.o *.d |
58 | 70 |
59 $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST): | 71 $(GL_BENCH) $(TEARTEST) $(WINDOWMANAGERTEST): |
60 $(CXX) $^ -o $@ $(CXXFLAGS) $(LDFLAGS) | 72 $(CXX) $^ -o $@ $(CXXFLAGS) $(LDFLAGS) |
61 | 73 |
62 $(OBJS_ALL): %.o: %.cc | 74 $(OBJS_ALL): %.o: %.cc |
63 $(CXX) $(CXXFLAGS) -c $< -o $@ -MMD | 75 $(CXX) $(CXXFLAGS) -c $< -o $@ -MMD |
64 | 76 |
65 -include $(DEPS_ALL) | 77 -include $(DEPS_ALL) |
OLD | NEW |