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

Side by Side Diff: examples/srpc/duality/nacl_build.mk

Issue 2856050: Adding srpc example to naclports. (Closed) Base URL: http://naclports.googlecode.com/svn/trunk/src/
Patch Set: '' Created 10 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « examples/srpc/duality/loader.cc ('k') | examples/srpc/duality/npp_gate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2010, The Native Client SDK Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can
3 # be found in the LICENSE file.
4
5 # Common makefile for the examples. This has some basic variables, such as
6 # CC (the compiler) and some suffix rules such as .c.o.
7 #
8 # The main purpose of this makefile component is to demonstrate building a
9 # Native Client module (.nexe)
10
11 .SUFFIXES:
12 .SUFFIXES: .c .cc .cpp .o
13
14 .PHONY: check_variables
15
16 ifeq ($(origin OS), undefined)
17 ifeq ($(shell uname -s), Darwin)
18 OS=Darwin
19 else
20 OS=$(shell uname -o)
21 endif
22 endif
23
24 ifeq ($(OS), $(filter $(OS), Windows_NT Cygwin))
25 PLATFORM = win
26 TARGET = x86
27 endif
28 ifeq ($(OS), $(filter $(OS), Darwin MACOS))
29 PLATFORM = mac
30 TARGET = x86
31 endif
32
33 # Look for 'Linux' in the $(OS) string. $(OS) is assumed to be a Linux
34 # variant if the result of $(findstring) is not empty.
35 ifneq (, $(findstring Linux, $(OS)))
36 PLATFORM = linux
37 TARGET = x86
38 endif
39
40 NACL_SDK_ROOT ?= .
41
42 NACL_TOOLCHAIN_DIR = toolchain/$(PLATFORM)_$(TARGET)
43
44 CC = $(NACL_SDK_ROOT)/$(NACL_TOOLCHAIN_DIR)/bin/nacl-gcc
45 CPP = $(NACL_SDK_ROOT)/$(NACL_TOOLCHAIN_DIR)/bin/nacl-g++
46
47 %_x86_32.o: %.c
48 $(CC) $(CFLAGS) -m32 $(INCLUDES) $(OPT_FLAGS) -c -o $@ $<
49
50 %_x86_32.o: %.cc
51 $(CPP) $(CFLAGS) -m32 $(INCLUDES) $(OPT_FLAGS) -c -o $@ $<
52
53 %_x86_32.o: %.cpp
54 $(CPP) $(CFLAGS) -m32 $(INCLUDES) $(OPT_FLAGS) -c -o $@ $<
55
56 %_x86_64.o: %.c
57 $(CC) $(CFLAGS) -m64 $(INCLUDES) $(OPT_FLAGS) -c -o $@ $<
58
59 %_x86_64.o: %.cc
60 $(CPP) $(CFLAGS) -m64 $(INCLUDES) $(OPT_FLAGS) -c -o $@ $<
61
62 %_x86_64.o: %.cpp
63 $(CPP) $(CFLAGS) -m64 $(INCLUDES) $(OPT_FLAGS) -c -o $@ $<
64
65 # Make sure certain variables are defined. This rule is set as a dependency
66 # for all the .nexe builds in the examples.
67 check_variables:
68 ifeq ($(origin OS), undefined)
69 @echo "Error: OS is undefined" ; exit 42
70 endif
71 ifeq ($(origin PLATFORM), undefined)
72 @echo "Error: PLATFORM is undefined (OS = $(OS))" ; exit 42
73 endif
74 ifeq ($(origin TARGET), undefined)
75 @echo "Error: TARGET is undefined (OS = $(OS))" ; exit 42
76 endif
77 ifeq ($(origin NACL_SDK_ROOT), undefined)
78 @echo "Error: NACL_SDK_ROOT is undefined" ; exit 42
79 endif
OLDNEW
« no previous file with comments | « examples/srpc/duality/loader.cc ('k') | examples/srpc/duality/npp_gate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698