Set up build system using devkitPro toolchain. Includes standard flags for Switch development.
41 lines
No EOL
1.1 KiB
Makefile
41 lines
No EOL
1.1 KiB
Makefile
#---------------------------------------------------------------------------------
|
|
.SUFFIXES:
|
|
#---------------------------------------------------------------------------------
|
|
|
|
ifeq ($(strip $(DEVKITPRO)),)
|
|
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
|
|
endif
|
|
|
|
TOPDIR ?= $(CURDIR)
|
|
include $(DEVKITPRO)/libnx/switch_rules
|
|
|
|
#---------------------------------------------------------------------------------
|
|
TARGET := $(notdir $(CURDIR))
|
|
BUILD := build
|
|
SOURCES := source
|
|
INCLUDES := include
|
|
|
|
#---------------------------------------------------------------------------------
|
|
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
|
|
|
|
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
|
$(ARCH) $(DEFINES)
|
|
|
|
CFLAGS += $(INCLUDE) -D__SWITCH__
|
|
|
|
LIBS := -lnx -lm
|
|
|
|
#---------------------------------------------------------------------------------
|
|
LIBDIRS := $(PORTLIBS) $(LIBNX)
|
|
|
|
.PHONY: $(BUILD) clean all
|
|
|
|
all: $(BUILD)
|
|
|
|
$(BUILD):
|
|
@[ -d $@ ] || mkdir -p $@
|
|
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
|
|
|
clean:
|
|
@echo clean ...
|
|
@rm -fr $(BUILD) $(TARGET).nro $(TARGET).nacp $(TARGET).elf
|