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

Side by Side Diff: native_client_sdk/src/examples/gamepad/Makefile

Issue 10541180: Cleanup build system (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
OLDNEW
(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 # 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 # the rest of the makefile is boilerplate for defining build rules.
17 #
18 PROJECT:=gamepad
19 LDFLAGS:=-lppapi_cpp -lppapi
20 CXX_SOURCES:=$(PROJECT).cc gamepad_module.cc
21
22
23 #
24 # Get pepper directory for toolchain and includes.
25 #
26 # If PEPPER_ROOT is not set, then assume it can be found a two directories up,
27 # from the default example directory location.
28 #
29 THIS_MAKEFILE:=$(abspath $(lastword $(MAKEFILE_LIST)))
30 NACL_SDK_ROOT?=$(abspath $(dir $(THIS_MAKEFILE))../..)
31
32 # Project Build flags
33 WARNINGS:=-Wno-long-long -Wall -Wswitch-enum -pedantic -Werror
34 CXXFLAGS:=-pthread -std=gnu++98 $(WARNINGS)
35
36 #
37 # Compute tool paths
38 #
39 #
40 OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py)
41 TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_x86_newlib)
42 CXX:=$(TC_PATH)/bin/i686-nacl-g++
43
44 #
45 # Disable DOS PATH warning when using Cygwin based tools Windows
46 #
47 CYGWIN ?= nodosfilewarning
48 export CYGWIN
49
50
51 # Declare the ALL target first, to make the 'all' target the default build
52 all: $(PROJECT)_x86_32.nexe $(PROJECT)_x86_64.nexe
53
54 # Define 32 bit compile and link rules for main application
55 x86_32_OBJS:=$(patsubst %.cc,%_32.o,$(CXX_SOURCES))
56 $(x86_32_OBJS) : %_32.o : %.cc $(THIS_MAKE)
57 $(CXX) -o $@ -c $< -m32 -O0 -g $(CXXFLAGS)
58
59 $(PROJECT)_x86_32.nexe : $(x86_32_OBJS)
60 $(CXX) -o $@ $^ -m32 -O0 -g $(CXXFLAGS) $(LDFLAGS)
61
62 # Define 32 bit compile and link rules for loadable library
63 eightball_x86_32.o: eightball.cc $(THIS_MAKE) | DBG
64 $(CXX) -o $@ -c $< -m32 -O0 -g $(CXXFLAGS) -fPIC
65
66 lib32/libeightball.so: eightball_x86_32.o $(THIS_MAKE) | lib32
67 $(CXX) -o $@ $< -m32 $(CXXFLAGS) $(LDFLAGS) -shared
68
69 # Define 64 bit compile and link rules for C++ sources
70 x86_64_OBJS:=$(patsubst %.cc,%_64.o,$(CXX_SOURCES))
71 $(x86_64_OBJS) : %_64.o : %.cc $(THIS_MAKE)
72 $(CXX) -o $@ -c $< -m64 -O0 -g $(CXXFLAGS)
73
74 $(PROJECT)_x86_64.nexe : $(x86_64_OBJS)
75 $(CXX) -o $@ $^ -m64 -O0 -g $(CXXFLAGS) $(LDFLAGS)
76
77 # Define 64 bit compile and link rules for loadable library
78 eightball_x86_64.o: eightball.cc $(THIS_MAKE) | DBG
79 $(CXX) -o $@ -c $< -m64 -O0 -g $(CXXFLAGS) -fPIC
80
81 lib64/libeightball.so: eightball_x86_64.o $(THIS_MAKE) | lib64
82 $(CXX) -o $@ $< -m64 $(CXXFLAGS) $(LDFLAGS) -shared
83
84 # Define a phony rule so it always runs, to build nexe and start up server.
85 .PHONY: RUN
86 RUN: all
87 python ../httpd.py
88
89
90
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698