-
Notifications
You must be signed in to change notification settings - Fork 455
/
Makefile
54 lines (44 loc) · 1.88 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
USE_VENDOR_CMD := 0
ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
all: libs/armeabi/nexutil
else
all: nexutil
endif
ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
libs/armeabi/nexutil: Android.mk nexutil.c ../libargp/local/armeabi/libargp.a ../libnexio/local/armeabi/libnexio.a FORCE
touch nexutil.c
$(NDK_ROOT)/ndk-build NDK_APPLICATION_MK=`pwd`/Application.mk NDK_APP_OUT=. TARGET_PLATFORM=android-21 GIT_VERSION=$(GIT_VERSION)
else
nexutil: nexutil.c ../libnexio/libnexio.a FORCE
ifeq ($(USE_VENDOR_CMD),1)
gcc -static -o nexutil nexutil.c bcmwifi_channels.c b64-encode.c b64-decode.c -DUSE_VENDOR_CMD -DBUILD_ON_RPI -DVERSION=\"$(GIT_VERSION)\" -I. -I../../patches/include -I../libnexio -L../libnexio/ -lnexio -I../libargp $(shell pkg-config --cflags --libs libnl-3.0 libnl-genl-3.0) -lpthread
else
gcc -static -o nexutil nexutil.c bcmwifi_channels.c b64-encode.c b64-decode.c -DBUILD_ON_RPI -DVERSION=\"$GIT_VERSION\" -DUSE_NETLINK -I. -I../../patches/include -I../libnexio -L../libnexio/ -lnexio -I../libargp
endif
endif
../libargp/local/armeabi/libargp.a: FORCE
cd ../libargp && make
../libnexio/local/armeabi/libnexio.a: FORCE
cd ../libnexio && make
../libnexio/libnexio.a: FORCE
cd ../libnexio && make
ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
install: libs/armeabi/nexutil
adb push $< /sdcard/
adb shell 'su -c "mount -o rw,remount /system"'
adb shell 'su -c "cp /sdcard/nexutil /system/bin/nexutil"'
adb shell 'su -c "chmod +x /system/bin/nexutil"'
install64: libs/arm64-v8a/nexutil
adb push $< /sdcard/
adb shell 'su -c "mount -o rw,remount /system"'
adb shell 'su -c "cp /sdcard/nexutil /system/bin/nexutil"'
adb shell 'su -c "chmod +x /system/bin/nexutil"'
else
install: nexutil
cp $< /usr/bin/
endif
clean:
rm -Rf libs
rm -Rf local
FORCE: