This repository has been archived on 2024-12-31. You can view files and clone it, but cannot push or open issues or pull requests.
MEMZ/PayloadMBR/Makefile

50 lines
1.1 KiB
Makefile
Raw Normal View History

BUILDDIR = Build
2017-04-12 09:53:46 -04:00
2017-04-14 07:00:23 -04:00
CC = cc
PY = python2
NASM = nasm
QEMU = qemu-system-i386
2017-04-12 09:53:46 -04:00
2017-04-14 07:00:23 -04:00
CCFLAGS =
ASFLAGS =
2017-04-12 06:15:35 -04:00
2017-04-14 07:00:23 -04:00
IMAGES = $(sort $(wildcard Data/Image/frames/*.png))
MUSIC = Data/Song/nyan.mid
2017-04-12 09:34:25 -04:00
STAGE1ASM = $(wildcard Source/Stage1/*.asm)
STAGE2ASM = $(wildcard Source/Stage2/*.asm)
2017-04-14 07:00:23 -04:00
all: disk.img
2017-04-12 06:15:35 -04:00
2017-04-14 07:00:23 -04:00
dir: $(BUILDDIR)
2017-04-14 07:00:23 -04:00
$(BUILDDIR):
mkdir -p $(BUILDDIR)
2017-04-12 06:15:35 -04:00
2017-04-14 07:00:23 -04:00
$(BUILDDIR)/image.bin: $(IMAGES)
$(PY) Data/Image/png2bin.py $(IMAGES) $@
2017-04-12 06:15:35 -04:00
2017-04-14 07:00:23 -04:00
$(BUILDDIR)/song.bin: $(MUSIC)
$(PY) Data/Song/midi2bin.py $(MUSIC) $@
2017-04-12 06:15:35 -04:00
$(BUILDDIR)/compress: Source/Compressor/compress.c
$(CC) Source/Compressor/compress.c -o $@ $(CCFLAGS)
2017-04-14 07:00:23 -04:00
2017-04-15 07:13:27 -04:00
$(BUILDDIR)/stage2.bin: $(STAGE2ASM) $(BUILDDIR)/song.bin $(BUILDDIR)/image.bin
cd Source/Stage2 && $(NASM) main.asm -o ../../$@ $(ASFLAGS)
$(BUILDDIR)/stage2-compressed.bin: $(BUILDDIR)/stage2.bin $(BUILDDIR)/compress
$(BUILDDIR)/compress $(BUILDDIR)/stage2.bin $@
disk.img: dir $(STAGE1ASM) $(BUILDDIR)/stage2-compressed.bin
cd Source/Stage1 && $(NASM) main.asm -o ../../disk.img $(ASFLAGS)
2017-04-12 06:15:35 -04:00
test: disk.img
2017-04-12 09:53:46 -04:00
$(QEMU) -s -soundhw pcspk -fda disk.img
2017-04-12 09:22:35 -04:00
clean:
2017-04-14 07:00:23 -04:00
rm -r $(BUILDDIR)
rm disk.img
2017-04-12 09:22:35 -04:00
2017-04-14 07:00:23 -04:00
.PHONY: test clean all dir