-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (48 loc) · 1.85 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
63
64
65
66
67
68
69
OUTPUT = svc_mem
DEBUG = 1
STACKSIZE = 8192
CC = armcc
AS = armasm
LD = armlink
LIB = armlib
RM = rm
MODBIN = modbin
MAKEBANNER = MakeBanner
CFLAGS = -bigend -za1 -zps0 -zi4 -fa -fh -fx -fpu none -arch 3 -apcs '3/32/fp/swst/wide/softfp'
ASFLAGS = -bigend -fpu none -arch 3 -apcs '3/32/fp/swst'
LDFLAGS = -aif -reloc -ro-base 0x00 -dupok -remove -nodebug -verbose
INCPATH = ${TDO_DEVKIT_PATH}/include
LIBPATH = ${TDO_DEVKIT_PATH}/lib
INCFLAGS = -I$(INCPATH)/3do -I$(INCPATH)/community
LIBS = $(LIBPATH)/3do/clib.lib \
$(LIBPATH)/community/svc_funcs.lib \
$(LIBPATH)/3do/subroutinestartup.o
SRC_S = $(wildcard src/*.s)
SRC_C = $(wildcard src/*.c)
OBJ += $(SRC_S:src/%.s=build/%.s.o)
OBJ += $(SRC_C:src/%.c=build/%.c.o)
all: builddir example_folio.lib example.privfolio
builddir:
mkdir -p build
clean:
$(RM) -rfv build/
build/%.s.o: src/%.s
$(AS) $(INCFLAGS) $(ASFLAGS) $< -o $@
build/%.c.o: src/%.c
$(CC) $(INCFLAGS) $(CFLAGS) -c $< -o $@
build/%.cpp.o: src/%.cpp
$(CXX) $(INCFLAGS) $(CXXFLAGS) -c $< -o $@
build/example_folio.lib: build/example_folio_lib.c.o
$(LIB) -c $@ $<
example_folio.lib: builddir build/example_folio.lib
build/example.privfolio.unsigned: build/example_folio.c.o
$(LD) -o $@ $(LDFLAGS) $(LIBS) $<
example.privfolio.unsigned: builddir build/example.privfolio.unsigned
build/example.privfolio: example.privfolio.unsigned
$(MODBIN) --stack=$(STACKSIZE) --flags=2 --sign=3do --subsystype=1 --type=4 --name=example build/$< $@
example.privfolio: builddir build/example.privfolio
install: example_folio.lib example.privfolio src/example_folio.h
cp -fv build/example.privfolio ${TDO_DEVKIT_PATH}/takeme/System/Folios/
cp -fv build/example_folio.lib ${TDO_DEVKIT_PATH}/lib/community/
cp -fv src/example_folio.h ${TDO_DEVKIT_PATH}/include/community/
.PHONY: builddir install example_folio.lib example.privfolio