-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fuck breaking ams changes, all my homies hate breaking ams changes
- Loading branch information
Showing
6 changed files
with
201 additions
and
153 deletions.
There are no files selected for viewing
Submodule Atmosphere-libs
updated
1161 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,145 +1,41 @@ | ||
#--------------------------------------------------------------------------------- | ||
# pull in (modded) common stratosphere sysmodule configuration | ||
#--------------------------------------------------------------------------------- | ||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../Atmosphere-libs/config/templates/stratosphere.mk | ||
|
||
ARCH = -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE | ||
|
||
CFLAGS = -g -Wall -O2 -ffunction-sections \ | ||
$(ARCH) $(DEFINES) | ||
|
||
CFLAGS += $(INCLUDE) -D__SWITCH__ $(UL_DEFS) | ||
|
||
CXXFLAGS = $(CFLAGS) $(UL_CXXFLAGS) | ||
|
||
ASFLAGS = -g $(ARCH) | ||
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) | ||
|
||
SOURCES += $(UL_COMMON_SOURCES) | ||
INCLUDES += $(UL_COMMON_INCLUDES) | ||
|
||
LIBS += -ljpeg | ||
|
||
#--------------------------------------------------------------------------------- | ||
# no real need to edit anything past this point unless you need to add additional | ||
# rules for different file extensions | ||
#--------------------------------------------------------------------------------- | ||
ifneq ($(BUILD),$(notdir $(CURDIR))) | ||
#--------------------------------------------------------------------------------- | ||
|
||
export OUTPUT := $(CURDIR)/$(TARGET) | ||
export TOPDIR := $(CURDIR) | ||
|
||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ | ||
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) | ||
|
||
export DEPSDIR := $(CURDIR)/$(BUILD) | ||
|
||
|
||
CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \ | ||
$(notdir $(wildcard $(dir)/*.c)))) | ||
CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).c))) | ||
CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).c))) | ||
CFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).c))) | ||
|
||
CPPFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.cpp)) $(notdir $(wildcard $(dir)/*.board.*.cpp)) $(notdir $(wildcard $(dir)/*.os.*.cpp)), \ | ||
$(notdir $(wildcard $(dir)/*.cpp)))) | ||
CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).cpp))) | ||
CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).cpp))) | ||
CPPFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).cpp))) | ||
|
||
SFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.s)) $(notdir $(wildcard $(dir)/*.board.*.s)) $(notdir $(wildcard $(dir)/*.os.*.s)), \ | ||
$(notdir $(wildcard $(dir)/*.s)))) | ||
SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.arch.$(ATMOSPHERE_ARCH_NAME).s))) | ||
SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.board.$(ATMOSPHERE_BOARD_NAME).s))) | ||
SFILES += $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.os.$(ATMOSPHERE_OS_NAME).s))) | ||
|
||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# use CXX for linking C++ projects, CC for standard C | ||
#--------------------------------------------------------------------------------- | ||
ifeq ($(strip $(CPPFILES)),) | ||
#--------------------------------------------------------------------------------- | ||
export LD := $(CC) | ||
#--------------------------------------------------------------------------------- | ||
else | ||
#--------------------------------------------------------------------------------- | ||
export LD := $(CXX) | ||
#--------------------------------------------------------------------------------- | ||
endif | ||
#--------------------------------------------------------------------------------- | ||
|
||
export OFILES := $(addsuffix .o,$(BINFILES)) \ | ||
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.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 BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC) | ||
|
||
ifeq ($(strip $(CONFIG_JSON)),) | ||
jsons := $(wildcard *.json) | ||
ifneq (,$(findstring $(TARGET).json,$(jsons))) | ||
export APP_JSON := $(TOPDIR)/$(TARGET).json | ||
else | ||
ifneq (,$(findstring config.json,$(jsons))) | ||
export APP_JSON := $(TOPDIR)/config.json | ||
endif | ||
endif | ||
else | ||
export APP_JSON := $(TOPDIR)/$(CONFIG_JSON) | ||
endif | ||
|
||
.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).nsp $(TARGET).npdm $(TARGET).nso $(TARGET).elf | ||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
else | ||
.PHONY: all | ||
|
||
DEPENDS := $(OFILES:.o=.d) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# main targets | ||
#--------------------------------------------------------------------------------- | ||
all : $(OUTPUT).nsp | ||
|
||
ifeq ($(strip $(APP_JSON)),) | ||
$(OUTPUT).nsp : $(OUTPUT).nso | ||
else | ||
$(OUTPUT).nsp : $(OUTPUT).nso $(OUTPUT).npdm | ||
endif | ||
|
||
$(OUTPUT).nso : $(OUTPUT).elf | ||
|
||
$(OUTPUT).elf : $(OFILES) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# you need a rule like this for each extension you use as binary data | ||
#--------------------------------------------------------------------------------- | ||
%.bin.o : %.bin | ||
#--------------------------------------------------------------------------------- | ||
@echo $(notdir $<) | ||
@$(bin2o) | ||
|
||
-include $(DEPENDS) | ||
|
||
#--------------------------------------------------------------------------------------- | ||
endif | ||
#--------------------------------------------------------------------------------------- | ||
ATMOSPHERE_BUILD_CONFIGS := | ||
all: nx_release | ||
|
||
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE))) | ||
|
||
define ATMOSPHERE_ADD_TARGET | ||
|
||
ATMOSPHERE_BUILD_CONFIGS += $(strip $1) | ||
|
||
$(strip $1): | ||
@echo "Building $(strip $1)" | ||
@$$(MAKE) -f $(CURRENT_DIRECTORY)/uDaemon.mk ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5) | ||
|
||
clean-$(strip $1): | ||
@echo "Cleaning $(strip $1)" | ||
@$$(MAKE) -f $(CURRENT_DIRECTORY)/uDaemon.mk clean ATMOSPHERE_MAKEFILE_TARGET="$(strip $1)" ATMOSPHERE_BUILD_NAME="$(strip $2)" ATMOSPHERE_BOARD="$(strip $3)" ATMOSPHERE_CPU="$(strip $4)" $(strip $5) | ||
|
||
endef | ||
|
||
define ATMOSPHERE_ADD_TARGETS | ||
|
||
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_release, release, $(strip $2), $(strip $3), \ | ||
ATMOSPHERE_BUILD_SETTINGS="$(strip $4)" \ | ||
)) | ||
|
||
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_debug, debug, $(strip $2), $(strip $3), \ | ||
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_DEBUGGING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 \ | ||
)) | ||
|
||
$(eval $(call ATMOSPHERE_ADD_TARGET, $(strip $1)_audit, audit, $(strip $2), $(strip $3), \ | ||
ATMOSPHERE_BUILD_SETTINGS="$(strip $4) -DAMS_BUILD_FOR_AUDITING" ATMOSPHERE_BUILD_FOR_DEBUGGING=1 ATMOSPHERE_BUILD_FOR_AUDITING=1 \ | ||
)) | ||
|
||
endef | ||
|
||
$(eval $(call ATMOSPHERE_ADD_TARGETS, nx, nx-hac-001, arm-cortex-a57,)) | ||
|
||
clean: $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS),clean-$(config)) | ||
|
||
.PHONY: all clean $(foreach config,$(ATMOSPHERE_BUILD_CONFIGS), $(config) clean-$(config)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
#--------------------------------------------------------------------------------- | ||
# pull in common stratosphere sysmodule configuration | ||
#--------------------------------------------------------------------------------- | ||
THIS_MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
CURRENT_DIRECTORY := $(abspath $(dir $(THIS_MAKEFILE))) | ||
include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../Atmosphere-libs/config/templates/stratosphere.mk | ||
|
||
ATMOSPHERE_SYSTEM_MODULE_TARGETS := nsp | ||
|
||
ARCH = -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE | ||
|
||
CFLAGS = -g -Wall -O2 -ffunction-sections \ | ||
$(ARCH) $(DEFINES) | ||
|
||
CFLAGS += $(INCLUDE) -D__SWITCH__ $(UL_DEFS) | ||
|
||
CXXFLAGS = $(CFLAGS) $(UL_CXXFLAGS) | ||
|
||
ASFLAGS = -g $(ARCH) | ||
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map) | ||
|
||
SOURCES += $(UL_COMMON_SOURCES) | ||
INCLUDES += $(UL_COMMON_INCLUDES) | ||
|
||
LIBS += -ljpeg | ||
|
||
#--------------------------------------------------------------------------------- | ||
# no real need to edit anything past this point unless you need to add additional | ||
# rules for different file extensions | ||
#--------------------------------------------------------------------------------- | ||
ifneq ($(__RECURSIVE__),1) | ||
#--------------------------------------------------------------------------------- | ||
|
||
export TOPDIR := $(CURDIR) | ||
|
||
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ | ||
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) | ||
|
||
CFILES := $(call FIND_SOURCE_FILES,$(SOURCES),c) | ||
CPPFILES := $(call FIND_SOURCE_FILES,$(SOURCES),cpp) | ||
SFILES := $(call FIND_SOURCE_FILES,$(SOURCES),s) | ||
|
||
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# use CXX for linking C++ projects, CC for standard C | ||
#--------------------------------------------------------------------------------- | ||
ifeq ($(strip $(CPPFILES)),) | ||
#--------------------------------------------------------------------------------- | ||
export LD := $(CC) | ||
#--------------------------------------------------------------------------------- | ||
else | ||
#--------------------------------------------------------------------------------- | ||
export LD := $(CXX) | ||
#--------------------------------------------------------------------------------- | ||
endif | ||
#--------------------------------------------------------------------------------- | ||
|
||
export OFILES := $(addsuffix .o,$(BINFILES)) \ | ||
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) | ||
|
||
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ | ||
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \ | ||
$(foreach dir,$(AMS_LIBDIRS),-I$(dir)/include) \ | ||
-I$(CURDIR)/$(ATMOSPHERE_BUILD_DIR) | ||
|
||
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) $(foreach dir,$(AMS_LIBDIRS),-L$(dir)/$(ATMOSPHERE_LIBRARY_DIR)) | ||
|
||
export BUILD_EXEFS_SRC := $(TOPDIR)/$(EXEFS_SRC) | ||
|
||
ifeq ($(strip $(CONFIG_JSON)),) | ||
jsons := $(wildcard *.json) | ||
ifneq (,$(findstring $(TARGET).json,$(jsons))) | ||
export APP_JSON := $(TOPDIR)/$(TARGET).json | ||
else | ||
ifneq (,$(findstring config.json,$(jsons))) | ||
export APP_JSON := $(TOPDIR)/config.json | ||
endif | ||
endif | ||
else | ||
export APP_JSON := $(TOPDIR)/$(CONFIG_JSON) | ||
endif | ||
|
||
.PHONY: clean all check_lib | ||
|
||
#--------------------------------------------------------------------------------- | ||
all: $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR) $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/$(ATMOSPHERE_LIBRARY_DIR)/libstratosphere.a | ||
@$(MAKE) __RECURSIVE__=1 OUTPUT=$(CURDIR)/$(ATMOSPHERE_OUT_DIR)/$(TARGET) \ | ||
DEPSDIR=$(CURDIR)/$(ATMOSPHERE_BUILD_DIR) \ | ||
--no-print-directory -C $(ATMOSPHERE_BUILD_DIR) \ | ||
-f $(THIS_MAKEFILE) | ||
|
||
$(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/$(ATMOSPHERE_LIBRARY_DIR)/libstratosphere.a: check_lib | ||
@$(SILENTCMD)echo "Checked library." | ||
|
||
ifeq ($(ATMOSPHERE_CHECKED_LIBSTRATOSPHERE),1) | ||
check_lib: | ||
else | ||
check_lib: | ||
@$(MAKE) --no-print-directory -C $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere -f $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/libstratosphere.mk | ||
endif | ||
|
||
$(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR): | ||
@[ -d $@ ] || mkdir -p $@ | ||
|
||
#--------------------------------------------------------------------------------- | ||
clean: | ||
@echo clean ... | ||
@rm -fr $(ATMOSPHERE_OUT_DIR) $(ATMOSPHERE_BUILD_DIR) | ||
|
||
|
||
#--------------------------------------------------------------------------------- | ||
else | ||
.PHONY: all | ||
|
||
DEPENDS := $(OFILES:.o=.d) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# main targets | ||
#--------------------------------------------------------------------------------- | ||
all : $(foreach target,$(ATMOSPHERE_SYSTEM_MODULE_TARGETS),$(OUTPUT).$(target)) | ||
|
||
$(OUTPUT).kip : $(OUTPUT).elf | ||
$(OUTPUT).nsp : $(OUTPUT).nso $(OUTPUT).npdm | ||
$(OUTPUT).nso : $(OUTPUT).elf | ||
|
||
$(OUTPUT).elf : $(OFILES) | ||
|
||
$(OFILES) : $(ATMOSPHERE_LIBRARIES_DIR)/libstratosphere/$(ATMOSPHERE_LIBRARY_DIR)/libstratosphere.a | ||
|
||
%.npdm : %.npdm.json | ||
@echo built ... $< $@ | ||
@npdmtool $< $@ | ||
@echo built ... $(notdir $@) | ||
|
||
#--------------------------------------------------------------------------------- | ||
# you need a rule like this for each extension you use as binary data | ||
#--------------------------------------------------------------------------------- | ||
%.bin.o : %.bin | ||
#--------------------------------------------------------------------------------- | ||
@echo $(notdir $<) | ||
@$(bin2o) | ||
|
||
-include $(DEPENDS) | ||
|
||
#--------------------------------------------------------------------------------------- | ||
endif | ||
#--------------------------------------------------------------------------------------- |