| # Copyright 2014 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # GNU Makefile based on shared rules provided by the Native Client SDK. |
| # See README.Makefiles for more details. |
| |
| # In order to build with newlib by default change "pnacl newlib" to |
| # "newlib pnacl" or use make VAILD_TOOLCHAINS=newlib. |
| VALID_TOOLCHAINS := pnacl newlib |
| |
| TOP_SRCDIR = $(CURDIR)/.. |
| include $(TOP_SRCDIR)/third-party/settings.mk |
| |
| include $(NACL_SDK_ROOT)/tools/common.mk |
| |
| TARGET = module |
| LIBS = ppapi_cpp ppapi pthread archive z iconv crypto |
| |
| CFLAGS = -Wall |
| SOURCES = \ |
| cpp/compressor.cc \ |
| cpp/compressor_archive_libarchive.cc \ |
| cpp/compressor_io_javascript_stream.cc \ |
| cpp/module.cc \ |
| cpp/request.cc \ |
| cpp/volume.cc \ |
| cpp/volume_archive_libarchive.cc \ |
| cpp/volume_reader_javascript_stream.cc |
| |
| # Build rules generated by macros from common.mk: |
| |
| $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS)))) |
| |
| # The PNaCl workflow uses both an unstripped and finalized/stripped binary. |
| # On NaCl, only produce a stripped binary for Release configs (not Debug). |
| ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) |
| $(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS))) |
| $(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped)) |
| else |
| $(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS))) |
| endif |
| |
| $(eval $(call NMF_RULE,$(TARGET),)) |
| |
| # Debug rule for testing. make debug will try to run Chrome with index.html, |
| # but there is no index.html. Every rule that constains "debug" will build and |
| # use the debug executables (see #line 113 from $NACL_SDK_ROOT/tools/common.mk |
| # with findstring). |
| .PHONY: debug |
| debug: all |