Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: native_client_sdk/src/examples/hello_world_newlib/Makefile

Issue 9370041: Clean up examples (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/examples/hello_world_newlib/Makefile
===================================================================
--- native_client_sdk/src/examples/hello_world_newlib/Makefile (revision 0)
+++ native_client_sdk/src/examples/hello_world_newlib/Makefile (revision 0)
@@ -0,0 +1,61 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
bradn 2012/02/10 00:56:16 2012
noelallen1 2012/02/10 22:31:45 Done.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+#
+# GNU Make based build file.  For details on GNU Make see:
+#   http://www.gnu.org/software/make/manual/make.html
+#
+
+
+#
+# Get pepper directory for toolchain and includes.
+#
+# If NACL_SDK_ROOT is not set, then assume it can be found a two directories up,
+# from the default example directory location.
+#
+THIS_MAKEFILE:=$(abspath $(lastword $(MAKEFILE_LIST)))
+NACL_SDK_ROOT?=$(abspath $(dir $(THIS_MAKEFILE))../..)
+
+
+#
+# Project Build flags
+#
+# Turns on warnings (-Wxxx), builds with zero optimization (-O0) and adds debug
+# information (-g) for correctness and ease of debugging.
+WARNINGS:=-Wno-long-long -Wall -Wswitch-enum -Werror -pedantic
+CFLAGS:=-pthread -O0 -g $(WARNINGS)
+
+
+#
+# Compute path to compiler
+#
+OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py)
+TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_x86_newlib)
+
+
+# Alias for C compiler
+CC:=$(TC_PATH)/bin/i686-nacl-gcc
+
+
+#
+# Disable DOS PATH warning when using Cygwin based tools Windows
+#
+CYGWIN ?= nodosfilewarning
+export CYGWIN
+
+# Default target is everything
+all : hello_world_x86_32.nexe hello_world_x86_64.nexe
+
+# Define compile and link rule for 32 bit (-m32) nexe
+hello_world_x86_32.nexe : hello_world.c $(THIS_MAKE)
+ $(CC) -o $@ $< -m32 -O0 -g $(CFLAGS) -lppapi
+
+# Define compile and link rule for 64 bit (-m64) nexe
+hello_world_x86_64.nexe : hello_world.c $(THIS_MAKE)
+ $(CC) -o $@ $< -m64 -O0 -g $(CFLAGS) -lppapi
+
+# Define a phony rule so it always runs, to build nexe and start up server.
+.PHONY: RUN
+RUN: all
+ python ../httpd.py
Property changes on: native_client_sdk/src/examples/hello_world_newlib/Makefile
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698