-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (35 loc) · 960 Bytes
/
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
#
# Makefile
# srm - https://github.com/WestleyR/srm
#
# Created by WestleyR on July 28, 2020
# Source code: https://github.com/WestleyR/srm
#
# Copyright (c) 2020-2021 WestleyR. All rights reserved.
# This software is licensed under a BSD 3-Clause Clear License.
# Consult the LICENSE file that came with this software regarding
# your rights to distribute this software.
#
PREFIX = /usr/local
TARGET = srm
VERSION = $(shell git describe --tags --always)
GO = go
GOFLAGS = -ldflags "-w -X github.com/WestleyR/srm/cmd/srm.Version=$(VERSION)"
SRC = $(shell find $(SOURCEDIR) ./ -name '*.go')
.PHONY:
all: $(TARGET)
.PHONY:
$(TARGET): $(SRC)
$(GO) build $(GOFLAGS)
test: $(TARGET)
@bash ./run-tests
install: $(TARGET)
mkdir -p $(PREFIX)/bin
cp -f $(TARGET) $(PREFIX)/bin
package: $(TARGET)
TARGET_VERSION=$(shell ./srm --version) ./package.sh
clean:
rm -f $(TARGET)
rm -rf binaries
uninstall: $(PREFIX)/$(TARGET)
rm -f $(PREFIX)/$(TARGET)