OLD | NEW |
| (Empty) |
1 # Copyright (c) 2012 The Native Client 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. | |
4 | |
5 # | |
6 # GNU Make based build file. For details on GNU Make see: | |
7 # http://www.gnu.org/software/make/manual/make.html | |
8 # | |
9 | |
10 | |
11 # | |
12 # Get pepper directory for toolchain and includes. | |
13 # | |
14 # If NACL_SDK_ROOT is not set, then assume it can be found a two directories up, | |
15 # from the default example directory location. | |
16 # | |
17 THIS_MAKEFILE:=$(abspath $(lastword $(MAKEFILE_LIST))) | |
18 NACL_SDK_ROOT?=$(abspath $(dir $(THIS_MAKEFILE))../..) | |
19 | |
20 | |
21 # | |
22 # Project Build flags | |
23 # | |
24 # Turns on warnings (-Wxxx), builds with zero optimization (-O0) and adds debug | |
25 # information (-g) for correctness and ease of debugging. | |
26 WARNINGS:=-Wno-long-long -Wall -Wswitch-enum -Werror -pedantic | |
27 CXXFLAGS:=-pthread -O0 $(WARNINGS) | |
28 LDFLAGS:=-lppapi_cpp -lppapi | |
29 | |
30 # | |
31 # Compute path to compiler | |
32 # | |
33 OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py) | |
34 TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_x86_newlib) | |
35 | |
36 | |
37 # Alias for C compiler | |
38 CXX:=$(TC_PATH)/bin/i686-nacl-g++ | |
39 | |
40 | |
41 # | |
42 # Disable DOS PATH warning when using Cygwin based tools Windows | |
43 # | |
44 CYGWIN ?= nodosfilewarning | |
45 export CYGWIN | |
46 | |
47 # Default target is everything | |
48 all : hello_world_x86_32.nexe hello_world_x86_64.nexe | |
49 | |
50 # Define 32 bit compile rule for C++ sources | |
51 hello_world_32.o helper_functions_32.o : %_32.o : %.cc | |
52 $(CXX) -o $@ -c $< -m32 -O0 -g $(CXXFLAGS) | |
53 | |
54 # Define 64 bit compile rule for C++ sources | |
55 hello_world_64.o helper_functions_64.o : %_64.o : %.cc | |
56 $(CXX) -o $@ -c $< -m64 -O0 -g $(CXXFLAGS) | |
57 | |
58 # Define link rule for 32 bit (-m32) nexe | |
59 hello_world_x86_32.nexe : hello_world_32.o helper_functions_32.o | |
60 $(CXX) -o $@ $^ -m32 -O0 -g $(LDFLAGS) | |
61 | |
62 # Define link rule for 64 bit (-m64) nexe | |
63 hello_world_x86_64.nexe : hello_world_64.o helper_functions_64.o | |
64 $(CXX) -o $@ $^ -m64 -O0 -g $(LDFLAGS) | |
65 | |
66 # Define a phony rule so it always runs, to build nexe and start up server. | |
67 .PHONY: RUN | |
68 RUN: all | |
69 python ../httpd.py | |
70 | |
OLD | NEW |