aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFyodor Shchukin <fs@hello.io>2019-01-30 17:31:53 +0300
committerFyodor Shchukin <fs@hello.io>2019-01-30 17:31:53 +0300
commita7551e9b4ee3e4ca628311037c6c9f728c5573f3 (patch)
tree7ea62f52c8de8474a95a9d413761c224249bd34b
parentAdd math headers for emscripten (diff)
Cooking on windows
-rw-r--r--build_win.bat2
-rw-r--r--tools/cook.janet8
2 files changed, 6 insertions, 4 deletions
diff --git a/build_win.bat b/build_win.bat
index 225197bc..4595ee24 100644
--- a/build_win.bat
+++ b/build_win.bat
@@ -101,6 +101,8 @@ copy README.md dist\README.md
copy janet.lib dist\janet.lib
copy janet.exp dist\janet.exp
copy src\include\janet\janet.h dist\janet.h
+copy tools\cook.janet dist\cook.janet
+copy tools\highlight.janet dist\highlight.janet
exit /b 0
:TESTFAIL
diff --git a/tools/cook.janet b/tools/cook.janet
index 61653b4b..87e28fcd 100644
--- a/tools/cook.janet
+++ b/tools/cook.janet
@@ -79,14 +79,14 @@
(defn- make-define
"Generate strings for adding custom defines to the compiler."
[define value]
- (def prefix (if is-win "\\D" "-D"))
+ (def prefix (if is-win "/D" "-D"))
(if value
(string prefix define "=" value)
(string prefix define)))
(defn- make-defines
"Generate many defines. Takes a dictionary of defines. If a value is
- true, generates -DNAME (\\DNAME on windows), otherwise -DNAME=value."
+ true, generates -DNAME (/DNAME on windows), otherwise -DNAME=value."
[defines]
(seq [[d v] :pairs defines] (make-define d (if (not= v true) v))))
@@ -94,7 +94,7 @@
(def OPTIMIZE 2)
(def CC (if is-win "cl" "cc"))
(def LD (if is-win "link" (string CC " -shared")))
-(def CFLAGS (string (if is-win "/0" "-std=c99 -Wall -Wextra -fpic -O") OPTIMIZE))
+(def CFLAGS (string (if is-win "/O" "-std=c99 -Wall -Wextra -fpic -O") OPTIMIZE))
(defn- compile-c
"Compile a C file into an object file."
@@ -115,7 +115,7 @@
(def olist (string/join objects " "))
(if (older-than-some target objects)
(if is-win
- (shell ld "/out:" target " " olist)
+ (shell ld " /DLL /OUT:" target " " olist " %JANET_PATH%\\janet.lib")
(shell ld " " cflags " -o " target " " olist))))
(defn- create-buffer-c