add global makefile, update tests

This commit is contained in:
Murphy 2024-09-22 23:41:30 -04:00
parent 798890c1f5
commit 7a19179b0f
Signed by: freya
GPG key ID: 744AB800E383AE52
6 changed files with 34 additions and 2 deletions

31
Makefile Normal file
View file

@ -0,0 +1,31 @@
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

View file

@ -5,3 +5,4 @@
-pedantic
-Wno-gnu-binary-literal
-Iinclude
-DPREFIX=/usr/local

View file

@ -8,6 +8,8 @@ CFLAGS += -Wall -Wextra -pedantic
CFLAGS += -Wno-initializer-overrides
CFLAGS += -O0 -g
PREFIX=/usr/local
# ======================== CONFIG OPTIONS ==
#
# MAX LEX LENGTH

View file

@ -18,7 +18,6 @@ null:
.text
.align 2
.globl main
.globl _start
# init the heap
heap_init:
@ -204,7 +203,6 @@ realloc_free:
jr $ra
_start:
main:
# push return address
addi $sp, $sp, -4

Binary file not shown.

Binary file not shown.