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

41 lines
1,000 B
Makefile
Raw Normal View History

2017-04-12 06:15:35 -04:00
2017-04-12 09:34:25 -04:00
IMAGES = $(sort $(wildcard Data/Image/frames/*.png))
2017-04-12 06:15:35 -04:00
MUSIC = Data/Song/nyan.mid
2017-04-12 09:34:25 -04:00
all: disk.img dir
dir:
mkdir build || true
2017-04-12 06:15:35 -04:00
2017-04-12 09:22:35 -04:00
build/image.bin: $(IMAGES)
2017-04-12 09:34:25 -04:00
python2 Data/Image/png2bin.py $(IMAGES) $@
2017-04-12 06:15:35 -04:00
2017-04-12 09:22:35 -04:00
build/song.bin: $(MUSIC)
2017-04-12 06:15:35 -04:00
python2 Data/Song/midi2bin.py $< $@
2017-04-12 09:22:35 -04:00
build/data.o: build/song.bin build/image.bin
cat build/image.bin build/song.bin Data/Other/message.txt > build/data.o
2017-04-12 06:15:35 -04:00
2017-04-12 09:22:35 -04:00
Data/compressed.bin: build/data.o Data/Compressor/compress.c
2017-04-12 07:13:36 -04:00
cc Data/Compressor/compress.c -o Data/Compressor/compress
2017-04-12 09:22:35 -04:00
Data/Compressor/compress build/data.o Data/compressed.bin
2017-04-12 07:13:36 -04:00
2017-04-12 08:03:32 -04:00
#comp.o: decompress.asm
# nasm decompress.asm -o comp.o -f aout
2017-04-12 09:22:35 -04:00
build/kernel.o: kernel.asm decompress.asm Data/compressed.bin
nasm kernel.asm -o build/kernel.o -f aout
2017-04-12 06:15:35 -04:00
2017-04-12 09:22:35 -04:00
disk.img: build/kernel.o linker.ld Data/compressed.bin
ld -o disk.img -T linker.ld build/kernel.o -m elf_i386
2017-04-12 06:15:35 -04:00
test: disk.img
qemu-system-i386 -s -soundhw pcspk -fda disk.img
2017-04-12 09:22:35 -04:00
clean:
rm build/* Data/Compressor/compress Data/compressed.bin
2017-04-12 08:03:32 -04:00
.PHONY: test all
2017-04-12 09:22:35 -04:00