10f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# Copyright (c) 2013 The Chromium Authors. All rights reserved. 20f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# Use of this source code is governed by a BSD-style license that can be 30f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# found in the LICENSE file. 40f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 50f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# GNU Makefile based on shared rules provided by the Native Client SDK. 60f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# See README.Makefiles for more details. 70f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 80f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)VALID_TOOLCHAINS := newlib glibc pnacl 90f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 100f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../../..) 110f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)include $(NACL_SDK_ROOT)/tools/common.mk 120f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 130f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)TARGET = cube 140f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)LIBS = $(DEPS) ppapi_gles2 ppapi_cpp ppapi pthread 150f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 16f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)CFLAGS = -Wall -I.. 170f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)SOURCES = \ 180f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) cube.cc \ 190f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) texture.cc \ 200f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) matrix.cc 210f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 220f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)# Build rules generated by macros from common.mk: 230f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 240f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS)))) 250f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 260529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch# The PNaCl workflow uses both an unstripped and finalized/stripped binary. 270529e5d033099cbfc42635f6f6183833b09dff6eBen Murdoch# On NaCl, only produce a stripped binary for Release configs (not Debug). 280529e5d033099cbfc42635f6f6183833b09dff6eBen Murdochifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) 290f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS))) 300f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped)) 310f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)else 320f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS))) 330f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)endif 340f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles) 350f1bc08d4cfcc34181b0b5cbf065c40f687bf740Torne (Richard Coles)$(eval $(call NMF_RULE,$(TARGET),)) 36