mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 00:10:56 +02:00
9aa8b4e371
Consolidate the native OTA launcher, bootstrap, and assets into the Switch port tree.
73 lines
1.9 KiB
Makefile
73 lines
1.9 KiB
Makefile
#---------------------------------------------------------------------------------
|
|
# One-shot OTA bootstrap NRO (copied into the main launcher's romfs).
|
|
#---------------------------------------------------------------------------------
|
|
.SUFFIXES:
|
|
|
|
ifeq ($(strip $(DEVKITPRO)),)
|
|
|
|
.PHONY: all
|
|
all:
|
|
@echo "DEVKITPRO not set — bootstrap builds with the launcher only."
|
|
@false
|
|
|
|
else
|
|
|
|
TOPDIR ?= $(CURDIR)
|
|
include $(DEVKITPRO)/libnx/switch_rules
|
|
|
|
TARGET := ota-bootstrap
|
|
BUILD := build
|
|
SOURCES := .
|
|
INCLUDES := include
|
|
ROMFS :=
|
|
|
|
APP_TITLE := gen1recomp OTA
|
|
APP_AUTHOR := bryanthaboi, port by andrewqsantos
|
|
APP_VERSION := 0.0.0
|
|
|
|
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
|
|
CFLAGS := -g -Wall -O2 -ffunction-sections $(ARCH) $(DEFINES)
|
|
CFLAGS += $(INCLUDE) -D__SWITCH__
|
|
ASFLAGS := -g $(ARCH)
|
|
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
|
LIBS := -lnx
|
|
LIBDIRS := $(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 := $(CFILES:.c=.o)
|
|
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_ICON := $(LIBNX)/default_icon.jpg
|
|
export NROFLAGS += --icon=$(APP_ICON)
|
|
export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp
|
|
|
|
.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
|
|
|
|
else
|
|
.PHONY: all
|
|
DEPENDS := $(OFILES:.o=.d)
|
|
all: $(OUTPUT).nro
|
|
$(OUTPUT).nro: $(OUTPUT).elf $(OUTPUT).nacp
|
|
$(OUTPUT).elf: $(OFILES)
|
|
-include $(DEPENDS)
|
|
endif
|
|
endif
|