206 lines
6.1 KiB
Makefile
206 lines
6.1 KiB
Makefile
|
|
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo
|
|
|
|
SUFFIXES = .go
|
|
OBJEXT= none
|
|
|
|
sbin_PROGRAMS = certmanagerd certmanagerdump certmanagerrestore
|
|
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)
|
|
|
|
certmanagerdump_SOURCES = cmd/certmanagerdump/maindump.go
|
|
certmanagerdump$(EXEEXT): $(certmanagerdump_SOURCES) $(EXTRA_certmanagerd_SOURCES)
|
|
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerdump$(EXEEXT) $(certmanagerdump_SOURCES)
|
|
|
|
certmanagerrestore_SOURCES = cmd/certmanagerrestore/mainrestore.go
|
|
certmanagerrestore$(EXEEXT): $(certmanagerrestore_SOURCES) $(EXTRA_certmanagerd_SOURCES)
|
|
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerrestore$(EXEEXT) $(certmanagerrestore_SOURCES)
|
|
|
|
|
|
certmanagerctl_SOURCES = cmd/certmanagerctl/main.go \
|
|
cmd/certmanagerctl/account.go \
|
|
cmd/certmanagerctl/service.go \
|
|
cmd/certmanagerctl/issuer.go \
|
|
cmd/certmanagerctl/grant.go
|
|
|
|
certmanagerctl$(EXEEXT): $(certmanagerctl_SOURCES) $(EXTRA_certmanagerd_SOURCES)
|
|
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o certmanagerctl$(EXEEXT) $(certmanagerctl_SOURCES)
|
|
|
|
|
|
EXTRA_certmanagerd_SOURCES = \
|
|
internal/config/config.go \
|
|
internal/database/account.go \
|
|
internal/database/database.go \
|
|
internal/database/grant.go \
|
|
internal/database/issuer.go \
|
|
internal/database/service.go \
|
|
internal/descriptor/descriptor.go \
|
|
internal/grpc/handler/account.go \
|
|
internal/grpc/handler/grant.go \
|
|
internal/grpc/handler/handler.go \
|
|
internal/grpc/handler/issuer.go \
|
|
internal/grpc/handler/service.go \
|
|
internal/grpc/handler/status.go \
|
|
internal/grpc/service/service.go \
|
|
internal/logic/account.go \
|
|
internal/logic/database.go \
|
|
internal/logic/grants.go \
|
|
internal/logic/issuer.go \
|
|
internal/logic/logic.go \
|
|
internal/logic/service.go \
|
|
internal/logic/status.go \
|
|
internal/server/server.go \
|
|
internal/test/database_test.go \
|
|
internal/wrpc/handler/handler.go \
|
|
internal/wrpc/handler/status.go \
|
|
internal/wrpc/service/service.go \
|
|
pkg/aux509/x509cert.go \
|
|
pkg/aux509/x509cert_test.go \
|
|
pkg/auxgin/corsmw.go \
|
|
pkg/auxgin/logmw.go \
|
|
pkg/auxgin/reqlog.go \
|
|
pkg/auxgin/reslog.go \
|
|
pkg/auxgrpc/error.go \
|
|
pkg/auxhttp/genres.go \
|
|
pkg/auxhttp/getbearer.go \
|
|
pkg/auxhttp/parseauth.go \
|
|
pkg/auxid/genid.go \
|
|
pkg/client/auth.go \
|
|
pkg/client/client.go \
|
|
pkg/client/control.go \
|
|
pkg/cm509/testchain_a00.crt \
|
|
pkg/cm509/testchain_a01.crt \
|
|
pkg/cm509/testchain_a02.crt \
|
|
pkg/cm509/testchain_a03.crt \
|
|
pkg/cm509/x509.go \
|
|
pkg/cm509/aes256.go \
|
|
pkg/cmctl/cmctl_grpc.pb.go \
|
|
pkg/cmctl/cmctl.pb.go \
|
|
pkg/common/common.go \
|
|
pkg/logger/logger.go
|
|
|
|
EXTRA_DIST = $(EXTRA_certmanagerd_SOURCES) \
|
|
internal/test/auxfunction_test.go \
|
|
internal/test/database_test.go \
|
|
internal/test/logic_issuer_create_test.go \
|
|
internal/test/logic_issuer_import_test.go \
|
|
pkg/aux509/x509cert_test.go \
|
|
pkg/cm509/x509_test.go \
|
|
pkg/cm509/aes256_test.go \
|
|
internal/test/testchain_a00.crt \
|
|
internal/test/testchain_a01.crt \
|
|
internal/test/testchain_a02.crt \
|
|
internal/test/testchain_a03.crt \
|
|
pkg/cm509/testchain_a00.crt \
|
|
pkg/cm509/testchain_a01.crt \
|
|
pkg/cm509/testchain_a02.crt \
|
|
pkg/cm509/testchain_a03.crt \
|
|
internal/test/testchain_a00.key \
|
|
etc/certmanager/certmanagerd.yaml \
|
|
proto/cmctl.proto \
|
|
README.md \
|
|
internal/test/Makefile.in \
|
|
debian/changelog \
|
|
debian/compat \
|
|
debian/control \
|
|
debian/patches/series \
|
|
debian/postinst \
|
|
debian/postrm \
|
|
debian/preinst \
|
|
debian/prerm \
|
|
debian/README.Debian \
|
|
debian/rules \
|
|
debian/source/format \
|
|
debian/source/include-binaries \
|
|
debian/watch
|
|
|
|
GENDIR=pkg/cmctl
|
|
grpc:
|
|
mkdir -p $(GENDIR)
|
|
protoc --proto_path=proto --go_out=$(GENDIR) --go-grpc_out=$(GENDIR) proto/cmctl.proto
|
|
|
|
SYSTEMD_LIBDIR = /lib/systemd/system
|
|
|
|
FREEBSD_LOCALBASE = /usr/local
|
|
FREEBSD_RCDIR = $(FREEBSD_LOCALBASE)/etc/rc.d
|
|
LINUX_SYSTEMDDIR = /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)
|
|
if FREEBSD_OS
|
|
test -z $(DESTDIR)$(FREEBSD_RCDIR) || $(MKDIR_P) $(DESTDIR)$(FREEBSD_RCDIR)
|
|
$(INSTALL_DATA) initrc/certmanagerd $(DESTDIR)$(FREEBSD_RCDIR)
|
|
chmod a+x $(DESTDIR)$(FREEBSD_RCDIR)/certmanagerd
|
|
endif
|
|
if LINUX_OS
|
|
if SYSTEMD
|
|
test -z $(DESTDIR)$(LINUX_SYSTEMDDIR) || $(MKDIR_P) $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
|
$(INSTALL_DATA) initrc/certmanagerd.service $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
|
endif
|
|
endif
|
|
|
|
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
|
|
|
|
|
|
BUILD_DIR = $(shell pwd)/tmp
|
|
|
|
dpkg: package
|
|
$(DIST_ARCHIVES): dist
|
|
package: $(DIST_ARCHIVES)
|
|
mkdir -p $(BUILD_DIR)
|
|
mv $(DIST_ARCHIVES) $(BUILD_DIR)
|
|
cd $(BUILD_DIR) && $(AMTAR) -xf $(DIST_ARCHIVES)
|
|
cd $(BUILD_DIR)/$(distdir) && \
|
|
./configure --enable-devel-mode
|
|
cd $(BUILD_DIR)/$(distdir) && \
|
|
$(MAKE) debian-package
|
|
|
|
debian-package:
|
|
$(DBUILDPACKAGE) -us -uc -ui -i -b
|
|
|
|
debian-package-clean:
|
|
$(DBUILDPACKAGE) --rules-target clean -us -uc -ui
|
|
|
|
TOPDIR= $(shell pwd)/tmp/sysagent-build
|
|
rpm: dist-gzip
|
|
$(MKDIR_P) $(TOPDIR)/SOURCES
|
|
mv -v $(distdir).tar.gz $(TOPDIR)/SOURCES
|
|
$(RPMBUILD) --define "_topdir $(TOPDIR)" -v --noclean -ba $(PACKAGE_NAME).spec
|
|
|
|
|
|
|
|
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/
|
|
rm -f $(DIST_ARCHIVES)
|
|
rm -rf autom4te.cache/
|
|
|