-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (29 loc) · 1.14 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
ROOTDIR = $(N64_INST)
GCCN64PREFIX = $(ROOTDIR)/bin/mips64-elf-
CHKSUM64PATH = $(ROOTDIR)/bin/chksum64
MKDFSPATH = $(ROOTDIR)/bin/mkdfs
HEADERPATH = $(ROOTDIR)/mips64-elf/lib
N64TOOL = $(ROOTDIR)/bin/n64tool
HEADERNAME = header
LINK_FLAGS = -L$(ROOTDIR)/mips64-elf/lib -ldragon -lc -lm -ldragonsys -Tn64ld.x
PROG_NAME = chip8
CFLAGS = -std=gnu99 -march=vr4300 -mtune=vr4300 -O2 -Wall -Werror -Wno-unused-but-set-variable -Wno-unused-variable -I$(ROOTDIR)/mips64-elf/include
ASFLAGS = -mtune=vr4300 -march=vr4300
CC = $(GCCN64PREFIX)gcc
AS = $(GCCN64PREFIX)as
LD = $(GCCN64PREFIX)ld
OBJCOPY = $(GCCN64PREFIX)objcopy
$(PROG_NAME).v64: $(PROG_NAME).elf chip8.dfs
$(OBJCOPY) $(PROG_NAME).elf $(PROG_NAME).bin -O binary
rm -f $(PROG_NAME).v64
$(N64TOOL) -b -l 2M -t "CHIP 8 Emu" -h $(HEADERPATH)/$(HEADERNAME) -o $(PROG_NAME).v64 $(PROG_NAME).bin -s 1M chip8.dfs
$(CHKSUM64PATH) $(PROG_NAME).v64
$(PROG_NAME).elf : $(PROG_NAME).o
$(LD) -o $(PROG_NAME).elf $(PROG_NAME).o $(LINK_FLAGS)
copy: $(PROG_NAME).v64
cp $(PROG_NAME).v64 ~/public_html/
chip8.dfs:
$(MKDFSPATH) chip8.dfs ./filesystem/
all: $(PROG_NAME).v64
clean:
rm -f *.v64 *.elf *.o *.bin *.dfs