Skip to content

Commit bb6a418

Browse files
committed
2 parents eac98e7 + d3b9ac1 commit bb6a418

28 files changed

+2545
-56
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
*.sh
88
/bin
99
/obj
10-
_git-commit.sh
11-
_svn-commit.sh
12-
_svn-update.sh
13-
_svn-init.sh
10+
*.sh
1411

1512
# Prerequisites
1613
*.d

CB-Template/templates/wizard/ndk_android/files/Makefile renamed to CB-Template/CodeBlocks/templates/wizard/ndk_android/files/Makefile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ PLATFORM_OPTIM :=
4242

4343
# Variables local
4444

45+
DIR_UTILS := $(SC_BIN_PATH)
4546
DIR_NDKROOT := $(SC_NDK_DIR)
4647
DIR_PROJECT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
4748
STR_BUILDTAG := $(filter-out $@,$(MAKECMDGOALS))
@@ -76,13 +77,8 @@ cleanRelease: setndk clean
7677
cleanall: setndk clean
7778

7879
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)
80+
@echo '==== SET C::B NDK -> $(SC_NDK_API) -> $(SC_NDK_ABI) -> active device: [ $(PLATFORM_ABI) ] ===='
81+
@$(DIR_UTILS)/exec/cbp2ndk32.exe -t $(STR_BUILDTAG) -c $(DIR_CONFCBP) --api $(PLATFORM_API) --abi $(PLATFORM_ABI) --ndkopt $(PLATFORM_OPTIM)
8682
-include $(PLATFORM_SCRIPT)
8783

8884
buildndk:
@@ -96,7 +92,7 @@ clean:
9692

9793
adbsetup:
9894
@echo '==== ADB SETUP: [ $(PLATFORM_ABI) ] ===='
99-
Cmd.exe /C android-elf-cleaner.exe $(DIR_PROJECT)libs\$(PLATFORM_ABI)\$(LOCAL_MODULE)
95+
Cmd.exe /C $(DIR_UTILS)/exec/android-elf-cleaner32.exe $(DIR_PROJECT)libs\$(PLATFORM_ABI)\$(LOCAL_MODULE)
10096
Cmd.exe /C adb.exe push $(DIR_PROJECT)libs\$(PLATFORM_ABI)\$(LOCAL_MODULE) /data/local/tmp/$(LOCAL_MODULE)
10197
Cmd.exe /C adb.exe shell /system/bin/chmod 0777 /data/local/tmp/$(LOCAL_MODULE)
10298

CB-Template/templates/wizard/ndk_android/wizard.script renamed to CB-Template/CodeBlocks/templates/wizard/ndk_android/wizard.script

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,22 @@ function GetFilesDir()
137137
// setup the already created project
138138
function SetupProject(project)
139139
{
140+
local util_path = Wizard.FindTemplateFile(_T("ndk_android"));
141+
if (util_path.IsEmpty())
142+
{
143+
ShowWarning(_T("No binary utilites found, install cbp2ndk32.exe and android-elf-cleaner32.exe!"));
144+
return false;
145+
}
146+
140147
project.SetVar(_T("NDK_API"), str_BinApi, false);
141148
project.SetVar(_T("NDK_ABI"), str_BinAbi, false);
142149
project.SetVar(_T("NDK_DIR"), str_NdkPath, false);
143150
project.SetVar(_T("AOSP_DIR"), str_AospPath, false);
151+
project.SetVar(_T("UTIL_DIR"), util_path + _T("/exec"), false);
144152

145153
// Project make & prebuild commands
146-
local pb_cleanbin = _T("android-elf-cleaner.exe $(PROJECT_DIR)libs/") + str_BinAbi + _T("/$(TARGET_OUTPUT_BASENAME)");
147-
local mk_variable = _T("SC_NDK_API=\"") + str_BinApi + _T("\" SC_NDK_ABI=\"") + str_BinAbi + _T("\" SC_NDK_DIR=\"") + str_NdkPath + _T("\"");
154+
local pb_cleanbin = util_path + _T("/exec/android-elf-cleaner32.exe $(PROJECT_DIR)libs/") + str_BinAbi + _T("/$(TARGET_OUTPUT_BASENAME)");
155+
local mk_variable = _T("SC_BIN_PATH=\"") + util_path + _T("\" SC_NDK_API=\"") + str_BinApi + _T("\" SC_NDK_ABI=\"") + str_BinAbi + _T("\" SC_NDK_DIR=\"") + str_NdkPath + _T("\"");
148156
if (!str_AospPath.IsEmpty())
149157
{
150158
mk_variable += _T(" SC_AOSP_DIR=\"") + str_AospPath + _T("\"");
@@ -164,7 +172,6 @@ function SetupProject(project)
164172
project.AddCompilerOption(_T("-Wno-unknown-pragmas"));
165173
project.AddCompilerOption(_T("-fexceptions"));
166174
project.AddCompilerOption(_T("-D__ANDROID_API_PLATFORM__=\"$(TARGET_PLATFORM)\""));
167-
168175
//project.AddLinkerOption(_T("-llog"));
169176
//project.CallHooks(true);
170177

176 KB
Binary file not shown.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
; Script generated by the Inno Script Studio Wizard.
2+
3+
#include "..\..\cbp2ndk\version.h"
4+
5+
[Setup]
6+
AppId={{00A125D3-8122-4ECA-8675-715EE4BF1F82}
7+
AppName=CodeBlocksNdkTemplate
8+
AppVersion={#CBP_FULLVERSION_STRING}
9+
AppVerName="Code::Blocks NDK Template {#CBP_FULLVERSION_STRING}"
10+
AppPublisher=PS
11+
AppPublisherURL=https://clnviewer.github.io/Code-Blocks-Android-NDK/
12+
AppSupportURL=https://clnviewer.github.io/Code-Blocks-Android-NDK/
13+
AppUpdatesURL=https://clnviewer.github.io/Code-Blocks-Android-NDK/
14+
ShowLanguageDialog=auto
15+
CreateAppDir=no
16+
WizardSmallImageFile=autoinstall_0.bmp
17+
WizardSmallImageBackColor=clWhite
18+
WizardImageFile=autoinstall_1.bmp
19+
WizardImageBackColor=clWhite
20+
OutputDir=..\..\docs
21+
OutputBaseFilename=CodeBlocksNdkTemplate
22+
SetupIconFile=autoinstall.ico
23+
InfoAfterFile=autoinstall.rtf
24+
Compression=lzma
25+
SolidCompression=yes
26+
27+
[Languages]
28+
Name: "en"; MessagesFile: "compiler:Default.isl"
29+
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
30+
Name: "cn"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
31+
Name: "cnt"; MessagesFile: "compiler:Languages\ChineseTraditional.isl"
32+
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
33+
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
34+
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
35+
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
36+
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
37+
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
38+
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
39+
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
40+
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
41+
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
42+
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
43+
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
44+
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
45+
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
46+
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
47+
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
48+
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
49+
Name: "swedish"; MessagesFile: "compiler:Languages\Swedish.isl"
50+
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
51+
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
52+
Name: "arabic"; MessagesFile: "compiler:Languages\Arabic.isl"
53+
Name: "korea"; MessagesFile: "compiler:Languages\Korean.isl"
54+
55+
[Files]
56+
Source: "..\CodeBlocks\*"; Check: GetCodeblocksTemplateDestination; DestDir: "{code:TemplateDestination}"; Flags: ignoreversion recursesubdirs createallsubdirs
57+
58+
[Code]
59+
60+
var cbTemplateDest : String;
61+
62+
function GetCodeblocksTemplateDestination(): Boolean;
63+
var
64+
len: Integer;
65+
66+
begin
67+
cbTemplateDest := '';
68+
69+
RegQueryStringValue(HKCU, 'SOFTWARE\CodeBlocks', 'Path', cbTemplateDest);
70+
len := Length(cbTemplateDest);
71+
if len = 0 then
72+
begin
73+
RegQueryStringValue(HKU, 'SOFTWARE\CodeBlocks', 'Path', cbTemplateDest);
74+
len := Length(cbTemplateDest);
75+
end;
76+
77+
if len > 0 then
78+
begin
79+
Insert('/share/CodeBlocks/', cbTemplateDest, len + 1);
80+
end;
81+
Result := len > 0;
82+
end;
83+
84+
function TemplateDestination(Param: String) : String;
85+
begin
86+
Result := cbTemplateDest;
87+
end;
1.52 KB
Binary file not shown.
8.18 KB
Binary file not shown.

0 commit comments

Comments
 (0)