-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
68 lines (53 loc) · 1.53 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
ifeq ($(HEAP_SIZE),)
HEAP_SIZE = 8388208
endif
ifeq ($(STACK_SIZE),)
STACK_SIZE = 61800
endif
ifeq ($(PRODUCT),)
PRODUCT = 3DLibrary.pdx
endif
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
SDK = ${PLAYDATE_SDK_PATH}
ifeq ($(SDK),)
SDK = $(shell egrep '^\s*SDKRoot' ~/.Playdate/config | head -n 1 | cut -c9-)
endif
ifeq ($(SDK),)
$(error SDK path not found; set ENV value PLAYDATE_SDK_PATH)
endif
VPATH += $(SELF_DIR)/mini3d-plus
# List C source files here
SRC += \
$(SELF_DIR)/main.c \
$(SELF_DIR)/mini3d-plus/mini3d.c \
$(SELF_DIR)/mini3d-plus/3dmath.c \
$(SELF_DIR)/mini3d-plus/scene.c \
$(SELF_DIR)/mini3d-plus/shape.c \
$(SELF_DIR)/mini3d-plus/imposter.c \
$(SELF_DIR)/mini3d-plus/render.c \
$(SELF_DIR)/mini3d-plus/collision.c \
$(SELF_DIR)/mini3d-plus/texture.c \
$(SELF_DIR)/mini3d-plus/pattern.c \
$(SELF_DIR)/mini3d-plus/image/miniz.c \
$(SELF_DIR)/mini3d-plus/image/spng.c \
$(SELF_DIR)/luaglue.c
# List all user directories here
UINCDIR += $(SELF_DIR)/mini3d-plus
# List all user C define here, like -D_DEBUG=1
UDEFS += -DPLAYDATE=1
# Define ASM defines here
UADEFS +=
# List the user directory to look for the libraries here
ULIBDIR +=
# List all user libraries here
ULIBS +=
#CLANGFLAGS = -fsanitize=address
ifneq ("$(wildcard $(SELF_DIR)/librif/src/)","")
SRC += \
$(SELF_DIR)/librif/src/librif.c \
$(SELF_DIR)/librif/src/playdate/librif_luaglue.c
CLANGFLAGS += -I$(SELF_DIR)/librif/src/ -DPLAYDATE=1
UDEFS += -DM3D_LIBRIF
UINCDIR += $(SELF_DIR)/librif/src
endif
include $(SDK)/C_API/buildsupport/common.mk