mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
Update compilation of tutorial and instruction in README
Signed-off-by: Kakadu <Kakadu@pm.me>
This commit is contained in:
parent
107a2e2061
commit
9b3678f8bd
4 changed files with 23 additions and 20 deletions
21
Makefile
21
Makefile
|
|
@ -1,17 +1,15 @@
|
|||
EXECUTABLE = src/lamac
|
||||
INSTALL ?= install -v
|
||||
MKDIR ?= mkdir
|
||||
SHELL := /bin/bash
|
||||
|
||||
.PHONY: all regression
|
||||
|
||||
all:
|
||||
make -C src
|
||||
make -C runtime
|
||||
make -C stdlib
|
||||
$(MAKE) -C src
|
||||
$(MAKE) -C runtime
|
||||
$(MAKE) -C stdlib
|
||||
|
||||
STD_FILES=$(shell ls stdlib/*.[oi] stdlib/*.lama runtime/runtime.a runtime/Std.i)
|
||||
#$(info $(STD_FILES))
|
||||
|
||||
install: all
|
||||
$(INSTALL) $(EXECUTABLE) `opam var bin`
|
||||
|
|
@ -23,13 +21,12 @@ uninstall:
|
|||
$(RM) `opam var bin`/$(EXECUTABLE)
|
||||
|
||||
regression:
|
||||
make clean check -C regression
|
||||
make clean check -C stdlib/regression
|
||||
$(MAKE) clean check -C regression
|
||||
$(MAKE) clean check -C stdlib/regression
|
||||
|
||||
clean:
|
||||
make clean -C src
|
||||
make clean -C runtime
|
||||
make clean -C stdlib
|
||||
make clean -C regression
|
||||
$(MAKE) clean -C src
|
||||
$(MAKE) clean -C runtime
|
||||
$(MAKE) clean -C stdlib
|
||||
$(MAKE) clean -C regression
|
||||
$(MAKE) clean -C bench
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,6 @@ Windows users should get Windows Subsystem for Linux a.k.a WSL (recommended) or
|
|||
/home/user/.opam/lama/bin/lamac
|
||||
```
|
||||
|
||||
### Smoke-testing:
|
||||
### Smoke-testing (optional)
|
||||
|
||||
Clone the repository and run `make -C tutorial LAMAC=../src/lamac`. Without extra `LAMAC` switch it will try to use `lamac` installed system-wide to build tutorial.
|
||||
Clone the repository and run `make -C tutorial`. It should build local compiler `src/lamac` and a few tutorial executables in `tutorial/`.
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ $(TOPFILE).byte: $(SOURCES:.ml=.cmo)
|
|||
$(OCAMLC) -o $(TOPFILE).byte $(BFLAGS) -linkpkg $(SOURCES:.ml=.cmo)
|
||||
|
||||
clean:
|
||||
rm -Rf *.cmi *.cmo *.cmx *.annot *.o *.opt *.byte *~ .depend
|
||||
$(RM) $(TOPFILE) *.cm[ioxa] *.annot *.o *.opt *.byte *~ .depend
|
||||
|
||||
-include .depend
|
||||
# generic rules
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
SHELL := /bin/bash
|
||||
|
||||
FILES=$(wildcard *.lama)
|
||||
ALL=$(sort $(FILES:.lama=))
|
||||
LAMAC=lamac
|
||||
EXTRA_TARGETS =
|
||||
|
||||
all: $(ALL)
|
||||
ifeq ($(LAMAC),)
|
||||
LAMAC := ../src/lamac
|
||||
EXTRA_TARGETS += $(LAMAC)
|
||||
endif
|
||||
|
||||
all: $(EXTRA_TARGETS) $(ALL)
|
||||
|
||||
../src/lamac:
|
||||
$(MAKE) -C ../src
|
||||
|
||||
%: %.lama
|
||||
$(LAMAC) $<
|
||||
|
||||
clean:
|
||||
rm -Rf *.s *.o *.i *~ $(ALL)
|
||||
$(RM) -R *.s *.o *.i *~ $(ALL)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue