WIP on more dune

Signed-off-by: Kakadu <Kakadu@pm.me>
This commit is contained in:
Kakadu 2024-08-30 00:35:31 +03:00
parent 6761c1d0ef
commit 092d5f2f33
12 changed files with 174 additions and 66 deletions

View file

@ -1,10 +1,12 @@
SHELL := /bin/bash
.PHONY: all
SHELL := /bin/bash
FILES=$(wildcard *.lama)
ALL=$(sort $(FILES:.lama=.o))
LAMAC=../src/lamac
LAMAC ?= ../src/lamac
BDIR ?= .
all: $(ALL)
all: $(addprefix $(BDIR)/,$(ALL))
Fun.o: Ref.o
@ -12,18 +14,18 @@ Data.o: Ref.o Collection.o
Collection.o: List.o Ref.o
Array.o: List.o
$(BDIR)/Array.o: $(BDIR)/List.o
Ostap.o: List.o Collection.o Ref.o Fun.o Matcher.o
Buffer.o: List.o
$(BDIR)/Buffer.o: $(BDIR)/List.o
STM.o: List.o Fun.o
$(BDIR)/STM.o: $(BDIR)/List.o $(BDIR)/Fun.o
%.o: %.lama
LAMA=../runtime $(LAMAC) -g -I . -c $<
$(BDIR)/%.o: %.lama
LAMA=../runtime $(LAMAC) -g -I . -c $< -o $@
clean:
rm -Rf *.s *.o *.i *~
$(RM) -r *.s *.o *.i *~
pushd regression && make clean && popd

15
stdlib/amd64/dune Normal file
View file

@ -0,0 +1,15 @@
(rule
(deps ../List.lama ../Makefile ../../runtime/Std.i)
(targets List.i List.o)
(action
(progn
(setenv
BDIR
"amd64"
(setenv
LAMA
"../runtime"
(setenv
LAMAC
"../src/Driver.exe -I ../runtime"
(run make -C .. all)))))))

38
stdlib/x32/dune Normal file
View file

@ -0,0 +1,38 @@
(rule
(targets List.o List.i)
(deps
(:lama ../List.lama)
%{project_root}/runtime32/runtime32.a
%{project_root}/runtime32/Std.i)
(action
(setenv
LAMA
"../../runtime32"
(run
%{project_root}/src/Driver.exe
-march=x86
-I
%{project_root}/runtime32
-c
%{lama}))))
(rule
(targets Array.o Array.i)
(deps
(:lama ../Array.lama)
%{project_root}/runtime32/Std.i
List.i
List.o)
(action
(setenv
LAMA
"../../runtime32"
(run
%{project_root}/src/Driver.exe
-march=x86
-I
.
-I
%{project_root}/runtime32
-c
%{lama}))))