| OLD | NEW |
| (Empty) |
| 1 # Copyright (c) 2011 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 # Project information | |
| 12 # | |
| 13 # These variables store project specific settings for the project name | |
| 14 # build flags, files to copy or install. In the examples it is typically | |
| 15 # only the list of sources and project name that will actually change and | |
| 16 # | |
| 17 PROJECT:=geturl | |
| 18 LDFLAGS:=-lppapi_cpp -lppapi | |
| 19 CXX_SOURCES:=$(PROJECT).cc geturl_handler.cc | |
| 20 | |
| 21 # | |
| 22 # Get pepper directory for toolchain and includes. | |
| 23 # | |
| 24 # If PEPPER_ROOT is not set, then assume it can be found a two directories up, | |
| 25 # from the default example directory location. | |
| 26 # | |
| 27 THIS_MAKEFILE:=$(abspath $(lastword $(MAKEFILE_LIST))) | |
| 28 NACL_SDK_ROOT?=$(abspath $(dir $(THIS_MAKEFILE))../..) | |
| 29 | |
| 30 # Project Build flags | |
| 31 WARNINGS:=-Wno-long-long -Wall -Wswitch-enum -pedantic -Werror | |
| 32 CXXFLAGS:=-pthread -std=gnu++98 $(WARNINGS) | |
| 33 | |
| 34 # | |
| 35 # Compute tool paths | |
| 36 # | |
| 37 # | |
| 38 OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py) | |
| 39 TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_x86_newlib) | |
| 40 CXX:=$(TC_PATH)/bin/i686-nacl-g++ | |
| 41 | |
| 42 # | |
| 43 # Disable DOS PATH warning when using Cygwin based tools Windows | |
| 44 # | |
| 45 CYGWIN ?= nodosfilewarning | |
| 46 export CYGWIN | |
| 47 | |
| 48 | |
| 49 # Declare the ALL target first, to make the 'all' target the default build | |
| 50 all: $(PROJECT)_x86_32.nexe $(PROJECT)_x86_64.nexe | |
| 51 | |
| 52 # Define 32 bit compile and link rules for C++ sources | |
| 53 x86_32_OBJS:=$(patsubst %.cc,%_32.o,$(CXX_SOURCES)) | |
| 54 $(x86_32_OBJS) : %_32.o : %.cc $(THIS_MAKE) | |
| 55 $(CXX) -o $@ -c $< -m32 -O0 -g $(CXXFLAGS) | |
| 56 | |
| 57 $(PROJECT)_x86_32.nexe : $(x86_32_OBJS) | |
| 58 $(CXX) -o $@ $^ -m32 -O0 -g $(CXXFLAGS) $(LDFLAGS) | |
| 59 | |
| 60 # Define 64 bit compile and link rules for C++ sources | |
| 61 x86_64_OBJS:=$(patsubst %.cc,%_64.o,$(CXX_SOURCES)) | |
| 62 $(x86_64_OBJS) : %_64.o : %.cc $(THIS_MAKE) | |
| 63 $(CXX) -o $@ -c $< -m64 -O0 -g $(CXXFLAGS) | |
| 64 | |
| 65 $(PROJECT)_x86_64.nexe : $(x86_64_OBJS) | |
| 66 $(CXX) -o $@ $^ -m64 -O0 -g $(CXXFLAGS) $(LDFLAGS) | |
| 67 | |
| 68 | |
| 69 # Define a phony rule so it always runs, to build nexe and start up server. | |
| 70 .PHONY: RUN | |
| 71 RUN: all | |
| 72 python ../httpd.py | |
| 73 | |
| OLD | NEW |