.SUFFIXES: ifeq ($(strip $(DEVKITPRO)),) $(error "DEVKITPRO is not set - install devkitPro and 'sudo dkp-pacman -S switch-dev'") endif TOPDIR ?= $(CURDIR) include $(DEVKITPRO)/libnx/switch_rules TARGET := tier4-recon BUILD := build SOURCES := source INCLUDES := source CONFIG_JSON := recon.json ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE DEFINES := -D__SWITCH__ CFLAGS := -g -Wall -Wextra -O2 -ffunction-sections -fdata-sections \ $(ARCH) $(DEFINES) $(INCLUDE) -std=gnu11 CXXFLAGS:= $(CFLAGS) ASFLAGS := -g $(ARCH) LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) \ -Wl,-Map,$(notdir $*.map) -Wl,--gc-sections LIBS := -lnx LIBDIRS := $(PORTLIBS) $(LIBNX) ifneq ($(BUILD),$(notdir $(CURDIR))) export OUTPUT := $(CURDIR)/$(TARGET) export TOPDIR := $(CURDIR) export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) export DEPSDIR := $(CURDIR)/$(BUILD) CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) export LD := $(CC) export OFILES := $(addsuffix .o,$(basename $(CFILES))) export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) -I$(CURDIR)/$(BUILD) export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) export APP_JSON := $(TOPDIR)/$(CONFIG_JSON) .PHONY: all clean all: $(BUILD) @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile $(BUILD): @mkdir -p $@ clean: @rm -fr $(BUILD) $(TARGET).nsp $(TARGET).nso $(TARGET).npdm $(TARGET).elf else .PHONY: all DEPENDS := $(OFILES:.o=.d) all : $(OUTPUT).nsp $(OUTPUT).nsp : $(OUTPUT).nso $(OUTPUT).npdm $(OUTPUT).nso : $(OUTPUT).elf $(OUTPUT).elf : $(OFILES) -include $(DEPENDS) endif