Skip to content

Instantly share code, notes, and snippets.

@tanishiking
Last active August 18, 2016 04:24
Show Gist options
  • Save tanishiking/22b545ebd5bd9c8328f1bbdcd4f2c658 to your computer and use it in GitHub Desktop.
Save tanishiking/22b545ebd5bd9c8328f1bbdcd4f2c658 to your computer and use it in GitHub Desktop.
SRCS=ipl.s
OBJS=$(SRCS:.s=.o)
BINS=$(SRCS:.s=.bin)
IMGS=$(SRCS:.s=.img)
LNK=lnk.ld
all:
make img
make run
$(OBJS): $(SRCS)
as -o $@ $^
$(BINS): $(OBJS) $(LNK)
ld -o $@ -T $(LNK) $(OBJS)
$(IMGS): $(BINS)
mformat -f 1440 -C -B $^ -i $@
img: $(IMGS)
run: $(IMGS)
qemu-system-i386 $^
.PHONY: clean
clean:
$(RM) $(IMGS) $(BINS) $(OBJS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment