-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.15 KB
/
Makefile
File metadata and controls
58 lines (44 loc) · 1.15 KB
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
CFLAGS=-Wall -Isrc
LDFLAGS=-lSDL2 -lSDL2_ttf -lm -lstdc++ -pthread -Wl,--as-needed -Wl,--gc-sections -s
ifeq ($(TARGET),rg350)
ifndef RG350_TOOLCHAIN
$(error RG350_TOOLCHAIN environment variable must be set! Please point it to the RG350 buildroot directory.)
endif
TOOLCHAIN=$(RG350_TOOLCHAIN)/output/host
SYSROOT=$(TOOLCHAIN)/usr/mipsel-gcw0-linux-uclibc/sysroot
CC=$(TOOLCHAIN)/usr/bin/mipsel-linux-gcc
CFLAGS += -DTARGET_RG350
else
SYSROOT=/
CC=gcc
endif
OPK_DIR=opk
OPK_FILE=$(PROG).gcw0.desktop
OPK_ICON=images/icon.png
ASSETS_DIR=assets
C_SOURCES=src/bps.c \
src/ips.c \
src/patch.c \
src/rombp.c \
src/ui.c
OBJS=$(subst .c,.o,$(C_SOURCES))
PROG=rombp
all: $(PROG)
$(OPK_DIR):
mkdir $(OPK_DIR)
$(PROG).opk: $(PROG) $(OPK_DIR)
cp $(PROG) $(OPK_DIR)
cp $(OPK_FILE) $(OPK_DIR)
cp $(OPK_ICON) $(OPK_DIR)
cp -rv $(ASSETS_DIR) $(OPK_DIR)
mksquashfs $(OPK_DIR) $@ -all-root -noappend -no-exports -no-xattrs
$(PROG): $(OBJS)
$(CC) $(CFLAGS) --sysroot=$(SYSROOT) -o $(PROG) $^ $(LDFLAGS)
%.o: %.c
$(CC) -c $(CFLAGS) --sysroot=$(SYSROOT) -o $@ $<
clean:
rm -rf $(PROG)
rm -rf $(PROG).opk
rm -rf $(OPK_DIR)
rm -rf src/*.o
.PHONY: all clean