Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
be5be108
Commit
be5be108
authored
May 19, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build all
parent
c9ca42aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
build.py
build.py
+13
-8
No files found.
build.py
View file @
be5be108
...
@@ -95,10 +95,15 @@ def collect_binary():
...
@@ -95,10 +95,15 @@ def collect_binary():
def
build_binary
(
args
):
def
build_binary
(
args
):
# If nothing specified, build everything
# If nothing specified, build everything
if
len
(
args
.
target
)
==
0
:
try
:
args
.
target
=
[
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'busybox'
,
'b64xz'
]
targets
=
args
.
target
except
:
targets
=
[]
if
len
(
targets
)
==
0
:
targets
=
[
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'busybox'
,
'b64xz'
]
header
(
'* Building binaries: '
+
' '
.
join
(
args
.
target
))
header
(
'* Building binaries: '
+
' '
.
join
(
targets
))
# Force update logging.h timestamp to trigger recompilation for the flags to make a difference
# Force update logging.h timestamp to trigger recompilation for the flags to make a difference
os
.
utime
(
os
.
path
.
join
(
'native'
,
'jni'
,
'include'
,
'logging.h'
))
os
.
utime
(
os
.
path
.
join
(
'native'
,
'jni'
,
'include'
,
'logging.h'
))
...
@@ -107,7 +112,7 @@ def build_binary(args):
...
@@ -107,7 +112,7 @@ def build_binary(args):
base_flags
=
'MAGISK_VERSION=
\"
{}
\"
MAGISK_VER_CODE={} MAGISK_DEBUG={}'
.
format
(
config
[
'version'
],
config
[
'versionCode'
],
base_flags
=
'MAGISK_VERSION=
\"
{}
\"
MAGISK_VER_CODE={} MAGISK_DEBUG={}'
.
format
(
config
[
'version'
],
config
[
'versionCode'
],
''
if
args
.
release
else
'-DMAGISK_DEBUG'
)
''
if
args
.
release
else
'-DMAGISK_DEBUG'
)
if
'magisk'
in
args
.
target
:
if
'magisk'
in
targets
:
# Magisk is special case as it is a dependency of magiskinit
# Magisk is special case as it is a dependency of magiskinit
proc
=
subprocess
.
run
(
'{} -C native {} B_MAGISK=1 -j{}'
.
format
(
ndk_build
,
base_flags
,
cpu_count
),
shell
=
True
)
proc
=
subprocess
.
run
(
'{} -C native {} B_MAGISK=1 -j{}'
.
format
(
ndk_build
,
base_flags
,
cpu_count
),
shell
=
True
)
if
proc
.
returncode
!=
0
:
if
proc
.
returncode
!=
0
:
...
@@ -117,11 +122,11 @@ def build_binary(args):
...
@@ -117,11 +122,11 @@ def build_binary(args):
old_platform
=
False
old_platform
=
False
flags
=
base_flags
flags
=
base_flags
if
'busybox'
in
args
.
target
:
if
'busybox'
in
targets
:
flags
+=
' B_BB=1'
flags
+=
' B_BB=1'
old_platform
=
True
old_platform
=
True
if
'b64xz'
in
args
.
target
:
if
'b64xz'
in
targets
:
flags
+=
' B_BXZ=1'
flags
+=
' B_BXZ=1'
old_platform
=
True
old_platform
=
True
...
@@ -134,7 +139,7 @@ def build_binary(args):
...
@@ -134,7 +139,7 @@ def build_binary(args):
other
=
False
other
=
False
flags
=
base_flags
flags
=
base_flags
if
'magiskinit'
in
args
.
target
:
if
'magiskinit'
in
targets
:
# We need to create dump.h beforehand
# We need to create dump.h beforehand
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
'native'
,
'out'
,
'armeabi-v7a'
,
'magisk'
)):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
'native'
,
'out'
,
'armeabi-v7a'
,
'magisk'
)):
error
(
'Build "magisk" before building "magiskinit"'
)
error
(
'Build "magisk" before building "magiskinit"'
)
...
@@ -148,7 +153,7 @@ def build_binary(args):
...
@@ -148,7 +153,7 @@ def build_binary(args):
flags
+=
' B_INIT=1'
flags
+=
' B_INIT=1'
other
=
True
other
=
True
if
'magiskboot'
in
args
.
target
:
if
'magiskboot'
in
targets
:
flags
+=
' B_BOOT=1'
flags
+=
' B_BOOT=1'
other
=
True
other
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment