67 lines
2.1 KiB
Makefile
67 lines
2.1 KiB
Makefile
|
|
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo
|
|
|
|
SUFFIXES = .go
|
|
OBJEXT= none
|
|
|
|
sbin_PROGRAMS = certmanagerd
|
|
bin_PROGRAMS = certmanagerctl
|
|
|
|
BUILD = $(shell date -u '+%Y-%m-%d-%H%M')
|
|
GOFLAGS = -v -ldflags='-s -w -X helmet/certmanager/internal/config.buildVersion=$(BUILD)'
|
|
|
|
certmanagerd_SOURCES = cmd/certmanagerd/main.go
|
|
certmanagerd$(EXEEXT): $(certmanagerd_SOURCES) $(EXTRA_certmanagerd_SOURCES)
|
|
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerd$(EXEEXT) $(certmanagerd_SOURCES)
|
|
|
|
|
|
certmanagerctl_SOURCES = cmd/certmanagerctl/main.go \
|
|
cmd/certmanagerctl/servicecli.go \
|
|
cmd/certmanagerctl/issuercli.go
|
|
|
|
certmanagerctl$(EXEEXT): $(certmanagerctl_SOURCES) $(EXTRA_certmanagerd_SOURCES)
|
|
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerctl$(EXEEXT) $(certmanagerctl_SOURCES)
|
|
|
|
|
|
EXTRA_certmanagerd_SOURCES =
|
|
|
|
EXTRA_DIST = $(EXTRA_certmanagerd_SOURCES)
|
|
|
|
GENDIR=api/certmanagercontrol
|
|
grpc:
|
|
mkdir -p $(GENDIR)
|
|
protoc --proto_path=proto --go_out=$(GENDIR) --go-grpc_out=$(GENDIR) proto/certmanagercontrol.proto
|
|
|
|
SYSTEMD_LIBDIR = /lib/systemd/system
|
|
|
|
install-data-local:
|
|
test -z $(DESTDIR)$(SRV_CONFDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_CONFDIR)
|
|
test -z $(DESTDIR)$(SRV_LOGDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_LOGDIR)
|
|
test -z $(DESTDIR)$(SRV_RUNDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_RUNDIR)
|
|
test -z $(DESTDIR)$(SRV_DATADIR) || $(MKDIR_P) $(DESTDIR)$(SRV_DATADIR)
|
|
test -z $(DESTDIR)$(SYSTEMD_LIBDIR) || $(MKDIR_P) $(DESTDIR)$(SYSTEMD_LIBDIR)
|
|
$(INSTALL_DATA) initrc/certmanagerd.service $(DESTDIR)$(SYSTEMD_LIBDIR)
|
|
|
|
|
|
goformat: gformat
|
|
gformat:
|
|
for dir in $$(find internal pkg cmd -type d); do \
|
|
(cd $$dir && $(GO) fmt .); \
|
|
done
|
|
|
|
run:
|
|
test -z $(DESTDIR)$(SRV_LOGDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_LOGDIR)
|
|
test -z $(DESTDIR)$(SRV_RUNDIR) || $(MKDIR_P) $(DESTDIR)$(SRV_RUNDIR)
|
|
test -z $(DESTDIR)$(SRV_DATADIR) || $(MKDIR_P) $(DESTDIR)$(SRV_DATADIR)
|
|
env CGO_ENABLED=1 $(GO) run $(GOFLAGS) ./cmd/certmanagerd/... --daemon=false
|
|
|
|
distclean-local: clean
|
|
rm -rf autom4te.cache
|
|
|
|
clean-local:
|
|
rm -rf autom4te.cache
|
|
rm -f cmd/certmanagerd/certmanagerd
|
|
rm -f cmd/certmanagerctl/certmanagerctl
|
|
rm -rf tmp.*/
|
|
|