working commit
This commit is contained in:
+119
@@ -0,0 +1,119 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign no-dependencies no-installinfo
|
||||
|
||||
SUFFIXES = .go
|
||||
OBJEXT= none
|
||||
|
||||
|
||||
sbin_PROGRAMS = mbased mbasedump mbaserestore mbaseadmin
|
||||
bin_PROGRAMS = mbasectl
|
||||
|
||||
mbased_SOURCES = cmd/mbased/main.go
|
||||
mbased$(EXEEXT): $(mbased_SOURCES) $(EXTRA_mbased_SOURCES)
|
||||
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mbased$(EXEEXT) $(mbased_SOURCES)
|
||||
|
||||
mbasedump_SOURCES = cmd/mbasedump/maindump.go
|
||||
mbasedump$(EXEEXT): $(mbasedump_SOURCES) $(EXTRA_mbased_SOURCES)
|
||||
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mbasedump$(EXEEXT) $(mbasedump_SOURCES)
|
||||
|
||||
mbaserestore_SOURCES = cmd/mbaserestore/mainrestore.go
|
||||
mbaserestore$(EXEEXT): $(mbaserestore_SOURCES) $(EXTRA_mbased_SOURCES)
|
||||
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mbaserestore$(EXEEXT) $(mbaserestore_SOURCES)
|
||||
|
||||
mbasectl_SOURCES = cmd/mbasectl/main.go \
|
||||
cmd/mbasectl/account.go \
|
||||
cmd/mbasectl/grant.go \
|
||||
cmd/mbasectl/dump.go
|
||||
|
||||
|
||||
mbasectl$(EXEEXT): $(mbasectl_SOURCES) $(EXTRA_mbased_SOURCES)
|
||||
env CGO_ENABLED=0 $(GO) build $(GOFLAGS) -o mbasectl$(EXEEXT) $(mbasectl_SOURCES)
|
||||
|
||||
mbaseadmin_SOURCES = cmd/mbaseadmin/main.go \
|
||||
cmd/mbaseadmin/account.go \
|
||||
cmd/mbaseadmin/grant.go
|
||||
|
||||
mbaseadmin$(EXEEXT): $(mbaseadmin_SOURCES) $(EXTRA_mbased_SOURCES)
|
||||
env CGO_ENABLED=1 $(GO) build $(GOFLAGS) -o mbaseadmin$(EXEEXT) $(mbaseadmin_SOURCES)
|
||||
|
||||
EXTRA_mbased_SOURCES =
|
||||
|
||||
EXTRA_DIST = \
|
||||
Changelog.txt \
|
||||
Containerfile \
|
||||
etc/mbase/mbased.yaml \
|
||||
.gitignore \
|
||||
go.mod \
|
||||
go.sum \
|
||||
proto/cmctl.proto \
|
||||
README.md \
|
||||
test/account_test.go \
|
||||
test/dump_test.go \
|
||||
test/hello_test.go \
|
||||
test/Makefile.am \
|
||||
test/Makefile.in \
|
||||
test/server.go \
|
||||
test/support.go \
|
||||
vendor/*
|
||||
|
||||
GENDIR=pkg/mbctl
|
||||
PROTOSRC = proto/mbctl.proto
|
||||
|
||||
rpc:
|
||||
mkdir -p $(GENDIR)
|
||||
$(PROTOC) --proto_path=proto --go_out=$(GENDIR) --go-grpc_out=$(GENDIR) $(PROTOSRC)
|
||||
|
||||
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/mbased $(DESTDIR)$(FREEBSD_RCDIR)
|
||||
chmod a+x $(DESTDIR)$(FREEBSD_RCDIR)/mbased
|
||||
endif
|
||||
if LINUX_OS
|
||||
if SYSTEMD
|
||||
test -z $(DESTDIR)$(LINUX_SYSTEMDDIR) || $(MKDIR_P) $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
||||
$(INSTALL_DATA) initrc/mbased.service $(DESTDIR)$(LINUX_SYSTEMDDIR)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
format:
|
||||
for dir in $$(find app 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/mbased/... --daemon=false
|
||||
|
||||
|
||||
distclean-local: clean
|
||||
rm -rf autom4te.cache
|
||||
|
||||
clean-local:
|
||||
rm -f */*/*~
|
||||
rm -f */*~
|
||||
rm -f *~
|
||||
rm -f cmd/mbaseadmin/mbaseadmin
|
||||
rm -f cmd/mbasectl/mbasectl
|
||||
rm -f cmd/mbased/mbased
|
||||
rm -f cmd/mbasedump/mbasedump
|
||||
rm -f cmd/mbaselocal/mbaselocal
|
||||
rm -f cmd/mbaserestore/mbaserestore
|
||||
rm -rf autom4te.cache
|
||||
rm -rf tmp/
|
||||
|
||||
Reference in New Issue
Block a user