-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
48 lines (38 loc) · 1.18 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PLATFORM := $(shell uname -s)
ifneq ($(findstring MINGW,$(PLATFORM)),)
PLATFORM := windows32
USE_WINDRES := true
endif
ifneq ($(findstring MSYS,$(PLATFORM)),)
PLATFORM := windows32
endif
ifeq ($(PLATFORM),windows32)
# To force use of the Unix version instead of the Windows version
MKDIR := $(shell which mkdir)
else
MKDIR := mkdir
endif
NULL := /dev/null
ifeq ($(PLATFORM),windows32)
NULL := NUL
endif
all: gamevoy
gamevoy: $(shell find . -type f -name '*.v') bootroms/dmg_boot.bin bootroms/cgb_boot.bin
v -w .
bootroms/%.bin: bootroms/%.asm bootroms/CGB_logo.pb12
-@$(MKDIR) -p $(dir $@)
rgbasm -i bootroms -o [email protected] $<
rgblink -o [email protected] [email protected]
dd [email protected] of=$@ count=1 bs=$(if $(findstring dmg,$@)$(findstring sgb,$@)$(findstring mgb,$@),256,2304) 2> $(NULL)
bootroms/%.2bpp: bootroms/%.png
-@$(MKDIR) -p $(dir $@)
rgbgfx $(if $(filter $(shell echo 'print __RGBDS_MAJOR__ || (!__RGBDS_MAJOR__ && __RGBDS_MINOR__ > 5)' | rgbasm -), $$0), -h -u, -Z -u -c embedded) -o $@ $<
bootroms/%.pb12: bootroms/%.2bpp bootroms/pb12.vsh
-@$(MKDIR) -p $(dir $@)
v run bootroms/pb12.vsh < $< > $@
clean:
$(RM) gamevoy
$(RM) bootroms/*.bin
$(RM) bootroms/*.pb12
.PHONY: all clean