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 3 # found in the LICENSE file. 4 5 # To dynamically link to GLES libs, export IMPORTGL=1 6 IMPORTGL = 0 7 8 OPTIONS = -O3 -Wall 9 FLAGS = -D SUPERSHAPE_HIGH_RES 10 11 TARGET_GL = SanOGL 12 TARGET_ES = SanOGLES 13 TARGET_ES_S = SanOGLES_S 14 15 ifeq ($(GRAPHICS_BACKEND), OPENGL) 16 LDFLAGS = -lm -lGL 17 SRCS = demo.c app-linux.c importvbo.c 18 TARGET = $(TARGET_GL) 19 else ifeq ($(GRAPHICS_BACKEND), OPENGLES) 20 FLAGS += -D SAN_ANGELES_OBSERVATION_GLES 21 ifeq ($(IMPORTGL), 0) 22 LDFLAGS = -lm -lGLESv2 -lEGL 23 TARGET = $(TARGET_ES_S) 24 FLAGS += -D DISABLE_IMPORTGL 25 else 26 LDFLAGS = -lm -ldl 27 TARGET = $(TARGET_ES) 28 endif 29 SRCS = demo.c app-linux.c importgl.c matrixop.c shader.c 30 else 31 $(error GRAPHICS_BACKEND has to be either OPENGL or OPENGLES) 32 endif 33 34 ifdef PKG_CONFIG 35 FLAGS += $(shell $(PKG_CONFIG) --cflags waffle-1) 36 LDFLAGS += $(shell $(PKG_CONFIG) --libs waffle-1) 37 endif 38 39 all: $(TARGET) 40 41 $(TARGET): $(SRCS) 42 $(CC) $(FLAGS) -o $@ $^ $(LDFLAGS) $(OPTIONS) 43 44 clean: 45 $(RM) $(TARGET_GL) 46 $(RM) $(TARGET_ES) 47 $(RM) $(TARGET_ES_S) 48