Introduced properties

Redefined properties

redef type SELF: EnscriptenToolchain

nitc $ EnscriptenToolchain :: SELF

Type of this instance, automatically specialized in every class
redef fun default_outname: String

nitc $ EnscriptenToolchain :: default_outname

Get the default name of the executable to produce
redef fun makefile_name: String

nitc $ EnscriptenToolchain :: makefile_name

Get the name of the Makefile to use
redef fun write_makefile(compile_dir: String, cfiles: Array[String])

nitc $ EnscriptenToolchain :: write_makefile

Write the Makefile

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _compiler: AbstractCompiler

nitc :: Toolchain :: _compiler

Compiler of the target program
private var _toolcontext: ToolContext

nitc :: Toolchain :: _toolcontext

Toolcontext
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun compile_c_code(compile_dir: String)

nitc :: MakefileToolchain :: compile_c_code

The C code is generated, compile it to an executable
fun compile_dir: String

nitc :: Toolchain :: compile_dir

Directory where to generate all C files
fun compiler: AbstractCompiler

nitc :: Toolchain :: compiler

Compiler of the target program
protected fun compiler=(compiler: AbstractCompiler)

nitc :: Toolchain :: compiler=

Compiler of the target program
fun default_outname: String

nitc :: MakefileToolchain :: default_outname

Get the default name of the executable to produce
init defaultinit(toolcontext: ToolContext, compiler: AbstractCompiler)

nitc :: Toolchain :: defaultinit

fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun makefile_name: String

nitc :: MakefileToolchain :: makefile_name

Get the name of the Makefile to use
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun outfile(mainmodule: MModule): String

nitc :: MakefileToolchain :: outfile

Combine options and platform informations to get the final path of the outfile
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun root_compile_dir: String

nitc :: Toolchain :: root_compile_dir

Directory where to generate all files
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
protected fun toolcontext=(toolcontext: ToolContext)

nitc :: Toolchain :: toolcontext=

Toolcontext
abstract fun write_and_make

nitc :: Toolchain :: write_and_make

Write all C files and compile them
fun write_files(compile_dir: String, cfiles: Array[String])

nitc :: MakefileToolchain :: write_files

Write all source files to the compile_dir
fun write_makefile(compile_dir: String, cfiles: Array[String])

nitc :: MakefileToolchain :: write_makefile

Write the Makefile
package_diagram nitc::EnscriptenToolchain EnscriptenToolchain nitc::MakefileToolchain MakefileToolchain nitc::EnscriptenToolchain->nitc::MakefileToolchain nitc::Toolchain Toolchain nitc::MakefileToolchain->nitc::Toolchain ...nitc::Toolchain ... ...nitc::Toolchain->nitc::Toolchain

Ancestors

interface Object

core :: Object

The root of the class hierarchy.
class Toolchain

nitc :: Toolchain

Build toolchain for a specific target program, varies per Platform

Parents

class MakefileToolchain

nitc :: MakefileToolchain

Default toolchain using a Makefile

Class definitions

nitc $ EnscriptenToolchain
class EnscriptenToolchain
	super MakefileToolchain

	redef fun makefile_name do return "{super}.js.mk"

	redef fun default_outname do return "{super}.js"

	redef fun write_makefile(compile_dir, cfiles)
	do
		super

		var emcc_make_flags = "CC=emcc CXX=em++ CFLAGS='-Wno-unused-value -Wno-switch -Qunused-arguments -s ALLOW_MEMORY_GROWTH=1"

		var release = toolcontext.opt_release.value
		if release then
			emcc_make_flags += "' LDFLAGS='--minify 1'"
		else emcc_make_flags += " -g'"

		var make_flags = self.toolcontext.opt_make_flags.value or else ""
		make_flags += emcc_make_flags
		self.toolcontext.opt_make_flags.value = make_flags
	end
end
src/platform/emscripten.nit:41,1--63,3