加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Makefile 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
谢志鹏 提交于 2020-03-20 01:39 . prepare for v0.2 release
VERSION = 0.2
.PHONY: all clean modules
PKGPATH=pkg
CURDIR=$(shell pwd)
PREFIX ?= /usr
LIBEXEC ?= libexec
BINDIR = $(DESTDIR)$(PREFIX)/bin
SYSTEMDDIR = $(DESTDIR)$(PREFIX)/lib/systemd/system
SRCVERSION = $(shell git rev-parse --short HEAD 2>/dev/null)
ATUNEVERSION = $(VERSION)$(if $(SRCVERSION),($(SRCVERSION)))
GOLDFLAGS += -X atune/common/config.Version=$(ATUNEVERSION)
GOFLAGS = -ldflags "$(GOLDFLAGS)"
all: modules atune-adm atuned db
atune-adm:
export GOPATH=`cd ../../;pwd` && go build -v $(GOFLAGS) -o $(PKGPATH)/atune-adm cmd/atune-adm/*.go
atuned:
export GOPATH=`cd ../../;pwd` && go build -v $(GOFLAGS) -o $(PKGPATH)/atuned cmd/atuned/*.go
modules:
export GOPATH=`cd ../../;pwd` && cd ${CURDIR}/modules/server/profile/ && go build -buildmode=plugin -o ${CURDIR}/pkg/daemon_profile_server.so *.go
clean:
rm -rf $(PKGPATH)/*
db:
sqlite3 database/atuned.db ".read database/init.sql"
install:
@echo "BEGIN INSTALL A-Tune"
mkdir -p $(BINDIR)
mkdir -p $(SYSTEMDDIR)
mkdir -p $(DESTDIR)/etc/atuned/tuning
mkdir -p $(DESTDIR)$(PREFIX)/lib/atuned/modules
mkdir -p $(DESTDIR)$(PREFIX)/share/atuned
mkdir -p $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/scripts
mkdir -p $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/analysis
mkdir -p $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/collector
mkdir -p $(DESTDIR)/var/lib/atuned
mkdir -p $(DESTDIR)/var/run/atuned
mkdir -p $(DESTDIR)$(PREFIX)/share/bash-completion/completions
install -m 640 pkg/daemon_profile_server.so $(DESTDIR)$(PREFIX)/lib/atuned/modules
install -m 750 pkg/atune-adm $(BINDIR)
install -m 750 pkg/atuned $(BINDIR)
install -m 640 misc/atuned.service $(SYSTEMDDIR)
install -m 640 misc/atuned.cnf $(DESTDIR)/etc/atuned/
install -m 640 database/atuned.db $(DESTDIR)/var/lib/atuned/
install -m 640 misc/atune-adm $(DESTDIR)$(PREFIX)/share/bash-completion/completions/
\cp -rf scripts/* $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/scripts/
chmod -R 750 $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/scripts/
\cp -rf analysis/* $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/analysis/
chmod -R 750 $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/analysis/
\cp -rf collection/* $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/collector/
chmod -R 750 $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/collector/
@echo "END INSTALL A-Tune"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化