Skip to content

Commit

Permalink
添加 Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianqin committed Apr 13, 2023
1 parent 04a1d72 commit d0d62f8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
BINARY := openai-wechat
LDFLAGS := -ldflags "-w -s"
ENV :=

build:
[ -n "${ENV}" ] && export ${ENV}; \
go build -o ${BINARY} ${LDFLAGS} ./; \

linux-env:
$(eval ENV := CGO_ENABLED=0 GOOS=linux GOARCH=amd64)
linux: linux-env build


windows-env:
$(eval ENV := CGO_ENABLED=0 GOOS=windows GOARCH=arm64)

windows : windows-env build

clean:
rm -f "${BINARY}"

.PHONY: clean
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
支持 Linux、MacOS、Windows 系统(可在Linux服务器上长期运行),不需安装安装任何环境,如果是本地运行,需要安装golang

## 命令使用教程
- openai-wechat start 启动应用
- openai-wechat start -d 后台启动引用
- openai-wechat --config config.yaml start -d 指定配置文件启动
- openai-wechat status 查看应用启动情况
- openai-wechat stop 关闭应用
- openai-wechat restart 重启应用
- ./openai-wechat(文件名) start 启动应用
- ./openai-wechat(文件名) start -d 后台启动引用
- ./openai-wechat(文件名) --config config/config.yaml start -d 指定配置文件启动
- ./openai-wechat(文件名) status 查看应用启动情况
- ./openai-wechat(文件名) stop 关闭应用
- ./openai-wechat(文件名) restart 重启应用

0 comments on commit d0d62f8

Please sign in to comment.