最近又看起了李忠老师的汇编,每次敲命令编译实在是麻烦。写了一个Makefile,需要的拿走吧(Karl,拿走不谢)。
- SRC=$(wildcard *.asm)
- OBJ=$(patsubst %.asm,%.bin,$(SRC))
- LIST=$(patsubst %.asm,%.list,$(SRC))
- CC=nasm
-
-
- $(OBJ): $(SRC)
- $(CC) -f bin $^ -o $@ -l $(LIST)
- dd if=$(OBJ) of=a.img
-
- .PHONY:clean
- clean:
- $(RM) *.bin *.list