diff --git a/Makefile b/Makefile index b13232e9..f1ab10e0 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,9 @@ all: - $(MAKE) -C crt0/ $(MAKE) -C nx/ install: $(MAKE) -C buildscripts/ install - $(MAKE) -C crt0/ install $(MAKE) -C nx/ install clean: - $(MAKE) -C crt0/ clean $(MAKE) -C nx/ clean diff --git a/buildscripts/Makefile b/buildscripts/Makefile index 3ed1269b..c8ee527d 100644 --- a/buildscripts/Makefile +++ b/buildscripts/Makefile @@ -1,6 +1,3 @@ install: - cp base_rules $(DEVKITA64)/ - cp base_tools $(DEVKITA64)/ - cp switch_rules $(DEVKITA64)/ - cp lib/switch.ld $(DEVKITA64)/aarch64-none-elf/lib/ - cp lib/switch.specs $(DEVKITA64)/aarch64-none-elf/lib/ + cp base_rules base_tools switch_rules $(DEVKITPRO)/devkitA64 + cp lib/switch.ld lib/switch.specs $(DEVKITPRO)/devkitA64/aarch64-none-elf/lib/ diff --git a/buildscripts/base_rules b/buildscripts/base_rules index 45e4b8a9..1b8a273d 100644 --- a/buildscripts/base_rules +++ b/buildscripts/base_rules @@ -1,10 +1,4 @@ -include $(DEVKITA64)/base_tools - -#--------------------------------------------------------------------------------- -# add portlibs path -#--------------------------------------------------------------------------------- -export PORTLIBS_PATH := $(DEVKITPRO)/portlibs - +include $(DEVKITPRO)/devkitA64/base_tools #--------------------------------------------------------------------------------- %.a: @@ -13,66 +7,6 @@ export PORTLIBS_PATH := $(DEVKITPRO)/portlibs @rm -f $@ $(AR) -rc $@ $^ -#--------------------------------------------------------------------------------- -%.arm.o: %.arm.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.arm.d $(CXXFLAGS) -marm -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.arm.o: %.arm.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.arm.d $(CFLAGS) -marm -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.arm.o: %.arm.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.arm.d $(OBJCFLAGS) -marm -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.thumb.o: %.thumb.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.thumb.d $(CXXFLAGS) -mthumb -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.thumb.o: %.thumb.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.thumb.d $(CFLAGS) -mthumb -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.thumb.o: %.thumb.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.thumb.d $(OBJCFLAGS) -mthumb -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.iwram.o: %.iwram.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.iwram.d $(CXXFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.iwram.o: %.iwram.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.iwram.d $(CFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.iwram.o: %.iwram.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.iwram.d $(OBJCFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.itcm.o: %.itcm.cpp - @echo $(notdir $<) - $(CXX) -MMD -MP -MF $(DEPSDIR)/$*.itcm.d $(CXXFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.itcm.o: %.itcm.c - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.itcm.d $(CFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - -#--------------------------------------------------------------------------------- -%.itcm.o: %.itcm.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.itcm.d $(OBJCFLAGS) -marm -mlong-calls -c $< -o $@ $(ERROR_FILTER) - #--------------------------------------------------------------------------------- %.o: %.cpp @@ -84,11 +18,6 @@ export PORTLIBS_PATH := $(DEVKITPRO)/portlibs @echo $(notdir $<) $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER) -#--------------------------------------------------------------------------------- -%.o: %.m - @echo $(notdir $<) - $(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(OBJCFLAGS) -c $< -o $@ $(ERROR_FILTER) - #--------------------------------------------------------------------------------- %.o: %.s @echo $(notdir $<) diff --git a/buildscripts/base_tools b/buildscripts/base_tools index d322ce3a..887aff4d 100644 --- a/buildscripts/base_tools +++ b/buildscripts/base_tools @@ -10,7 +10,12 @@ endif #--------------------------------------------------------------------------------- # path to tools #--------------------------------------------------------------------------------- -export PATH := $(DEVKITA64)/bin:$(PATH) +export PATH := $(DEVKITPRO)/devkitA64/bin:$(PATH) + +#--------------------------------------------------------------------------------- +# add portlibs path +#--------------------------------------------------------------------------------- +export PORTLIBS_PATH := $(DEVKITPRO)/portlibs #--------------------------------------------------------------------------------- # the prefix on the compiler executables diff --git a/buildscripts/lib/switch.specs b/buildscripts/lib/switch.specs index 5fa72298..914f97a0 100644 --- a/buildscripts/lib/switch.specs +++ b/buildscripts/lib/switch.specs @@ -4,5 +4,5 @@ %(old_link) -T switch.ld%s -pie --gc-sections -z text -z nodynamic-undefined-weak *startfile: -switch_crt0%O%s crti%O%s crtbegin%O%s +crti%O%s crtbegin%O%s diff --git a/buildscripts/switch_rules b/buildscripts/switch_rules index 419321e8..cb1bfe7d 100644 --- a/buildscripts/switch_rules +++ b/buildscripts/switch_rules @@ -2,9 +2,9 @@ ifeq ($(strip $(DEVKITPRO)),) $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitPro) endif -include $(DEVKITA64)/base_rules +include $(DEVKITPRO)/devkitA64/base_rules -PORTLIBS := $(PORTLIBS_PATH)/armv8-a $(PORTLIBS_PATH)/switch +PORTLIBS := $(PORTLIBS_PATH)/switch $(PORTLIBS_PATH)/armv8-a LIBNX ?= $(DEVKITPRO)/libnx diff --git a/crt0/Makefile b/crt0/Makefile deleted file mode 100644 index fdd5fc3c..00000000 --- a/crt0/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -switch_crt0.o: *.s - $(DEVKITA64)/bin/aarch64-none-elf-gcc -march=armv8-a -x assembler-with-cpp -c $^ -o $@ - -install: switch_crt0.o - cp $^ $(DEVKITA64)/aarch64-none-elf/lib/pic/$^ - -clean: - rm -f switch_crt0.o diff --git a/nx/Makefile b/nx/Makefile index 8a94238c..5e49174b 100644 --- a/nx/Makefile +++ b/nx/Makefile @@ -86,7 +86,7 @@ export OFILES := $(addsuffix .o,$(BINFILES)) \ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ -I. \ - -iquote$(CURDIR)/include/switch/ + -iquote $(CURDIR)/include/switch/ .PHONY: clean all diff --git a/crt0/switch_crt0.s b/nx/source/runtime/switch_crt0.s similarity index 100% rename from crt0/switch_crt0.s rename to nx/source/runtime/switch_crt0.s