diff --git a/stdlib/Makefile b/stdlib/Makefile index 10feda1a6..1ab0d5faa 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -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 *~ diff --git a/stdlib/amd64/dune b/stdlib/amd64/dune index a0464fb76..c19affc72 100644 --- a/stdlib/amd64/dune +++ b/stdlib/amd64/dune @@ -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))))))) + +;) diff --git a/stdlib/x32/dune b/stdlib/x32/dune index 33cbf3209..9b2623d81 100644 --- a/stdlib/x32/dune +++ b/stdlib/x32/dune @@ -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))))))) + +;)