1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-05 04:18:03 +00:00

On install, merge janetconf.h into janet.h

This results in a cleaner amalgmated build
This commit is contained in:
Calvin Rose
2020-11-17 09:48:31 -06:00
parent 306bdee673
commit 2dc04d2957
8 changed files with 32 additions and 19 deletions

12
tools/patch-header.janet Normal file
View File

@@ -0,0 +1,12 @@
# Patch janet.h
(def [_ janeth janetconf output] (dyn :args))
(def- replace-peg
(peg/compile
~(% (* '(to `#include "janetconf.h"`)
(constant ,(slurp janetconf))
(thru `#include "janetconf.h"`)
'(any 1)))))
(spit output (first (peg/match replace-peg (slurp janeth))))