Advertisement
fusion44

Untitled

Mar 13th, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 2.37 KB | None | 0 0
  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. # Project Build flags
  22. #
  23. # Turns on warnings (-Wxxx), builds with zero optimization (-O0) and adds debug
  24. # information (-g) for correctness and ease of debugging.
  25. WARNINGS:=-Wno-long-long -Wall
  26. CFLAGS:=-pthread -O0 -g $(WARNINGS)
  27.  
  28.  
  29. #
  30. # Compute path to compiler
  31. #
  32. OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py)
  33. TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_x86_glibc)
  34.  
  35.  
  36. # Alias for C++ compiler
  37. CC:=$(TC_PATH)/bin/i686-nacl-gcc
  38.  
  39.  
  40. #
  41. # Disable DOS PATH warning when using Cygwin based tools Windows
  42. #
  43. CYGWIN ?= nodosfilewarning
  44. export CYGWIN
  45.  
  46.  
  47. # Default target is everything
  48. all : nacl_sdk_test_x86_32.nexe nacl_sdk_test_x86_64.nexe nacl_sdk_test.nmf
  49.  
  50. # Define compile and link rule for 32 bit (-m32) nexe
  51. hello_world_x86_32.nexe : nacl_multi.cpp nacl_test.cpp $(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 : nacl_multi.cpp nacl_test.cpp $(THIS_MAKE)
  56.     $(CC) -o $@ $< -m64 -O0 -g $(CFLAGS) -lppapi
  57.  
  58. #
  59. # NMF Manifiest generation
  60. #
  61. # Use the python script create_nmf to scan the binaries for dependencies using
  62. # objdump.  Pass in the (-L) paths to the default library toolchains so that we
  63. # can find those libraries and have it automatically copy the files (-s) to
  64. # the target directory for us.
  65. NMF:=python $(NACL_SDK_ROOT)/tools/create_nmf.py
  66. NMF_ARGS:=-D $(TC_PATH)/x86_64-nacl/bin/objdump
  67. NMF_PATHS:=-L $(TC_PATH)/x86_64-nacl/lib32 -L $(TC_PATH)/x86_64-nacl/lib
  68.  
  69. hello_world.nmf : nacl_sdk_test_x86_64.nexe nacl_sdk_test_x86_32.nexe
  70.     echo $(NMF) $(NMF_ARGS) -s . -o $@ $(NMF_PATHS) $^
  71.     $(NMF) $(NMF_ARGS) -s . -o $@ $(NMF_PATHS) $^
  72.  
  73. # Define a phony rule so it always runs, to build nexe and start up server.
  74. .PHONY: RUN
  75. RUN: all
  76.     python ../httpd.py
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement