-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·66 lines (50 loc) · 1.38 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
STATIC_LINKING := 0
AR := ar
ifneq ($(V),1)
Q := @
endif
ifneq ($(SANITIZER),)
CFLAGS := -fsanitize=$(SANITIZER) $(CFLAGS)
CXXFLAGS := -fsanitize=$(SANITIZER) $(CXXFLAGS)
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
endif
platform = libnx
CORE_DIR += .
TARGET_NAME := trampoline
LIBM = -lm
include $(DEVKITPRO)/libnx/switch_rules
TARGET := $(TARGET_NAME)_libretro_$(platform).a
DEFINES := -DSWITCH=1 -D__SWITCH__ -DARM
CFLAGS := $(DEFINES) -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -specs=$(LIBNX)/switch.specs
CFLAGS += -march=armv8-a -mtune=cortex-a57 -mtp=soft -mcpu=cortex-a57+crc+fp+simd -ffast-math
CXXFLAGS := $(ASFLAGS) $(CFLAGS)
STATIC_LINKING = 1
EXT := a
LDFLAGS += $(LIBM)
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g -DDEBUG
CXXFLAGS += -O0 -g -DDEBUG
else
CFLAGS += -O3
CXXFLAGS += -O3
endif
include Makefile.common
OBJECTS := libretro.o
CFLAGS += -Wall -D__LIBRETRO__ $(fpic)
CXXFLAGS += -Wall -D__LIBRETRO__ $(fpic)
all: $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(CXX) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CXX) $(CFLAGS) $(fpic) -c -o $@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
.PHONY: clean
print-%:
@echo '$*=$($*)'