1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# Copyright (c) 2013 The Chromium Authors. All rights reserved. 2cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# Use of this source code is governed by a BSD-style license that can be 3cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# found in the LICENSE file. 4cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# GNU Makefile based on shared rules provided by the Native Client SDK. 6cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# See README.Makefiles for more details. 7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)VALID_TOOLCHAINS := pnacl 9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 10cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../../..) 11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)include $(NACL_SDK_ROOT)/tools/common.mk 12cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)TARGET = NaClAMBullet 14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)LIBS = BulletDynamics BulletCollision LinearMath ppapi pthread 15cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)USR_INCLUDE=$(NACL_SDK_ROOT)/toolchain/$(OSNAME)_pnacl/usr/local/include 17cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)BULLET_INCLUDE=$(USR_INCLUDE)/bullet 18cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 19cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)CFLAGS = -I$(CURDIR) -I$(BULLET_INCLUDE) 20cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)CFLAGS += -Wall -Wno-overloaded-virtual -Wno-unused-variable 21cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)SOURCES = \ 22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) NaClAMBase/NaClAMBase.cpp \ 23cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) NaClAMBase/NaClAMMessageCollector.cpp \ 24cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) NaClAMBase/jsoncpp.cpp \ 25cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) NaClAMBullet/NaClAMBullet.cpp 26cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 27cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# Build rules generated by macros from common.mk: 28cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 29cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS)))) 30cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 31cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# The PNaCl workflow uses both an unstripped and finalized/stripped binary. 32cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)# On NaCl, only produce a stripped binary for Release configs (not Debug). 33cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) 34cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS))) 35cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped)) 36else 37$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS))) 38endif 39 40$(eval $(call NMF_RULE,$(TARGET),)) 41