2019-01-24 05:15:58 +00:00
|
|
|
# Creates an amalgamated janet.c and janet.h to
|
|
|
|
# allow for easy embedding
|
|
|
|
|
|
|
|
(def {:year YY :month MM :month-day DD} (os/date))
|
|
|
|
|
2019-01-26 22:17:56 +00:00
|
|
|
(defn dofile
|
|
|
|
"Print one file to stdout"
|
|
|
|
[path]
|
|
|
|
(print (slurp path)))
|
|
|
|
|
2019-01-24 05:15:58 +00:00
|
|
|
# Order is important here, as some headers
|
|
|
|
# depend on other headers.
|
|
|
|
(def headers
|
|
|
|
@["src/core/util.h"
|
|
|
|
"src/core/state.h"
|
|
|
|
"src/core/gc.h"
|
|
|
|
"src/core/vector.h"
|
|
|
|
"src/core/fiber.h"
|
|
|
|
"src/core/regalloc.h"
|
|
|
|
"src/core/compile.h"
|
|
|
|
"src/core/emit.h"
|
|
|
|
"src/core/symcache.h"])
|
|
|
|
|
|
|
|
(def sources
|
|
|
|
@["src/core/abstract.c"
|
|
|
|
"src/core/array.c"
|
|
|
|
"src/core/asm.c"
|
|
|
|
"src/core/buffer.c"
|
|
|
|
"src/core/bytecode.c"
|
|
|
|
"src/core/capi.c"
|
|
|
|
"src/core/cfuns.c"
|
|
|
|
"src/core/compile.c"
|
|
|
|
"src/core/corelib.c"
|
|
|
|
"src/core/debug.c"
|
|
|
|
"src/core/emit.c"
|
|
|
|
"src/core/fiber.c"
|
|
|
|
"src/core/gc.c"
|
|
|
|
"src/core/io.c"
|
|
|
|
"src/core/marsh.c"
|
|
|
|
"src/core/math.c"
|
|
|
|
"src/core/os.c"
|
|
|
|
"src/core/parse.c"
|
|
|
|
"src/core/peg.c"
|
|
|
|
"src/core/pp.c"
|
|
|
|
"src/core/regalloc.c"
|
|
|
|
"src/core/run.c"
|
|
|
|
"src/core/specials.c"
|
|
|
|
"src/core/string.c"
|
|
|
|
"src/core/strtod.c"
|
|
|
|
"src/core/struct.c"
|
|
|
|
"src/core/symcache.c"
|
|
|
|
"src/core/table.c"
|
|
|
|
"src/core/tuple.c"
|
|
|
|
"src/core/util.c"
|
|
|
|
"src/core/value.c"
|
|
|
|
"src/core/vector.c"
|
|
|
|
"src/core/vm.c"
|
|
|
|
"src/core/wrap.c"])
|
|
|
|
|
|
|
|
(print "/* Amalgamated build - DO NOT EDIT */")
|
|
|
|
(print "/* Generated " YY "-" (inc MM) "-" (inc DD)
|
|
|
|
" with janet version " janet/version "-" janet/build " */")
|
2019-01-24 05:26:57 +00:00
|
|
|
|
|
|
|
# Assume the version of janet used to run this script is the same
|
|
|
|
# as the version being generated
|
|
|
|
(print "#define JANET_BUILD \"" janet/build "\"")
|
|
|
|
|
2019-02-01 03:38:59 +00:00
|
|
|
(print ```#define JANET_AMALG```)
|
|
|
|
(print ```#include "janet.h"```)
|
2019-01-24 05:15:58 +00:00
|
|
|
|
2019-01-26 22:17:56 +00:00
|
|
|
(each h headers (dofile h))
|
|
|
|
(each s sources (dofile s))
|
2019-01-24 05:15:58 +00:00
|
|
|
|
|
|
|
# Relies on this file being built
|
2019-01-26 22:17:56 +00:00
|
|
|
(dofile "build/core.gen.c")
|