-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 848 Bytes
/
Makefile
File metadata and controls
34 lines (25 loc) · 848 Bytes
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
PACKAGE_NAME:=prometheus-cgroup-exporter
VERSION?=0.0.0
ARCH?=amd64
all: test build
test:
go-bin-deb test
deb:
ARCH=amd64 make ${PACKAGE_NAME}_amd64.deb
ARCH=arm64 make ${PACKAGE_NAME}_arm64.deb
${PACKAGE_NAME}_${ARCH}.deb: ${PACKAGE_NAME}_${VERSION}_${ARCH}.deb
${PACKAGE_NAME}_${VERSION}_${ARCH}.deb: deb.json systemd/* $(APP_RESOURCES) build/${ARCH}/cgroup-exporter
rm -rf pkg-build
go-bin-deb generate --arch ${ARCH} --version ${VERSION}
clean:
rm -rf build
rm -rf pkg-build
rm -f ${PACKAGE_NAME}_*.deb
install:
sudo dpkg -i ${PACKAGE_NAME}_${VERSION}_${ARCH}.deb
uninstall:
sudo dpkg -r ${PACKAGE_NAME}
build: build/${ARCH}/cgroup-exporter
build/${ARCH}/cgroup-exporter: deb.json
@rm -rf build/${ARCH} && mkdir -p build/${ARCH}
GOARCH=${ARCH} go build -o $@ -ldflags "-X main.version=${VERSION} -X main.git=${GIT_HASH}" .