ams: support building unit test programs on windows/linux/macos
This commit is contained in:
@@ -1,11 +1,23 @@
|
||||
ifeq ($(strip $(ATMOSPHERE_OS_NAME)),horizon)
|
||||
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
|
||||
endif
|
||||
|
||||
include $(DEVKITPRO)/devkitA64/base_rules
|
||||
|
||||
else
|
||||
|
||||
include $(ATMOSPHERE_ARCH_MAKE_DIR)/base_rules
|
||||
|
||||
endif
|
||||
|
||||
export ATMOSPHERE_DEFINES += -DATMOSPHERE_ARCH_ARM64
|
||||
export ATMOSPHERE_SETTINGS += -mtp=soft
|
||||
export ATMOSPHERE_SETTINGS +=
|
||||
export ATMOSPHERE_CFLAGS +=
|
||||
export ATMOSPHERE_CXXFLAGS +=
|
||||
export ATMOSPHERE_ASFLAGS +=
|
||||
|
||||
ifeq ($(strip $(ATMOSPHERE_OS_NAME)),horizon)
|
||||
export ATMOSPHERE_SETTINGS += -mtp=soft
|
||||
endif
|
||||
28
libraries/config/arch/arm64/base_rules
Normal file
28
libraries/config/arch/arm64/base_rules
Normal file
@@ -0,0 +1,28 @@
|
||||
include $(ATMOSPHERE_ARCH_MAKE_DIR)/base_tools
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.a:
|
||||
#---------------------------------------------------------------------------------
|
||||
$(SILENTMSG) $(notdir $@)
|
||||
@rm -f $@
|
||||
$(SILENTCMD)$(AR) -rc $@ $^
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.cpp
|
||||
$(SILENTMSG) $(notdir $<)
|
||||
$(SILENTCMD)$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.c
|
||||
$(SILENTMSG) $(notdir $<)
|
||||
$(SILENTCMD)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.s
|
||||
@echo $(notdir $<)
|
||||
$(SILENTCMD)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.S
|
||||
$(SILENTMSG) $(notdir $<)
|
||||
$(SILENTCMD)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
52
libraries/config/arch/arm64/base_tools
Normal file
52
libraries/config/arch/arm64/base_tools
Normal file
@@ -0,0 +1,52 @@
|
||||
#---------------------------------------------------------------------------------
|
||||
# the prefix on the compiler executables
|
||||
#---------------------------------------------------------------------------------
|
||||
PREFIX :=
|
||||
|
||||
ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),gcc)
|
||||
|
||||
export CC := gcc
|
||||
export CXX := g++
|
||||
export AS := as
|
||||
export AR := gcc-ar
|
||||
export OBJCOPY := objcopy
|
||||
export STRIP := strip
|
||||
export NM := gcc-nm
|
||||
export RANLIB := gcc-ranlib
|
||||
|
||||
else ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),clang)
|
||||
|
||||
export CC := clang
|
||||
export CXX := clang++
|
||||
export AS := llvm-as
|
||||
export AR := llvm-ar
|
||||
export OBJCOPY := llvm-objcopy
|
||||
export STRIP := llvm-strip
|
||||
export NM := llvm-nm
|
||||
export RANLIB := llvm-ranlib
|
||||
|
||||
endif
|
||||
|
||||
ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH))
|
||||
|
||||
ifneq (,$(ISVC))
|
||||
ERROR_FILTER := 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g'
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# allow seeing compiler command lines with make V=1 (similar to autotools' silent)
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(V),1)
|
||||
SILENTMSG := @true
|
||||
SILENTCMD :=
|
||||
else
|
||||
SILENTMSG := @echo
|
||||
SILENTCMD := @
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# canned command sequence for binary data
|
||||
#---------------------------------------------------------------------------------
|
||||
define bin2o
|
||||
bin2s -a 8 -H `(echo $(<F) | tr . _)`.h $< | $(AS) -o $(<F).o
|
||||
endef
|
||||
5
libraries/config/arch/arm64/cpu/generic_arm64/cpu.mk
Normal file
5
libraries/config/arch/arm64/cpu/generic_arm64/cpu.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
export ATMOSPHERE_DEFINES += -DATMOSPHERE_CPU_GENERIC_ARM64
|
||||
export ATMOSPHERE_SETTINGS += -march=armv8-a+crc+crypto -mno-outline-atomics
|
||||
export ATMOSPHERE_CFLAGS +=
|
||||
export ATMOSPHERE_CXXFLAGS +=
|
||||
export ATMOSPHERE_ASFLAGS +=
|
||||
7
libraries/config/arch/x64/arch.mk
Normal file
7
libraries/config/arch/x64/arch.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
include $(ATMOSPHERE_ARCH_MAKE_DIR)/base_rules
|
||||
|
||||
export ATMOSPHERE_DEFINES += -DATMOSPHERE_ARCH_X64
|
||||
export ATMOSPHERE_SETTINGS +=
|
||||
export ATMOSPHERE_CFLAGS +=
|
||||
export ATMOSPHERE_CXXFLAGS +=
|
||||
export ATMOSPHERE_ASFLAGS +=
|
||||
28
libraries/config/arch/x64/base_rules
Normal file
28
libraries/config/arch/x64/base_rules
Normal file
@@ -0,0 +1,28 @@
|
||||
include $(ATMOSPHERE_ARCH_MAKE_DIR)/base_tools
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.a:
|
||||
#---------------------------------------------------------------------------------
|
||||
$(SILENTMSG) $(notdir $@)
|
||||
@rm -f $@
|
||||
$(SILENTCMD)$(AR) -rc $@ $^
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.cpp
|
||||
$(SILENTMSG) $(notdir $<)
|
||||
$(SILENTCMD)$(CXX) -MMD -MP -MF $(DEPSDIR)/$*.d $(CXXFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.c
|
||||
$(SILENTMSG) $(notdir $<)
|
||||
$(SILENTCMD)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.s
|
||||
@echo $(notdir $<)
|
||||
$(SILENTCMD)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
%.o: %.S
|
||||
$(SILENTMSG) $(notdir $<)
|
||||
$(SILENTCMD)$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d -x assembler-with-cpp $(ASFLAGS) -c $< -o $@ $(ERROR_FILTER)
|
||||
52
libraries/config/arch/x64/base_tools
Normal file
52
libraries/config/arch/x64/base_tools
Normal file
@@ -0,0 +1,52 @@
|
||||
#---------------------------------------------------------------------------------
|
||||
# the prefix on the compiler executables
|
||||
#---------------------------------------------------------------------------------
|
||||
PREFIX :=
|
||||
|
||||
ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),gcc)
|
||||
|
||||
export CC := gcc
|
||||
export CXX := g++
|
||||
export AS := as
|
||||
export AR := gcc-ar
|
||||
export OBJCOPY := objcopy
|
||||
export STRIP := strip
|
||||
export NM := gcc-nm
|
||||
export RANLIB := gcc-ranlib
|
||||
|
||||
else ifeq ($(strip $(ATMOSPHERE_COMPILER_NAME)),clang)
|
||||
|
||||
export CC := clang
|
||||
export CXX := clang++
|
||||
export AS := llvm-as
|
||||
export AR := llvm-ar
|
||||
export OBJCOPY := llvm-objcopy
|
||||
export STRIP := llvm-strip
|
||||
export NM := llvm-nm
|
||||
export RANLIB := llvm-ranlib
|
||||
|
||||
endif
|
||||
|
||||
ISVC=$(or $(VCBUILDHELPER_COMMAND),$(MSBUILDEXTENSIONSPATH32),$(MSBUILDEXTENSIONSPATH))
|
||||
|
||||
ifneq (,$(ISVC))
|
||||
ERROR_FILTER := 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):/\1(\2):/g'
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# allow seeing compiler command lines with make V=1 (similar to autotools' silent)
|
||||
#---------------------------------------------------------------------------------
|
||||
ifeq ($(V),1)
|
||||
SILENTMSG := @true
|
||||
SILENTCMD :=
|
||||
else
|
||||
SILENTMSG := @echo
|
||||
SILENTCMD := @
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# canned command sequence for binary data
|
||||
#---------------------------------------------------------------------------------
|
||||
define bin2o
|
||||
bin2s -a 8 -H `(echo $(<F) | tr . _)`.h $< | $(AS) -o $(<F).o
|
||||
endef
|
||||
5
libraries/config/arch/x64/cpu/generic_x64/cpu.mk
Normal file
5
libraries/config/arch/x64/cpu/generic_x64/cpu.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
export ATMOSPHERE_DEFINES += -DATMOSPHERE_CPU_GENERIC_X64
|
||||
export ATMOSPHERE_SETTINGS += -march=native -mtune=generic
|
||||
export ATMOSPHERE_CFLAGS +=
|
||||
export ATMOSPHERE_CXXFLAGS +=
|
||||
export ATMOSPHERE_ASFLAGS +=
|
||||
Reference in New Issue
Block a user