Skip to content

Commit

Permalink
Make bench program buildable and update git submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
Rsysz committed Jan 9, 2021
1 parent c05be73 commit 0c23716
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Git Submodules
SUBMODULES = \
gbit

GIT_SUBMODULES := $(shell git submodule update --init $(SUBMODULES))
GBIT_OBJS = \
gbit/lib/tester.o \
gbit/lib/ref_cpu.o \
gbit/lib/inputstate.o \
gbit/lib/disassembler.o

# Flags
CFLAGS = -std=gnu99 -O2 -Wall -Wextra
LDFLAGS = -lm

Expand Down Expand Up @@ -50,9 +62,9 @@ $(OUT)/cpu_instrs.h: tests/cpu_instrs.gb tests/rom2h.c
$(Q)$(CC) -o $(OUT)/rom2h tests/rom2h.c
@$(OUT)/rom2h

$(OUT)/bench: $(OUT)/cpu_instrs.h prof.h cpu.c bench.c gameboy.h
$(OUT)/bench: $(GBIT_OBJS) $(OUT)/cpu_instrs.h prof.h cpu.c bench.c gameboy.h
$(VECHO) " CC+LD\t$@\n"
$(Q)$(CC) -DENABLE_LCD=0 -o $@ cpu.c bench.c
$(Q)$(CC) -DENABLE_LCD=0 -DGBIT -o $@ cpu.c bench.c $(GBIT_OBJS)

# Download Game Boy ROMs with full source
download_rom:
Expand All @@ -64,7 +76,7 @@ download_rom:
wget -O roms/Frapball.gb https://github.com/1r3n33/frapball/releases/download/refs%2Fheads%2Fmaster/game.gb

clean:
$(RM) $(BIN) $(OBJS) $(deps)
$(RM) $(BIN) $(OBJS) $(GBIT_OBJS) $(deps)
distclean: clean
$(RM) prof.h
$(RM) -r roms
Expand Down

0 comments on commit 0c23716

Please sign in to comment.