var app_name = compiler.mainmodule.name
# create compile_dir
- var dir = pnacl_project_root
- if not dir.file_exists then dir.mkdir
-
- dir = compile_dir
+ var dir = compile_dir
if not dir.file_exists then dir.mkdir
# compile normal C files
GETOS := python $(NACL_SDK_ROOT)/tools/getos.py
OSHELPERS = python $(NACL_SDK_ROOT)/tools/oshelpers.py
OSNAME := $(shell $(GETOS))
-RM := $(OSHELPERS) rm
PNACL_TC_PATH := $(abspath $(NACL_SDK_ROOT)/toolchain/$(OSNAME)_pnacl)
PNACL_CXX := $(PNACL_TC_PATH)/bin/pnacl-clang
CYGWIN ?= nodosfilewarning
export CYGWIN
-
# Declare the ALL target first, to make the 'all' target the default build
all: ../../{{{outname}}}/{{{app_name}}}.pexe
-clean:
- $(RM) {{{app_name}}}.pexe
-
{{{app_name}}}.pexe: src/{{{cfiles.join(" src/")}}}
$(PNACL_CXX) -o $@ $^ -g -O0 $(CXXFLAGS) $(LDFLAGS) # For Debug
# $(PNACL_CXX) -o $@ $^ -O3 $(CXXFLAGS) $(LDFLAGS) # For Release
../../{{{outname}}}/{{{app_name}}}.pexe: {{{app_name}}}.pexe
$(PNACL_FINALIZE) -o $@ $<
-
-#
-# Makefile target to run the SDK's simple HTTP server and serve this example.
-#
-HTTPD_PY := python $(NACL_SDK_ROOT)/tools/httpd.py
-
-.PHONY: serve
-serve: all
- $(HTTPD_PY) -C $(CURDIR)
""".write_to_file(file)
### generate the minimal index.html
if not outname.file_exists then outname.mkdir
file = "{outname}/index.html"
- if not file.file_exists then
- """
+
+ if not file.file_exists then """
<!DOCTYPE html>
<html>
<!--
</body>
</html>
""".write_to_file(file)
- end
### generate pnacl_js.js in a folder named 'js'
dir = "{outname}/js/"
if not dir.file_exists then dir.mkdir
file = "{dir}/pnacl_js.js"
- if not file.file_exists then
- """
+ if not file.file_exists then """
// This file was generated by Nit, any modification will be lost.
{{{app_name}}}Module = null; // Global application object.
}
}
""".write_to_file(file)
- end
### generate the manifest file : app_name.nmf
# used to point the HTML to the Native Client module