Chromium Code Reviews| Index: native_client_sdk/src/examples/dlopen/Makefile |
| diff --git a/native_client_sdk/src/examples/hello_world/Makefile b/native_client_sdk/src/examples/dlopen/Makefile |
| similarity index 70% |
| copy from native_client_sdk/src/examples/hello_world/Makefile |
| copy to native_client_sdk/src/examples/dlopen/Makefile |
| index 1c20829676e5e2d81f4676b999e2b66282d645e1..26b3a5078eb4705b61e2223039eb9f3fda8dd840 100644 |
| --- a/native_client_sdk/src/examples/hello_world/Makefile |
| +++ b/native_client_sdk/src/examples/dlopen/Makefile |
| @@ -14,9 +14,19 @@ |
| # |
| # By default we will build a Debug configuration using the GCC newlib toolcahin |
|
binji
2013/01/16 22:46:55
nit: default uses glibc, not newlib
noelallen1
2013/01/16 23:21:10
Done.
|
| # to override this, specify TOOLCHAIN=newlib|glibc or CONFIG=Debug|Release on |
| -# the make command-line or in this file prior to including common.mk |
| +# the make command-line or in this file prior to including common.mk. The |
| +# toolchain we use by default will be the first valid one listed |
| +VALID_TOOLCHAINS:=glibc |
| + |
| + |
| +# |
| +# Get pepper directory for toolchain and includes. |
| # |
| -include common.mk |
| +# If NACL_SDK_ROOT is not set, then assume it can be found relative to |
| +# to this Makefile. |
| +# |
| +NACL_SDK_ROOT?=$(abspath $(CURDIR)/../..) |
| +include $(NACL_SDK_ROOT)/tools/common.mk |
| # |
| @@ -25,12 +35,13 @@ include common.mk |
| # The base name of the final NEXE, also the name of the NMF file containing |
| # the mapping between architecture and actual NEXE. |
| # |
| -TARGET=hello_world |
| +TARGET=dlopen |
| # |
| # List of sources to compile |
| # |
| -SOURCES=hello_world.c |
| +DLOPEN_SRCS=dlopen.cc |
| +EIGHTBALL_SRCS=eightball.cc |
| # |
| @@ -47,7 +58,7 @@ SOURCES=hello_world.c |
| # dependencies. |
| # |
| DEPS= |
| -LIBS=$(DEPS) ppapi pthread |
| +LIBS=$(DEPS) dl ppapi_cpp ppapi pthread |
| # |
| @@ -58,12 +69,15 @@ $(foreach dep,$(DEPS),$(eval $(call DEPEND_RULE,$(dep)))) |
| # |
| # Use the compile macro for each source. |
| # |
| -$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src)))) |
| +$(foreach src,$(DLOPEN_SRCS),$(eval $(call COMPILE_RULE,$(src)))) |
| +$(foreach src,$(EIGHTBALL_SRCS),$(eval $(call COMPILE_RULE,$(src),-fPIC))) |
| # |
| # Use the link macro for this target on the list of sources. |
| # |
| -$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS))) |
| +$(eval $(call SO_RULE,libeightball,$(EIGHTBALL_SRCS))) |
| +$(eval $(call LINK_RULE,$(TARGET),$(DLOPEN_SRCS),$(LIBS),$(DEPS))) |
| + |
| # |
| # Specify the NMF to be created with no additional arugments. |