Initial commit: try make binaries
This commit is contained in:
48
Makefile
Normal file
48
Makefile
Normal file
@@ -0,0 +1,48 @@
|
||||
dev-image = 5150-dev
|
||||
|
||||
writefloppy.bin: writefloppy.asm
|
||||
nasm writefloppy.asm -o writefloppy.bin
|
||||
|
||||
readfloppy.bin: readfloppy.asm
|
||||
nasm readfloppy.asm -o readfloppy.bin
|
||||
|
||||
crc16.s: crc16.c
|
||||
ia16-elf-gcc -S -Os -o crc16.s crc16.c
|
||||
|
||||
crc16.bin: crc16.s crt0.c 5150.ld
|
||||
ia16-elf-gcc -o crc16.bin -Os -nostdlib crc16.s crt0.c
|
||||
|
||||
wozmon.s: wozmon.cc
|
||||
ia16-elf-gcc -S -Os -o wozmon.s wozmon.cc
|
||||
|
||||
wozmon.bin: wozmon.s crt0.c 5150.ld
|
||||
ia16-elf-gcc -o wozmon.bin -Os -nostdlib wozmon.s crt0.c
|
||||
truncate -s 510 wozmon.bin
|
||||
printf "\125\252" >> wozmon.bin
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Remove generated files
|
||||
rm -rf wozmon.bin crc16.bin readfloppy.bin writefloppy.bin
|
||||
|
||||
.PHONY: dev-image
|
||||
dev-image:
|
||||
docker build -t $(dev-image) --target dev .
|
||||
|
||||
.PHONY: dev
|
||||
dev: dev-image ## Launch a dev container
|
||||
docker run -it --rm -v $(CURDIR):/workspace $(dev-image)
|
||||
|
||||
|
||||
.PHONY: binaries
|
||||
binaries: ## Build all binaries
|
||||
docker build --build-arg TARGET=readfloppy.bin -o . --target=export .
|
||||
docker build --build-arg TARGET=writefloppy.bin -o . --target=export .
|
||||
docker build --build-arg TARGET=crc16.bin -o . --target=export .
|
||||
docker build --build-arg TARGET=wozmon.bin -o . --target=export .
|
||||
|
||||
|
||||
.PHONY: help
|
||||
help: ## Show this help
|
||||
@echo Noteworthy targets:
|
||||
@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
.DEFAULT_GOAL := help
|
Reference in New Issue
Block a user