diff --git a/Makefile b/Makefile index 56c87c5..79cb541 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,25 @@ SHELL = /bin/bash .SHELLFLAGS = -o pipefail -c -make: +.DEFAULT_GOAL := help + +.PHONY: help +help: + +.PHONY: up +up: + docker compose up -d + +.PHONY: down +down: + docker compose down + +.PHONY: ibulang +ibulang: + docker compose exec ibulang bash + +.PHONY: bootstrap +bootstrap: as -o bootstrap/ibu.o bootstrap/ibu.s as -o bootstrap/tokenizer.o bootstrap/tokenizer.s as -o bootstrap/parser.o bootstrap/parser.s @@ -13,6 +31,7 @@ make: as -o lib/runtime.o lib/runtime.s ld -o ibuc bootstrap/ibu.o bootstrap/tokenizer.o bootstrap/parser.o bootstrap/codegen.o bootstrap/preprocessor.o bootstrap/linux-syscall.o bootstrap/std.o lib/runtime.o +.PHONY: self self: ./ibuc src/ibu.ibu | as - -o src/ibu.o ./ibuc src/tokenizer/tokenizer.ibu | as - -o src/tokenizer.o @@ -24,6 +43,7 @@ self: as -o lib/runtime.o lib/runtime.s ld -o ibuc src/tokenizer.o src/parser.o src/codegen.o src/preprocessor.o src/ibu.o lib/std.o lib/runtime.o lib/linux-syscall.o +.PHONY: update_bootstrap update_bootstrap: ./ibuc src/ibu.ibu > bootstrap/ibu.s ./ibuc src/tokenizer/tokenizer.ibu > bootstrap/tokenizer.s @@ -33,6 +53,7 @@ update_bootstrap: ./ibuc lib/linux-syscall/linux-syscall.ibu > bootstrap/linux-syscall.s ./ibuc lib/std/std.ibu > bootstrap/std.s +.PHONY: clean clean: rm *.o *.out ibuc bootstrap/*.o src/*.o lib/*.o diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e696869 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + ibulang: + build: + context: . + dockerfile: Dockerfile + volumes: + - .:/root/env + working_dir: /root/env + stdin_open: true # docker run -i + tty: true # docker run -t