Skip to content

Commit 99c1d94

Browse files
committed
Create FUNDING.yml
1 parent 748e9f4 commit 99c1d94

File tree

19 files changed

+550
-34
lines changed

19 files changed

+550
-34
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with a single custom sponsorship URL

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
.svn
43
*.save
54
*.layout

.ignoresvn

Lines changed: 0 additions & 4 deletions
This file was deleted.

CB-Template/Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
#
2+
# MIT License
3+
#
4+
# Code::Blocks + Android NDK project template
5+
# Copyright (c) 2016-2019 PS
6+
# HOWTO: https://clnviewer.github.io/Code-Blocks-Android-NDK/
7+
#
8+
# - No root device!
9+
# - Build Debug (NDK toolchain)
10+
# - Build Release (NDK toolchain)
11+
# - Run from device
12+
# - Debug from device.
13+
# - Auto start/stop gdbserverfrom device.
14+
# - No wrappers from Gradle/Java code required, works directly with the device.
15+
# - Advanced project export to Android.mk file format, possible using utility cbp2ndk.
16+
#
17+
# Permission is hereby granted, free of charge, to any person obtaining a copy
18+
# of this software and associated documentation files (the "Software"), to deal
19+
# in the Software without restriction, including without limitation the rights
20+
# to use, copy, modify, merge, publish, distribute, sub license, and/or sell
21+
# copies of the Software, and to permit persons to whom the Software is
22+
# furnished to do so, subject to the following conditions:
23+
#
24+
# The above copyright notice and this permission notice shall be included in all
25+
# copies or substantial portions of the Software.
26+
#
27+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33+
# SOFTWARE.
134

235
PLATFORM := armeabi-v7a
336
NDKROOT := C:\__BuildSource\__LIB__\android-ndk-r20-beta2
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#
2+
# MIT License
3+
#
4+
# Code::Blocks + Android NDK project template
5+
# Copyright (c) 2016-2019 PS
6+
# HOWTO: https://clnviewer.github.io/Code-Blocks-Android-NDK/
7+
#
8+
# - No root device!
9+
# - Build Debug (NDK toolchain)
10+
# - Build Release (NDK toolchain)
11+
# - Run from device
12+
# - Debug from device.
13+
# - Auto start/stop gdbserverfrom device.
14+
# - No wrappers from Gradle/Java code required, works directly with the device.
15+
# - Advanced project export to Android.mk file format, possible using utility cbp2ndk.
16+
#
17+
# Permission is hereby granted, free of charge, to any person obtaining a copy
18+
# of this software and associated documentation files (the "Software"), to deal
19+
# in the Software without restriction, including without limitation the rights
20+
# to use, copy, modify, merge, publish, distribute, sub license, and/or sell
21+
# copies of the Software, and to permit persons to whom the Software is
22+
# furnished to do so, subject to the following conditions:
23+
#
24+
# The above copyright notice and this permission notice shall be included in all
25+
# copies or substantial portions of the Software.
26+
#
27+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33+
# SOFTWARE.
34+
35+
# Variables PLATFORM* to Application.mk
36+
37+
PLATFORM_ABI := $(SC_NDK_ABI)
38+
PLATFORM_API := $(SC_NDK_API)
39+
PLATFORM_STL := c++_static
40+
PLATFORM_SCRIPT := Android.mk
41+
PLATFORM_OPTIM :=
42+
43+
# Variables local
44+
45+
DIR_NDKROOT := $(SC_NDK_DIR)
46+
DIR_PROJECT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
47+
STR_BUILDTAG := $(filter-out $@,$(MAKECMDGOALS))
48+
STR_BUILDOPT :=
49+
50+
ifeq ($(OS),Windows_NT)
51+
DIR_CONFCBP := $(shell dir *.cbp | findstr .cbp)
52+
else
53+
DIR_CONFCBP := $(shell find $("./") -name '*.cbp')
54+
endif
55+
56+
ifneq ($(PLATFORM_ABI),all)
57+
PLATFORM_ABI = armeabi-v7a
58+
endif
59+
60+
ifneq ($(ANALIZE),)
61+
STR_BUILDOPT += NDK_ANALIZE=1
62+
endif
63+
64+
ifeq ($(STR_BUILDTAG),Debug)
65+
STR_BUILDOPT += V=1 NDK_DEBUG=1
66+
PLATFORM_OPTIM = debug
67+
else
68+
STR_BUILDOPT += -j 4
69+
endif
70+
71+
all: setndk buildndk
72+
Debug: setndk buildndk adbsetup adbdebug buildscript rundebug
73+
Release: setndk buildndk adbsetup adbexec buildscript
74+
cleanDebug: setndk clean
75+
cleanRelease: setndk clean
76+
cleanall: setndk clean
77+
78+
setndk:
79+
@echo '==== SET NDK -> $(SC_NDK_API) -> $(SC_NDK_ABI) -> active device: [ $(PLATFORM_ABI) ] ===='
80+
@echo "APP_STL := $(PLATFORM_STL)" >Application.mk
81+
@echo "APP_ABI := $(SC_NDK_ABI)" >>Application.mk
82+
@echo "APP_PLATFORM := $(SC_NDK_API)" >>Application.mk
83+
@echo "APP_BUILD_SCRIPT := $(PLATFORM_SCRIPT)" >>Application.mk
84+
@echo "APP_OPTIM := $(PLATFORM_OPTIM)" >>Application.mk
85+
@cbp2ndk.exe $(STR_BUILDTAG) $(DIR_CONFCBP)
86+
-include $(PLATFORM_SCRIPT)
87+
88+
buildndk:
89+
@echo '==== Build $(STR_BUILDTAG) -> $(PLATFORM_ABI) platform -> $(SC_NDK_API) API ===='
90+
@Cmd.exe /C $(DIR_NDKROOT)\ndk-build.cmd NDK_APPLICATION_MK=$(DIR_PROJECT)Application.mk NDK_PROJECT_PATH=$(DIR_PROJECT) $(STR_BUILDOPT)
91+
92+
clean:
93+
@echo '==== Clean ===='
94+
@Cmd.exe /C $(DIR_NDKROOT)\ndk-build.cmd NDK_APPLICATION_MK=$(DIR_PROJECT)Application.mk NDK_PROJECT_PATH=$(DIR_PROJECT) clean
95+
@Cmd.exe /C adb.exe shell rm -f /data/local/tmp/$(LOCAL_MODULE)
96+
97+
adbsetup:
98+
@echo '==== ADB SETUP: [ $(PLATFORM_ABI) ] ===='
99+
Cmd.exe /C android-elf-cleaner.exe $(DIR_PROJECT)libs\$(PLATFORM_ABI)\$(LOCAL_MODULE)
100+
Cmd.exe /C adb.exe push $(DIR_PROJECT)libs\$(PLATFORM_ABI)\$(LOCAL_MODULE) /data/local/tmp/$(LOCAL_MODULE)
101+
Cmd.exe /C adb.exe shell /system/bin/chmod 0777 /data/local/tmp/$(LOCAL_MODULE)
102+
103+
adbexec:
104+
@echo '==== ADB RUN: [ $(PLATFORM_ABI) ] ===='
105+
@Cmd.exe /C adb.exe shell /data/local/tmp/$(LOCAL_MODULE) $(CBP2NDK_CMDLINE)
106+
107+
adbdebug:
108+
@echo '==== GDB Debug: [ $(PLATFORM_ABI) ] ===='
109+
@Cmd.exe /C adb.exe push $(DIR_PROJECT)libs\$(PLATFORM_ABI)\gdb.setup /data/local/tmp/gdb.setup
110+
@Cmd.exe /C adb.exe push $(DIR_PROJECT)libs\$(PLATFORM_ABI)\gdbserver /data/local/tmp/gdbserver
111+
@Cmd.exe /C adb.exe shell /system/bin/chmod 0777 /data/local/tmp/gdbserver
112+
113+
rundebug:
114+
@Cmd.exe /C DebugRemote.cmd
115+
116+
buildscript:
117+
ifeq (,$(wildcard ./RunRemote.cmd))
118+
@echo "adb.exe shell /data/local/tmp/$(LOCAL_MODULE) $(CBP2NDK_CMDLINE)" >RunRemote.cmd
119+
endif
120+
ifeq (,$(wildcard ./DebugRemote.cmd))
121+
@echo "adb.exe forward tcp:59999 tcp:59999" >DebugRemote.cmd
122+
@echo "start \"$(PLATFORM_ABI) GDB server\" /MIN adb.exe shell /data/local/tmp/gdbserver :59999 /data/local/tmp/$(LOCAL_MODULE) $(CBP2NDK_CMDLINE)" >>DebugRemote.cmd
123+
@echo "exit" >>DebugRemote.cmd
124+
endif
125+
126+
.PHONY: clean all
127+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
#include <string>
3+
#include <iostream>
4+
5+
#include <stdio.h>
6+
#include <unistd.h>
7+
8+
/*
9+
/// NDK Android native Project
10+
HOWTO: https://clnviewer.github.io/Code-Blocks-Android-NDK/
11+
AOSP heasers: https://github.com/ClnViewer/android-platform-headers/
12+
android-elf-cleaner: https://github.com/ClnViewer/termux-elf-cleaner/
13+
cbp2ndk: https://github.com/ClnViewer/Code-Blocks-Android-NDK/tree/master/cbp2ndk/
14+
15+
*/
16+
17+
int main(void)
18+
{
19+
int a = 18;
20+
int b = a;
21+
22+
std::cout << std::endl << "\tHello Android! " << b << " - " << a << std::endl << std::endl;
23+
24+
return 0;
25+
}
Loading
Loading

0 commit comments

Comments
 (0)