-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (21 loc) · 877 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
ROOT_DIR=$(shell pwd)
BUILD_DIR=${ROOT_DIR}/.build
run: clean nasm-test jasm-test
jasm-test:
deno test --coverage=.build/.cov --allow-read .
nasm-test: mov inc add
mov:
nasm -felf32 ${ROOT_DIR}/test/$@.asm -o ${BUILD_DIR}/$@.bin
objcopy -O binary -j .firstTest ${BUILD_DIR}/$@.bin ${BUILD_DIR}/$@.rr.bin
objcopy -O binary -j .secondTest ${BUILD_DIR}/$@.bin ${BUILD_DIR}/$@.ri.bin
add:
nasm -felf64 ${ROOT_DIR}/test/$@.asm -o ${BUILD_DIR}/$@.bin
objcopy -O binary -j .firstTest ${BUILD_DIR}/$@.bin ${BUILD_DIR}/$@.rr.bin
objcopy -O binary -j .secondTest ${BUILD_DIR}/$@.bin ${BUILD_DIR}/$@.ri.bin
objcopy -O binary -j .thirdTest ${BUILD_DIR}/$@.bin ${BUILD_DIR}/$@.bri.bin
inc:
nasm -felf32 ${ROOT_DIR}/test/$@.asm -o ${BUILD_DIR}/$@.bin
objcopy -O binary -j .firstTest ${BUILD_DIR}/$@.bin ${BUILD_DIR}/$@.na.bin
clean:
rm -rf ${BUILD_DIR}
mkdir ${BUILD_DIR}