Stdlib compiles twice

Signed-off-by: Kakadu <Kakadu@pm.me>
This commit is contained in:
Kakadu 2024-08-30 14:35:53 +03:00
parent 092d5f2f33
commit 3a10d4a2a6
3 changed files with 106 additions and 51 deletions

View file

@ -1,29 +1,33 @@
.PHONY: all .PHONY: all
SHELL := /bin/bash SHELL := /bin/bash
FILES=$(wildcard *.lama) SRCDIR ?= .
ALL=$(sort $(FILES:.lama=.o)) FILES ?= $(wildcard $(SRCDIR)/*.lama)
OFILES = $(FILES:$(SRCDIR)/%=%)
OFILES := $(OFILES:.lama=.o)
$(info OFILES = $(OFILES))
ALL := $(sort $(OFILES))
LAMAC ?= ../src/lamac LAMAC ?= ../src/lamac
BDIR ?= . BDIR ?= .
all: $(addprefix $(BDIR)/,$(ALL)) all: $(addprefix $(BDIR)/,$(ALL))
$(info ALL = $(ALL))
$(BDIR)/Fun.o: $(BDIR)/Ref.o
Fun.o: Ref.o $(BDIR)/Data.o: $(BDIR)/Ref.o $(BDIR)/Collection.o
Data.o: Ref.o Collection.o $(BDIR)/Collection.o: $(BDIR)/List.o $(BDIR)/Ref.o
Collection.o: List.o Ref.o
$(BDIR)/Array.o: $(BDIR)/List.o $(BDIR)/Array.o: $(BDIR)/List.o
$(BDIR)/Random.o $(BDIR)/Collection.o: $(BDIR)/Array.o
Ostap.o: List.o Collection.o Ref.o Fun.o Matcher.o $(BDIR)/Ostap.o: $(BDIR)/List.o $(BDIR)/Collection.o $(BDIR)/Ref.o $(BDIR)/Fun.o $(BDIR)/Matcher.o $(BDIR)/Data.o
$(BDIR)/Buffer.o: $(BDIR)/List.o $(BDIR)/Buffer.o: $(BDIR)/List.o
$(BDIR)/STM.o: $(BDIR)/List.o $(BDIR)/Fun.o $(BDIR)/STM.o: $(BDIR)/List.o $(BDIR)/Fun.o
$(BDIR)/%.o: %.lama $(BDIR)/%.o: $(SRCDIR)/%.lama
LAMA=../runtime $(LAMAC) -g -I . -c $< -o $@ $(LAMAC) -g -I . -c $< #-o $@
clean: clean:
$(RM) -r *.s *.o *.i *~ $(RM) -r *.s *.o *.i *~

View file

@ -1,15 +1,52 @@
(rule (rule
(deps ../List.lama ../Makefile ../../runtime/Std.i) (deps
(targets List.i List.o) ../Makefile
../../runtime/Std.i
../List.lama
%{project_root}/src/Driver.exe)
(targets
List.i
List.o
Buffer.i
Buffer.o
Collection.i
Collection.o
Data.i
Data.o
Fun.i
Fun.o
Lazy.i
Lazy.o
List.i
List.o
Matcher.i
Matcher.o
Ostap.i
Ostap.o
Random.i
Random.o
Ref.i
Ref.o
STM.i
STM.o
Timer.i
Timer.o)
(mode
(promote (until-clean)))
(action (action
(progn (progn
(setenv (setenv
BDIR SRCDIR
"amd64" ".."
; (setenv
; FILES
; "List.lama Buffer.lama Collection.lama Data.lama Fun.lama"
(setenv (setenv
LAMA LAMA
"../runtime" "../../runtime"
(setenv (setenv
LAMAC LAMAC
"../src/Driver.exe -I ../runtime" "../../src/Driver.exe -march=amd64 -I ../runtime32"
(run make -C .. all))))))) (run make -j2 -f ../Makefile all)))))))
;)

View file

@ -1,38 +1,52 @@
(rule (rule
(targets List.o List.i)
(deps (deps
(:lama ../List.lama) ../Makefile
%{project_root}/runtime32/runtime32.a ../../runtime/Std.i
%{project_root}/runtime32/Std.i) ../List.lama
(action %{project_root}/src/Driver.exe)
(setenv (targets
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.i
List.o) List.o
Buffer.i
Buffer.o
Collection.i
Collection.o
Data.i
Data.o
Fun.i
Fun.o
Lazy.i
Lazy.o
List.i
List.o
Matcher.i
Matcher.o
Ostap.i
Ostap.o
Random.i
Random.o
Ref.i
Ref.o
STM.i
STM.o
Timer.i
Timer.o)
(mode
(promote (until-clean)))
(action (action
(setenv (progn
LAMA (setenv
"../../runtime32" SRCDIR
(run ".."
%{project_root}/src/Driver.exe ; (setenv
-march=x86 ; FILES
-I ; "List.lama Buffer.lama Collection.lama Data.lama Fun.lama"
. (setenv
-I LAMA
%{project_root}/runtime32 "../../runtime32"
-c (setenv
%{lama})))) LAMAC
"../../src/Driver.exe -march=x86 -I ../runtime32"
(run make -j2 -f ../Makefile all)))))))
;)