-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (25 loc) · 842 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.PHONY: run nestest help
.DEFAULT_GOAL := run
ROM = Tests/SwiftNESTests/fixtures/helloworld/sample1.nes
NESTEST_ROM = roms/nes-test-roms/other/nestest.nes
.PHONY: fmt
fmt: ## Run Format
@swift run swift-format format -r -i Sources/ Tests/
.PHONY: lint
lint: ## Run lint
@swiftlint --fix -- && swiftlint
.PHONY: debug
debug: ## Debug emulator
@swift run -c debug SwiftNESMain run ${ROM}
.PHONY: run
run: ## Run emulator
@mkdir -p .log
@rm -f .log/debug.log
@swift run -c release SwiftNESMain run ${ROM}
.PHONY: nestest
nestest: ## Run nestest
@mkdir -p .log
@rm -f .log/nestest.log
@swift run -c debug -Xswiftc -Dnestest SwiftNESMain nestest ${NESTEST_ROM} > .log/nestest.log
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'