-
Notifications
You must be signed in to change notification settings - Fork 143
/
build_prx.mak
66 lines (52 loc) · 1.78 KB
/
build_prx.mak
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
# PSP Software Development Kit - https://github.com/pspdev
# -----------------------------------------------------------------------
# Licensed under the BSD license, see LICENSE in PSPSDK root for details.
#
# build.mak - Base makefile for projects using PSPSDK.
#
# Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
# Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
# Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
#
# Note: The PSPSDK make variable must be defined before this file is included.
ifeq ($(PSPSDK),)
$(error $$(PSPSDK) is undefined. Use "PSPSDK := $$(shell psp-config --pspsdk-path)" in your Makefile)
endif
CC = psp-gcc
CXX = psp-g++
AS = psp-gcc
LD = psp-gcc
FIXUP = psp-fixup-imports
# Add PSPSDK includes and libraries.
INCDIR := $(INCDIR) . $(PSPDEV)/psp/include $(PSPSDK)/include
LIBDIR := $(LIBDIR) . $(PSPDEV)/psp/lib $(PSPSDK)/lib
CFLAGS := $(addprefix -I,$(INCDIR)) -G0 $(CFLAGS)
CXXFLAGS := $(CFLAGS) $(CXXFLAGS)
ASFLAGS := $(CFLAGS) $(ASFLAGS)
LDFLAGS := $(addprefix -L,$(LIBDIR)) -Wl,-q,-T$(PSPSDK)/lib/linkfile.prx -nostartfiles -Wl,-zmax-page-size=128 $(LDFLAGS)
ifeq ($(USE_KERNEL_LIBS),1)
LIBS := -nostdlib $(LIBS) -lpspdebug -lpspdisplay_driver -lpspctrl_driver -lpspmodinfo -lpspsdk -lpspkernel
else
LIBS := $(LIBS) -lpspdebug -lpspdisplay -lpspge -lpspctrl
endif
ifeq ($(PSP_FW_VERSION),)
PSP_FW_VERSION=150
endif
CFLAGS += -D_PSP_FW_VERSION=$(PSP_FW_VERSION)
FINAL_TARGET = $(TARGET).prx
all: $(FINAL_TARGET)
ifeq ($(NO_FIXUP_IMPORTS), 1)
$(TARGET).elf: $(OBJS)
$(LINK.c) $^ $(LIBS) -o $@
else
$(TARGET).elf: $(OBJS)
$(LINK.c) $^ $(LIBS) -o $@
$(FIXUP) $@
endif
%.prx: %.elf
psp-prxgen $< $@
%.c: %.exp
psp-build-exports -b $< > $@
clean: $(EXTRA_CLEAN)
-rm -f $(FINAL_TARGET) $(TARGET).elf $(OBJS)
rebuild: clean all