| 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 CFLAGS:=-pthread -O0 -g $(WARNINGS) |
| 28 |
| 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 CC:=$(TC_PATH)/bin/i686-nacl-gcc |
| 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 compile and link rule for 32 bit (-m32) nexe |
| 51 hello_world_x86_32.nexe : hello_world.c $(THIS_MAKE) |
| 52 $(CC) -o $@ $< -m32 -O0 -g $(CFLAGS) -lppapi |
| 53 |
| 54 # Define compile and link rule for 64 bit (-m64) nexe |
| 55 hello_world_x86_64.nexe : hello_world.c $(THIS_MAKE) |
| 56 $(CC) -o $@ $< -m64 -O0 -g $(CFLAGS) -lppapi |
| 57 |
| 58 # Define a phony rule so it always runs, to build nexe and start up server. |
| 59 .PHONY: RUN |
| 60 RUN: all |
| 61 python ../httpd.py |
| OLD | NEW |