not able to write make file

被刻印的时光 ゝ 提交于 2020-12-26 11:04:20

问题


I have made a small program in assembly language which is executing fine. I also have the commands to execute it but I don't know how to make a makefile to automate the same. The command I used is:

nasm -f bin boot2.asm -o boot2.bin && qemu-system-x86_64 -fda boot2.bin

How do I make a makefile for the same?


回答1:


Simple version:

all: build run

build: boot2.bin

boot2.bin: boot2.asm
    nasm -f bin boot2.asm -o boot2.bin

run: boot2.bin
    qemu-system-x86_64 -fda boot2.bin

clean:
    -rm boot2.bin


来源:https://stackoverflow.com/questions/65378273/not-able-to-write-make-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!