Merge branch 'master' of github.com:switchbrew/libnx

This commit is contained in:
yellows8 2018-01-25 00:42:27 -05:00
commit 53319ff6d2
9 changed files with 13 additions and 93 deletions

View File

@ -1,12 +1,9 @@
all: all:
$(MAKE) -C crt0/
$(MAKE) -C nx/ $(MAKE) -C nx/
install: install:
$(MAKE) -C buildscripts/ install $(MAKE) -C buildscripts/ install
$(MAKE) -C crt0/ install
$(MAKE) -C nx/ install $(MAKE) -C nx/ install
clean: clean:
$(MAKE) -C crt0/ clean
$(MAKE) -C nx/ clean $(MAKE) -C nx/ clean

View File

@ -1,6 +1,3 @@
install: install:
cp base_rules $(DEVKITA64)/ cp base_rules base_tools switch_rules $(DEVKITPRO)/devkitA64
cp base_tools $(DEVKITA64)/ cp lib/switch.ld lib/switch.specs $(DEVKITPRO)/devkitA64/aarch64-none-elf/lib/
cp switch_rules $(DEVKITA64)/
cp lib/switch.ld $(DEVKITA64)/aarch64-none-elf/lib/
cp lib/switch.specs $(DEVKITA64)/aarch64-none-elf/lib/

View File

@ -1,10 +1,4 @@
include $(DEVKITA64)/base_tools include $(DEVKITPRO)/devkitA64/base_tools
#---------------------------------------------------------------------------------
# add portlibs path
#---------------------------------------------------------------------------------
export PORTLIBS_PATH := $(DEVKITPRO)/portlibs
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
%.a: %.a:
@ -13,66 +7,6 @@ export PORTLIBS_PATH := $(DEVKITPRO)/portlibs
@rm -f $@ @rm -f $@
$(AR) -rc $@ $^ $(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 %.o: %.cpp
@ -84,11 +18,6 @@ export PORTLIBS_PATH := $(DEVKITPRO)/portlibs
@echo $(notdir $<) @echo $(notdir $<)
$(CC) -MMD -MP -MF $(DEPSDIR)/$*.d $(CFLAGS) -c $< -o $@ $(ERROR_FILTER) $(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 %.o: %.s
@echo $(notdir $<) @echo $(notdir $<)

View File

@ -10,7 +10,12 @@ endif
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# path to tools # 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 # the prefix on the compiler executables

View File

@ -4,5 +4,5 @@
%(old_link) -T switch.ld%s -pie --gc-sections -z text -z nodynamic-undefined-weak %(old_link) -T switch.ld%s -pie --gc-sections -z text -z nodynamic-undefined-weak
*startfile: *startfile:
switch_crt0%O%s crti%O%s crtbegin%O%s crti%O%s crtbegin%O%s

View File

@ -2,9 +2,9 @@ ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro) $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro)
endif 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 LIBNX ?= $(DEVKITPRO)/libnx

View File

@ -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

View File

@ -86,7 +86,7 @@ export OFILES := $(addsuffix .o,$(BINFILES)) \
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I. \ -I. \
-iquote$(CURDIR)/include/switch/ -iquote $(CURDIR)/include/switch/
.PHONY: clean all .PHONY: clean all