apps,litenes,Makefile: add rules for generating ROM source files

* The shell commands are evaluated before rule execution. If we run
  `make` for the first time, the `$SRCS` will not include the ROM source
  files, which leads to linking error.
* Now we add a rule to first manually generate the ROM source files.
This commit is contained in:
Zihao Yu 2019-09-08 16:33:06 +08:00
parent 8dc81395f3
commit f3dd5def39
1 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,9 @@
NAME := litenes
SRCS := $(shell find -L ./src/ -name "*.c")
ROMS := $(shell find -L ./src/ -name "*.nes")
PREBUILD := src/roms/gen/roms.h
PREBUILD := rom
include $(AM_HOME)/Makefile.app
src/roms/gen/roms.h: $(ROMS)
@cd src/roms && python3 build-roms.py
.PHONY: rom
rom: $(ROMS)
@cd src/roms && python3 build-roms.py