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 7, 2021
1 parent 11b4a0d commit 3a31ff7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Git
GIT=git
GIT_SUBMODULES=$(shell sed -nE 's/path = +(.+)/\1\/.git/ p' .gitmodules | paste -s -)

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

Expand All @@ -19,7 +24,7 @@ endif
OUT ?= build
SHELL_HACK := $(shell mkdir -p $(OUT))

BIN = $(OUT)/emu $(OUT)/bench
BIN = $(OUT)/emu $(GIT_SUBMODULES) $(OUT)/bench

all: $(BIN)

Expand Down Expand Up @@ -50,9 +55,14 @@ $(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
$(GIT_SUBMODULES): %/.git: .gitmodules
$(GIT) submodule update --init $*
@touch $@

$(OUT)/bench: gbit/lib/tester.c gbit/lib/ref_cpu.c gbit/lib/inputstate.c gbit/lib/disassembler.c
$(VECHO) " CC+LD\t$@\n"
$(Q)$(CC) -DENABLE_LCD=0 -o $@ cpu.c bench.c
$(Q)$(CC) -DENABLE_LCD=0 -DDEBUG -o $@ cpu.c bench.c $^


# Download Game Boy ROMs with full source
download_rom:
Expand Down

0 comments on commit 3a31ff7

Please sign in to comment.