Skip to content

Commit 2e53e97

Browse files
Update for new new new new libtesla
2 parents 7bf0b73 + 045d0fd commit 2e53e97

28 files changed

+9190
-432
lines changed

.clang-format

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
AccessModifierOffset: -4
2+
AccessModifierOffset: -2
33
BasedOnStyle: LLVM
44
BreakBeforeBraces: Attach
5+
NamespaceIndentation: All
6+
FixNamespaceComments: false
57
IndentWidth: 4
68
TabWidth: 4
79
AllowShortIfStatementsOnASingleLine: false
@@ -20,6 +22,6 @@ IndentCaseLabels: 'true'
2022
PointerAlignment: Right
2123
SortIncludes: 'true'
2224
Standard: Cpp11
23-
UseTab: Always
25+
UseTab: Never
2426

2527
...

.vscode/c_cpp_properties.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include/**",
88
"/opt/devkitpro/libnx/include/**",
99
"/opt/devkitpro/portlibs/switch/include/**",
10-
"libs/libtesla/**"
10+
"libs/include/**"
1111
],
1212
"defines": [
1313
"SWITCH",
1414
"__SWITCH__",
15-
"DEBUG"
15+
"DEBUG",
16+
"VERSION=\"1.3.3.7\""
1617
],
1718
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++",
1819
"cStandard": "c11",

Makefile

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ include $(DEVKITPRO)/libnx/switch_rules
3838
# NACP building is skipped as well.
3939
#---------------------------------------------------------------------------------
4040
APP_TITLE := ShareNX
41-
APP_VERSION := 1.0.0
41+
APP_VERSION := 1.0.1
4242

4343
TARGET := ovlShareNX
4444
BUILD := build
4545
SOURCES := source
4646
DATA := data
47-
INCLUDES := include
47+
INCLUDES := libs/include
48+
APP_VERSION := 1.1.0
49+
50+
ifeq ($(RELEASE),)
51+
APP_VERSION := $(APP_VERSION)-$(shell git describe --dirty --always)
52+
endif
4853

4954
NO_ICON := 1
5055

@@ -53,23 +58,23 @@ NO_ICON := 1
5358
#---------------------------------------------------------------------------------
5459
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
5560

56-
CFLAGS := -g -Wall -O2 -ffunction-sections \
61+
CFLAGS := -g -Wall -O3 -ffunction-sections \
5762
$(ARCH) $(DEFINES)
5863

59-
CFLAGS += $(INCLUDE) -D__SWITCH__
64+
CFLAGS += $(INCLUDE) -D__SWITCH__ -DVERSION=\"v$(APP_VERSION)\"
6065

61-
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=c++17
66+
CXXFLAGS := $(CFLAGS) -fno-exceptions -std=c++17
6267

6368
ASFLAGS := -g $(ARCH)
6469
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
6570

66-
LIBS := -lcurl -lmbedtls -lmbedx509 -lz -lmbedcrypto -lnx -ltesla -lnx
71+
LIBS := -lcurl -lmbedtls -lmbedx509 -lz -lmbedcrypto -lnx
6772

6873
#---------------------------------------------------------------------------------
6974
# list of directories containing libraries, this must be the top level containing
7075
# include and lib
7176
#---------------------------------------------------------------------------------
72-
LIBDIRS := $(PORTLIBS) $(LIBNX) $(TOPDIR)/libs/libtesla
77+
LIBDIRS := $(PORTLIBS) $(LIBNX)
7378

7479

7580
#---------------------------------------------------------------------------------
@@ -171,7 +176,6 @@ $(BUILD):
171176

172177
#---------------------------------------------------------------------------------
173178
clean:
174-
@$(MAKE) --no-print-directory -C $(TOPDIR)/libs/libtesla -f Makefile clean
175179
@rm -fr $(BUILD) $(TARGET).ovl $(TARGET).nro $(TARGET).nacp $(TARGET).elf
176180

177181

@@ -190,17 +194,10 @@ $(OUTPUT).ovl : $(OUTPUT).elf $(OUTPUT).nacp
190194
@elf2nro $< $@ $(NROFLAGS)
191195
@echo "built ... $(notdir $(OUTPUT).ovl)"
192196

193-
$(OUTPUT).elf : $(OFILES) libs/libtesla/lib/libtesla.a
197+
$(OUTPUT).elf : $(OFILES)
194198

195199
$(OFILES_SRC) : $(HFILES_BIN)
196200

197-
libs/libtesla/lib/libtesla.a:
198-
@$(MAKE) --no-print-directory -C $(TOPDIR)/libs/libtesla -f Makefile
199-
200-
clean:
201-
@$(MAKE) --no-print-directory -C $(TOPDIR)/libs/libtesla -f Makefile clean
202-
@rm -fr $(BUILD) $(TARGET).ovl $(TARGET).nro $(TARGET).nacp $(TARGET).elf
203-
204201
#---------------------------------------------------------------------------------
205202
# you need a rule like this for each extension you use as binary data
206203
#---------------------------------------------------------------------------------

libs/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
debug
2+
release
3+
lib
4+
*.bz2
5+
6+
example/build/
7+
8+
*.elf
9+
10+
*.nacp
11+
12+
*.ovl

libs/.gitrepo

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; DO NOT EDIT (unless you know what you are doing)
2+
;
3+
; This subdirectory is a git "subrepo", and this file is maintained by the
4+
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
5+
;
6+
[subrepo]
7+
remote = git@github.com:WerWolv/libtesla.git
8+
branch = master
9+
commit = 159e691eb267035d19da431b8e47eb4acd123166
10+
parent = a1dedd34424d7f54fa39488add25628a62561ed7
11+
method = merge
12+
cmdver = 0.4.1

libs/.vscode/c_cpp_properties.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "DKP Aarch64 Windows",
5+
"includePath": [
6+
"C:/devkitPro/devkitA64/aarch64-none-elf/include/**",
7+
"C:/devkitPro/devkitA64/lib/gcc/aarch64-none-elf/9.2.0/include/**",
8+
"C:/devkitPro/libnx/include/**",
9+
"C:/devkitPro/portlibs/switch/include/**",
10+
"${workspaceFolder}/include/**"
11+
],
12+
"defines": [
13+
"SWITCH",
14+
"VERSION=\"\"",
15+
"__SWITCH__",
16+
"__aarch64__"
17+
],
18+
"compilerPath": "C:/devkitPro/devkitA64/bin/aarch64-none-elf-g++",
19+
"cStandard": "c11",
20+
"cppStandard": "c++17",
21+
"intelliSenseMode": "gcc-x64"
22+
},
23+
{
24+
"name": "DKP Aarch64 Linux",
25+
"includePath": [
26+
"/opt/devkitpro/devkitA64/aarch64-none-elf/include/**",
27+
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/9.2.0/include/**",
28+
"/opt/devkitpro/libnx/include/**",
29+
"/opt/devkitpro/portlibs/switch/include/**",
30+
"${workspaceFolder}/include/**"
31+
],
32+
"defines": [
33+
"SWITCH",
34+
"VERSION=\"\"",
35+
"__SWITCH__",
36+
"__aarch64__"
37+
],
38+
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++",
39+
"cStandard": "c11",
40+
"cppStandard": "c++17",
41+
"intelliSenseMode": "gcc-x64"
42+
}
43+
],
44+
"version": 4
45+
}

libs/.vscode/settings.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"files.associations": {
3+
"*.tcc": "cpp",
4+
"algorithm": "cpp",
5+
"array": "cpp",
6+
"atomic": "cpp",
7+
"bit": "cpp",
8+
"cctype": "cpp",
9+
"chrono": "cpp",
10+
"clocale": "cpp",
11+
"cmath": "cpp",
12+
"condition_variable": "cpp",
13+
"cstdarg": "cpp",
14+
"cstddef": "cpp",
15+
"cstdint": "cpp",
16+
"cstdio": "cpp",
17+
"cstdlib": "cpp",
18+
"cstring": "cpp",
19+
"ctime": "cpp",
20+
"cwchar": "cpp",
21+
"cwctype": "cpp",
22+
"deque": "cpp",
23+
"unordered_map": "cpp",
24+
"vector": "cpp",
25+
"exception": "cpp",
26+
"functional": "cpp",
27+
"iterator": "cpp",
28+
"memory": "cpp",
29+
"memory_resource": "cpp",
30+
"numeric": "cpp",
31+
"optional": "cpp",
32+
"random": "cpp",
33+
"ratio": "cpp",
34+
"string": "cpp",
35+
"string_view": "cpp",
36+
"system_error": "cpp",
37+
"tuple": "cpp",
38+
"type_traits": "cpp",
39+
"utility": "cpp",
40+
"fstream": "cpp",
41+
"initializer_list": "cpp",
42+
"iosfwd": "cpp",
43+
"istream": "cpp",
44+
"limits": "cpp",
45+
"mutex": "cpp",
46+
"new": "cpp",
47+
"ostream": "cpp",
48+
"sstream": "cpp",
49+
"stdexcept": "cpp",
50+
"streambuf": "cpp",
51+
"thread": "cpp",
52+
"cinttypes": "cpp",
53+
"typeinfo": "cpp",
54+
"map": "cpp",
55+
"stack": "cpp"
56+
}
57+
}

0 commit comments

Comments
 (0)