Skip to content

Commit

Permalink
Disable x32 when os_type = Darwin
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <Kakadu@pm.me>
  • Loading branch information
Kakadu committed Sep 5, 2024
1 parent 59273f7 commit b8a6c16
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BUILDDIR = _build
all: build test

build:
dune b src runtime runtime32 stdlib
dune b src runtime runtime32 stdlib tutorial

install: all
dune b @install --profile=release
Expand Down
2 changes: 2 additions & 0 deletions runtime32/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(rule
(target runtime.a)
(enabled_if
(<> %{os_type} "Darwin"))
(mode
(promote (until-clean)))
(deps Makefile gc_runtime.s runtime.c runtime.h)
Expand Down
5 changes: 2 additions & 3 deletions stdlib/x32/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(rule
(enabled_if
(<> %{os_type} "Darwin"))
(deps
../Makefile
../../runtime32/Std.i
Expand Down Expand Up @@ -51,9 +53,6 @@
(setenv
SRCDIR
".."
; (setenv
; FILES
; "List.lama Buffer.lama Collection.lama Data.lama Fun.lama"
(setenv
LAMA
"../../runtime32"
Expand Down
7 changes: 1 addition & 6 deletions stdlib/x64/dune
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,10 @@
(setenv
SRCDIR
".."
; (setenv
; FILES
; "List.lama Buffer.lama Collection.lama Data.lama Fun.lama"
(setenv
LAMA
"../../runtime"
(setenv
LAMAC
"../../src/Driver.exe -march=amd64 -I ../runtime32"
"../../src/Driver.exe -march=amd64 -I ../runtime"
(run make -j2 -f ../Makefile all)))))))

;)
10 changes: 10 additions & 0 deletions tutorial/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

(rule
(targets Expressions.x32.exe)
(enabled_if (<> %{os_type} "Darwin"))
(deps (:lama Expressions.lama) ../runtime32/runtime.a ../stdlib/x32/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -21,6 +22,7 @@

(rule
(targets Expressions.x64.exe)

(deps (:lama Expressions.lama) ../runtime/runtime.a ../stdlib/x64/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -41,6 +43,7 @@

(rule
(targets Functions.x32.exe)
(enabled_if (<> %{os_type} "Darwin"))
(deps (:lama Functions.lama) ../runtime32/runtime.a ../stdlib/x32/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -61,6 +64,7 @@

(rule
(targets Functions.x64.exe)

(deps (:lama Functions.lama) ../runtime/runtime.a ../stdlib/x64/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -81,6 +85,7 @@

(rule
(targets Hello.x32.exe)
(enabled_if (<> %{os_type} "Darwin"))
(deps (:lama Hello.lama) ../runtime32/runtime.a ../stdlib/x32/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -101,6 +106,7 @@

(rule
(targets Hello.x64.exe)

(deps (:lama Hello.lama) ../runtime/runtime.a ../stdlib/x64/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -121,6 +127,7 @@

(rule
(targets PatternMatching.x32.exe)
(enabled_if (<> %{os_type} "Darwin"))
(deps (:lama PatternMatching.lama) ../runtime32/runtime.a ../stdlib/x32/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -141,6 +148,7 @@

(rule
(targets PatternMatching.x64.exe)

(deps (:lama PatternMatching.lama) ../runtime/runtime.a ../stdlib/x64/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -161,6 +169,7 @@

(rule
(targets Values.x32.exe)
(enabled_if (<> %{os_type} "Darwin"))
(deps (:lama Values.lama) ../runtime32/runtime.a ../stdlib/x32/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -181,6 +190,7 @@

(rule
(targets Values.x64.exe)

(deps (:lama Values.lama) ../runtime/runtime.a ../stdlib/x64/Fun.i)
(mode
(promote (until-clean)))
Expand Down
3 changes: 3 additions & 0 deletions tutorial/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let demos = ["Expressions"; "Functions"; "Hello"; "PatternMatching"; "Values"]
let template = {|
(rule
(targets %DEMO%.exe)
%COND%
(deps (:lama %DEMOSRC%.lama) %RUNTIME%/runtime.a %STDLIB%/Fun.i)
(mode
(promote (until-clean)))
Expand All @@ -30,13 +31,15 @@ let () =
template
|> Str.global_replace (Str.regexp "%DEMO%") (demo^".x32")
|> Str.global_replace (Str.regexp "%DEMOSRC%") demo
|> Str.global_replace (Str.regexp "%COND%") {|(enabled_if (<> %{os_type} "Darwin"))|}
|> Str.global_replace (Str.regexp "%RUNTIME%") "../runtime32"
|> Str.global_replace (Str.regexp "%STDLIB%") "../stdlib/x32"
|> Str.global_replace (Str.regexp "%EXTRASWITCHES%") "-march=x86"
|> output_string ch;
template
|> Str.global_replace (Str.regexp "%DEMO%") (demo^".x64")
|> Str.global_replace (Str.regexp "%DEMOSRC%") demo
|> Str.global_replace (Str.regexp "%COND%") ""
|> Str.global_replace (Str.regexp "%RUNTIME%") "../runtime"
|> Str.global_replace (Str.regexp "%STDLIB%") "../stdlib/x64"
|> Str.global_replace (Str.regexp "%EXTRASWITCHES%") "-march=x86_64"
Expand Down

0 comments on commit b8a6c16

Please sign in to comment.