1 # Copyright (c) 2013 The Chromium 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.
5 # GNU Makefile based on shared rules provided by the Native Client SDK.
6 # See README.Makefiles for more details.
8 VALID_TOOLCHAINS := pnacl
10 NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../../..)
11 include $(NACL_SDK_ROOT)/tools/common.mk
14 LIBS = BulletDynamics BulletCollision LinearMath ppapi pthread
16 USR_INCLUDE=$(NACL_SDK_ROOT)/toolchain/$(OSNAME)_pnacl/le32-nacl/local/include
17 BULLET_INCLUDE=$(USR_INCLUDE)/bullet
19 CFLAGS = -I$(CURDIR) -I$(BULLET_INCLUDE)
20 CFLAGS += -Wall -Wno-overloaded-virtual -Wno-unused-variable
22 NaClAMBase/NaClAMBase.cpp \
23 NaClAMBase/NaClAMMessageCollector.cpp \
24 NaClAMBase/jsoncpp.cpp \
25 NaClAMBullet/NaClAMBullet.cpp
27 # Build rules generated by macros from common.mk:
29 $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
31 # The PNaCl workflow uses both an unstripped and finalized/stripped binary.
32 # On NaCl, only produce a stripped binary for Release configs (not Debug).
33 ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG))))
34 $(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
35 $(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
37 $(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
40 $(eval $(call NMF_RULE,$(TARGET),))