Skip to content

Commit

Permalink
支持黑版
Browse files Browse the repository at this point in the history
  • Loading branch information
qlwz committed Jan 10, 2020
1 parent 212b17a commit 9c3aa4f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
obj
xiaoaimqtt
xiaoaimqtt
xiaoaimqtt.back
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
## 如何安装

### 黑版小爱 (文件系统可读写)
1. 现在xiaoaimqtt文件放在 /data下
1. 下载xiaoaimqtt.back文件放在 /data下
2. 添加并编辑该文件/etc/init.d/mico_enable

```
#!/bin/sh /etc/rc.common
START=96
start() {
/data/xiaoaimqtt &
/data/xiaoaimqtt.back &
}
stop() {
kill `ps|grep '/data/xiaoaimqtt'|grep -v grep|awk '{print \$1}'`
kill `ps|grep '/data/xiaoaimqtt.back'|grep -v grep|awk '{print \$1}'`
}
```

3. 设置权限在 shell下执行
chmod a+x /data/xiaoaimqtt
chmod a+x /data/xiaoaimqtt.back
chmod a+x /etc/init.d/mico_enable
/etc/init.d/mico_enable enable
/etc/init.d/mico_enable start
Expand Down Expand Up @@ -80,11 +80,27 @@
# 如何编译

## Linux
绿板(makefile默认)
1. 参照:https://www.cnblogs.com/flyinggod/p/9468612.html 配置环境
2. 然后进入目录 make

黑版
请下载 https://www.veryarm.com/aarch64-linux-gnu-gcc

## Windows
绿板(makefile默认)
1.https://blog.csdn.net/lg1259156776/article/details/52281323 里面下载Windows安装版
2. 安装 MinGW
3. 配置好 make.exe 和 arm-linux-gnueabihf-gcc.exe
4. 然后进入目录 make
4. 然后进入目录 make

黑版
请下载 https://www.veryarm.com/aarch64-linux-gnu-gcc

## 黑版编译
makefile默认是绿板的,黑版的需要在makefile去掉以下注释
```
#DIR_LIB=./lib.back
#CCFILE=aarch64-linux-gnu-gcc
#TARGET=xiaoaimqtt.back
```
Binary file added lib.back/libcrypto.so
Binary file not shown.
Binary file added lib.back/libssl.so
Binary file not shown.
14 changes: 10 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ DIR_SRC=./src
DIR_BIN=.
DIR_OBJ=./obj
DIR_LIB=./lib
CCFILE=arm-linux-gnueabihf-gcc
TARGET=xiaoaimqtt

# 下面黑版编译
#DIR_LIB=./lib.back
#CCFILE=aarch64-linux-gnu-gcc
#TARGET=xiaoaimqtt.back

#sources_all := $(shell find . -name "*.c" -o -name "*.cpp" -o -name "*.h")
#sources_c := $(filter %.c, $(sources_all))
Expand All @@ -25,14 +32,13 @@ SRC=$(sources_c)
CLRDIR=$(notdir ${SRC})
OBJ=$(patsubst %.c,${DIR_OBJ}/%.o,$(CLRDIR))

CC =arm-linux-gnueabihf-gcc
LD =arm-linux-gnueabihf-gcc
CC=${CCFILE}
LD=${CCFILE}

LDFLAGS = -v -lgcc -lstdc++ -lm -lc -lgcc_s
LDFLAGS = -v -lgcc -lm -lc -lgcc_s

LDFLAGS += -L${DIR_LIB} -Wl,-rpath,`pwd`/${DIR_LIB} -lssl -lcrypto

TARGET=xiaoaimqtt

BIN_TARGET=${DIR_BIN}/${TARGET}

Expand Down

0 comments on commit 9c3aa4f

Please sign in to comment.