xyxyxyxyxxyxyxy
xyxyxyxyxxyxyxy

Reputation: 19

not able to write make file

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?

Upvotes: 1

Views: 100

Answers (1)

Paul R
Paul R

Reputation: 212939

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

Upvotes: 3

Related Questions