add global makefile, update tests
This commit is contained in:
parent
798890c1f5
commit
7a19179b0f
6 changed files with 34 additions and 2 deletions
31
Makefile
Normal file
31
Makefile
Normal 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
|
|
@ -5,3 +5,4 @@
|
||||||
-pedantic
|
-pedantic
|
||||||
-Wno-gnu-binary-literal
|
-Wno-gnu-binary-literal
|
||||||
-Iinclude
|
-Iinclude
|
||||||
|
-DPREFIX=/usr/local
|
||||||
|
|
|
@ -8,6 +8,8 @@ CFLAGS += -Wall -Wextra -pedantic
|
||||||
CFLAGS += -Wno-initializer-overrides
|
CFLAGS += -Wno-initializer-overrides
|
||||||
CFLAGS += -O0 -g
|
CFLAGS += -O0 -g
|
||||||
|
|
||||||
|
PREFIX=/usr/local
|
||||||
|
|
||||||
# ======================== CONFIG OPTIONS ==
|
# ======================== CONFIG OPTIONS ==
|
||||||
#
|
#
|
||||||
# MAX LEX LENGTH
|
# MAX LEX LENGTH
|
||||||
|
|
|
@ -18,7 +18,6 @@ null:
|
||||||
.text
|
.text
|
||||||
.align 2
|
.align 2
|
||||||
.globl main
|
.globl main
|
||||||
.globl _start
|
|
||||||
|
|
||||||
# init the heap
|
# init the heap
|
||||||
heap_init:
|
heap_init:
|
||||||
|
@ -204,7 +203,6 @@ realloc_free:
|
||||||
jr $ra
|
jr $ra
|
||||||
|
|
||||||
|
|
||||||
_start:
|
|
||||||
main:
|
main:
|
||||||
# push return address
|
# push return address
|
||||||
addi $sp, $sp, -4
|
addi $sp, $sp, -4
|
||||||
|
|
BIN
test/mld/test.o
BIN
test/mld/test.o
Binary file not shown.
BIN
test/msim/test
BIN
test/msim/test
Binary file not shown.
Loading…
Reference in a new issue