diff --git a/.gitignore b/.gitignore index 6b0ad9c..b4078ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ Build -rom.sym \ No newline at end of file +*.sym diff --git a/rom.gb b/GB-GameOfLife.gb similarity index 95% rename from rom.gb rename to GB-GameOfLife.gb index b338b9f..e8c2dbb 100644 Binary files a/rom.gb and b/GB-GameOfLife.gb differ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c3940df --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +TITLE = "Game of Life" +INCLUDE = -i Graphics -i Code + +NAME = $(notdir $(CURDIR)) +FILES = $(wildcard Code/*.asm) +OBJECTS = $(patsubst Code/%.asm,Build/%.o,$(FILES)) + +.PHONY: clean mrproper + +Build/%.o: Code/%.asm + @echo Assembling $< + @rgbasm $(INCLUDE) -o $@ $< + +$(NAME).gb: $(OBJECTS) + @echo Linking... + @rgblink -n $(NAME).sym -w -t -o $(NAME).gb -d $(OBJECTS) + @rgbfix -t $(TITLE) -v -p 0 $(NAME).gb + +clean: + @rm -f $(OBJECTS) + @rm -f $(NAME).sym + +mrproper: clean + @rm -f $(NAME).gb