include config.mk

.PHONY: build clean install uninstall masm mld msim

build: masm mld msim
	./bin/masm/masm -o ./bin/runtime.o ./lib/runtime.asm

clean:
	rm -fr ./bin

install:
	install -m 755 -D -t $(PREFIX)/bin ./bin/masm/masm
	install -m 755 -D -t $(PREFIX)/bin ./bin/mld/mld
	install -m 755 -D -t $(PREFIX)/bin ./bin/msim/msim
	install -m 444 -D -t $(PREFIX)/lib/mips ./bin/runtime.o

uninstall:
	rm $(PREFIX)/bin/masm
	rm $(PREFIX)/bin/mld
	rm $(PREFIX)/bin/msim
	rm $(PREFIX)/lib/mips/runtime.o
	rmdir $(PREFIX)/lib/mips

masm:
	make -C ./masm build

mld:
	make -C ./mld build

msim:
	make -C ./msim build