1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-23 21:56:52 +00:00

Make amalg tool windows friendly

Convert / to \ in file paths for windows.
This commit is contained in:
Calvin Rose 2019-01-26 17:17:56 -05:00
parent 7350bf5dd9
commit 5bf9e4fc89

View File

@ -3,6 +3,14 @@
(def {:year YY :month MM :month-day DD} (os/date))
(defn dofile
"Print one file to stdout"
[path]
(def path (if (= (os/which) :windows)
(string/replace "/" "\\" path)
path))
(print (slurp path)))
# Order is important here, as some headers
# depend on other headers.
(def headers
@ -63,8 +71,8 @@
(print ```#define JANET_AMALG
#include "janet.h"```)
(each h headers (print (slurp h)))
(each s sources (print (slurp s)))
(each h headers (dofile h))
(each s sources (dofile s))
# Relies on this file being built
(print (slurp "build/core.gen.c"))
(dofile "build/core.gen.c")