forked from SeanOMik/eBookReaderSwitch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.mupdf
64 lines (52 loc) · 2.11 KB
/
Makefile.mupdf
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
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
TOPDIR ?= $(CURDIR)
include $(DEVKITPRO)/libnx/switch_rules
TOOL_PREFIX ?= aarch64-none-elf-
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
CFLAGS += -D__SWITCH__ $(INCLUDE) `sdl2-config --cflags`
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -DDEBUG=1 -DTOFU_NOTO= -DTOFU_CJK=
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX)
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
#---------------------------------------------------------------------------------
.PHONY: mupdf
#---------------------------------------------------------------------------------
mupdf:
@echo Building mupdf ...
@$(shell ./opt/devkitpro/switchvars.sh $<)
$(MAKE) -e -C mupdf \
CC=${TOOL_PREFIX}gcc \
CXX=${TOOL_PREFIX}g++ \
LD=${TOOL_PREFIX}ld \
AR=${TOOL_PREFIX}ar \
RANLIB=${TOOL_PREFIX}ranlib \
XCFLAGS="${CPPFLAGS} ${CFLAGS}" \
USE_SYSTEM_FREETYPE=yes \
USE_SYSTEM_HARFBUZZ=no \
USE_SYSTEM_JBIG2DEC=no \
USE_SYSTEM_JPEGXR=no \
USE_SYSTEM_LCMS2=no \
USE_SYSTEM_LIBJPEG=yes \
USE_SYSTEM_MUJS=no \
USE_SYSTEM_OPENJPEG=no \
USE_SYSTEM_ZLIB=no \
libs
@mkdir -p mupdf/lib
@cp -f mupdf/build/release/*.a mupdf/lib