mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Stdlib compiles twice
Signed-off-by: Kakadu <Kakadu@pm.me>
This commit is contained in:
parent
092d5f2f33
commit
3a10d4a2a6
3 changed files with 106 additions and 51 deletions
|
|
@ -1,29 +1,33 @@
|
|||
.PHONY: all
|
||||
|
||||
SHELL := /bin/bash
|
||||
FILES=$(wildcard *.lama)
|
||||
ALL=$(sort $(FILES:.lama=.o))
|
||||
SRCDIR ?= .
|
||||
FILES ?= $(wildcard $(SRCDIR)/*.lama)
|
||||
OFILES = $(FILES:$(SRCDIR)/%=%)
|
||||
OFILES := $(OFILES:.lama=.o)
|
||||
$(info OFILES = $(OFILES))
|
||||
ALL := $(sort $(OFILES))
|
||||
LAMAC ?= ../src/lamac
|
||||
BDIR ?= .
|
||||
|
||||
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
|
||||
|
||||
Collection.o: List.o Ref.o
|
||||
$(BDIR)/Collection.o: $(BDIR)/List.o $(BDIR)/Ref.o
|
||||
|
||||
$(BDIR)/Array.o: $(BDIR)/List.o
|
||||
|
||||
Ostap.o: List.o Collection.o Ref.o Fun.o Matcher.o
|
||||
$(BDIR)/Random.o $(BDIR)/Collection.o: $(BDIR)/Array.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)/STM.o: $(BDIR)/List.o $(BDIR)/Fun.o
|
||||
|
||||
$(BDIR)/%.o: %.lama
|
||||
LAMA=../runtime $(LAMAC) -g -I . -c $< -o $@
|
||||
$(BDIR)/%.o: $(SRCDIR)/%.lama
|
||||
$(LAMAC) -g -I . -c $< #-o $@
|
||||
|
||||
clean:
|
||||
$(RM) -r *.s *.o *.i *~
|
||||
|
|
|
|||
|
|
@ -1,15 +1,52 @@
|
|||
(rule
|
||||
(deps ../List.lama ../Makefile ../../runtime/Std.i)
|
||||
(targets List.i List.o)
|
||||
(deps
|
||||
../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
|
||||
(progn
|
||||
(setenv
|
||||
BDIR
|
||||
"amd64"
|
||||
SRCDIR
|
||||
".."
|
||||
; (setenv
|
||||
; FILES
|
||||
; "List.lama Buffer.lama Collection.lama Data.lama Fun.lama"
|
||||
(setenv
|
||||
LAMA
|
||||
"../runtime"
|
||||
"../../runtime"
|
||||
(setenv
|
||||
LAMAC
|
||||
"../src/Driver.exe -I ../runtime"
|
||||
(run make -C .. all)))))))
|
||||
"../../src/Driver.exe -march=amd64 -I ../runtime32"
|
||||
(run make -j2 -f ../Makefile all)))))))
|
||||
|
||||
;)
|
||||
|
|
|
|||
|
|
@ -1,38 +1,52 @@
|
|||
(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
|
||||
../Makefile
|
||||
../../runtime/Std.i
|
||||
../List.lama
|
||||
%{project_root}/src/Driver.exe)
|
||||
(targets
|
||||
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
|
||||
(setenv
|
||||
LAMA
|
||||
"../../runtime32"
|
||||
(run
|
||||
%{project_root}/src/Driver.exe
|
||||
-march=x86
|
||||
-I
|
||||
.
|
||||
-I
|
||||
%{project_root}/runtime32
|
||||
-c
|
||||
%{lama}))))
|
||||
(progn
|
||||
(setenv
|
||||
SRCDIR
|
||||
".."
|
||||
; (setenv
|
||||
; FILES
|
||||
; "List.lama Buffer.lama Collection.lama Data.lama Fun.lama"
|
||||
(setenv
|
||||
LAMA
|
||||
"../../runtime32"
|
||||
(setenv
|
||||
LAMAC
|
||||
"../../src/Driver.exe -march=x86 -I ../runtime32"
|
||||
(run make -j2 -f ../Makefile all)))))))
|
||||
|
||||
;)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue