-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (28 loc) · 1.06 KB
/
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
SERVICE := happy-birthday-gdpr
DESTDIR ?= dist_root
SERVICEDIR ?= /srv/$(SERVICE)
GO ?= go
export GOFLAGS ?= -mod=vendor
.PHONY: all
all: happy-birthday-gdpr
happy-birthday-gdpr: $(filter-out bindata.go, $(wildcard *.go)) $(wildcard templates/* static/*) go.mod go.sum
go generate generate.go
go build -o $@
install: all
install -d $(DESTDIR)$(SERVICEDIR)
install -m 644 misc/README.vulnbox $(DESTDIR)$(SERVICEDIR)/README
install -d $(DESTDIR)$(SERVICEDIR)/bin
install happy-birthday-gdpr $(DESTDIR)$(SERVICEDIR)/bin/
install -d $(DESTDIR)/etc/systemd/system
install -m 644 misc/happy-birthday-gdpr-setup.service $(DESTDIR)/etc/systemd/system/
install -m 644 misc/happy-birthday-gdpr.service $(DESTDIR)/etc/systemd/system/
install -d $(DESTDIR)$(SERVICEDIR)/src
install -m 644 misc/Makefile.vulnbox $(DESTDIR)$(SERVICEDIR)/src/Makefile
install -m 644 *.go go.mod go.sum $(DESTDIR)$(SERVICEDIR)/src/
rm $(DESTDIR)$(SERVICEDIR)/src/generate.go
cp -r vendor/ $(DESTDIR)$(SERVICEDIR)/src/
.PHONY: clean
clean:
$(RM) happy-birthday-gdpr
$(RM) bindata.go
$(RM) -r dist_root