-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
62 lines (47 loc) · 1.25 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# All configuration vairables are located in the config file
CONFIG = cfg/make_default.cfg
# ! - - - - - - - - - - - - - - - - ! #
# DO NOT CHANGE ANYTHING AFTER THIS #
# ! - - - - - - - - - - - - - - - - ! #
include ${CONFIG}
# make the nes game from assembler files
all:
make clean_all
make $(GAME_NAME).nes
# create the nes file from assembler sources
$(GAME_NAME).nes:
# create folder if it does not exist
ifeq ($(OS), Windows_NT)
@-if not exist "$(BIN)" ( mkdir "$(BIN)" )
else
mkdir -p "$(BIN)"
endif
# assemble main file
$(CA65) asm/reflexion.asm -o $(BIN)/$(GAME_NAME).o --debug-info
# link files
$(LD65) $(BIN)/$(GAME_NAME).o -C $(GAME_NAME).cfg -o $(GAME_NAME).nes --dbgfile $(GAME_NAME).dbg
# clean object files
clean:
ifeq ($(OS), Windows_NT)
@-if exist "$(BIN)" ( rmdir /Q /S "$(BIN)" )
else
rm -rf "$(BIN)"
endif
# clean all generated files
clean_all:
make clean
ifeq ($(OS), Windows_NT)
del $(GAME_NAME).nes
del $(GAME_NAME).DBG
del dump_$(GAME_NAME).txt
else
rm -f $(GAME_NAME).nes
rm -f $(GAME_NAME).DBG
rm -f dump_$(GAME_NAME).txt
endif
# run the nes game generated with assembler sources
run:
$(EMULATOR) $(GAME_NAME).nes
# dump the nes files binary into hexa text
hex:
$(HEXDUMP) $(GAME_NAME).nes > dump_$(GAME_NAME).txt