Skip to content

Commit 865af75

Browse files
committed
Makefile,Golang*mk: migrating to v0.2.0 build system
1 parent ca67962 commit 865af75

File tree

5 files changed

+50
-40
lines changed

5 files changed

+50
-40
lines changed

Golang.cdk.mk

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
GOLANG_MAKEFILE_KEYS += CDK
17+
MAKEFILE_KEYS += GOLANG_CDK
18+
GOLANG_CDK_MK_FILE := Golang.cdk.mk
19+
GOLANG_CDK_MK_VERSION := v0.2.0
20+
GOLANG_CDK_MK_DESCRIPTION := go-curses support
1821

19-
GOLANG_CDK_MK_VERSION := v0.1.2
22+
CDK_GO_PACKAGE ?= github.com/go-curses/cdk
23+
CDK_LOCAL_PATH ?= ../cdk
24+
25+
CTK_GO_PACKAGE ?= github.com/go-curses/ctk
26+
CTK_LOCAL_PATH ?= ../ctk
2027

2128
CUSTOM_HELP_SECTIONS += CDK_HELP
2229

Golang.def.mk

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
GOLANG_MAKEFILE_KEYS += DEF
18-
GOLANG_DEF_MK_VERSION := v0.1.5
17+
MAKEFILE_KEYS += GOLANG_DEF
18+
GOLANG_DEF_MK_FILE := Golang.def.mk
19+
GOLANG_DEF_MK_VERSION := v0.2.0
20+
GOLANG_DEF_MK_DESCRIPTION := make target definitions
1921

20-
.PHONY: all help
22+
.PHONY: help
2123
.PHONY: clean distclean realclean
2224
.PHONY: local unlocal deps tidy fmt be-update generate
2325
.PHONY: debug build build-all build-amd64 build-arm64
@@ -34,20 +36,20 @@ ifeq (${INCLUDE_DEFAULT_AUTOCOMPLETE_FILE},true)
3436
AUTOCOMPLETE_FILES += ${INSTALL_AUTOCOMPLETE_PATH}/${BIN_NAME}
3537
endif
3638

37-
all: help
38-
3939
help:
4040
@echo "usage: make [target]"
4141
@echo
4242
@echo "golang qa targets:"
4343
@echo " test - perform all available tests"
4444
@echo " coverage - generate coverage reports"
45+
@echo " goconvey - start goconvey http://${GOCONVEY_HOST}:${GOCONVEY_PORT}"
4546
@echo " reportcard - run sanity checks"
4647

4748
@echo
4849
@echo "cleanup targets:"
49-
@echo " clean - cleans package and built files"
50-
@echo " distclean - clean and removes extraneous files"
50+
@echo " clean - removes CLEAN_FILES (${CLEAN_FILES})"
51+
@echo " distclean - clean and DISTCLEAN_FILES (${DISTCLEAN_FILES})"
52+
@echo " realclean - distclean REALCLEAN_FILES (${REALCLEAN_FILES})"
5153

5254
@echo
5355
@echo "build targets:"
@@ -69,11 +71,10 @@ help:
6971
@echo " install - installs ${BUILD_NAME} to ${DESTDIR}${prefix}/bin/${BIN_NAME}"
7072
@echo " install-arm64 - installs ${BIN_NAME}.${BUILD_OS}.arm64 to ${DESTDIR}${prefix}/bin/${BIN_NAME}"
7173
@echo " install-amd64 - installs ${BIN_NAME}.${BUILD_OS}.amd64 to ${DESTDIR}${prefix}/bin/${BIN_NAME}"
72-
7374
ifneq (${AUTOCOMPLETE_FILES},)
74-
@echo
75-
@echo "extra install targets:"
76-
@echo " install-autocomplete - installs ${SRC_AUTOCOMPLETE_FILE} to ${AUTOCOMPLETE_FILES}"
75+
@echo " install-autocomplete"
76+
@echo " - installs ${SRC_AUTOCOMPLETE_FILE} to:"
77+
@$(foreach dst,${AUTOCOMPLETE_FILES},echo " $(dst)";)
7778
endif
7879

7980
ifdef help_custom_targets
@@ -99,13 +100,18 @@ $(foreach key,$($(section)_KEYS),; echo " $($(section)_$(key)_TARGET) - $($(sec
99100
@echo " be-update - get latest GOPKG_KEYS dependencies"
100101

101102
@echo
102-
@echo "Notes:"
103-
@echo " GOPKG_KEYS are go packages managed by this Makefile and the following"
104-
@echo " are the included packages:" \
105-
$(if ${GOPKG_KEYS},$(foreach key,${GOPKG_KEYS},; echo " $(key): $($(key)_GO_PACKAGE) ($($(key)_LOCAL_PATH))"))
106-
107-
@echo $(foreach key,${GOLANG_MAKEFILE_KEYS},$(shell \
108-
echo ";echo \"Golang.$(shell perl -e 'print lc("$(key)");').mk: $(GOLANG_$(key)_MK_VERSION)\"" \
103+
@echo "build system details:"
104+
@echo
105+
@printf " %-15s %-40s %s\n" GOPKG_KEYS GO_PACKAGE LOCAL_PATH
106+
@printf " %-15s %-40s %s\n" ---------- ---------- ----------
107+
@$(foreach key,${GOPKG_KEYS},$(shell \
108+
echo "printf \" %-15s %-40s %s\\n\" \"$(key)\" \"$($(key)_GO_PACKAGE)\" \"$($(key)_LOCAL_PATH)\";" \
109+
))
110+
@echo
111+
@printf " %-20s %-10s %s\n" MAKEFILE VERSION DESCRIPTION
112+
@printf " %-20s %-10s %s\n" -------- ------- -----------
113+
@$(foreach key,${MAKEFILE_KEYS},$(shell \
114+
echo "printf \" %-20s %-10s %-10s\\n\" \"$($(key)_MK_FILE)\" \"$($(key)_MK_VERSION)\" \"$($(key)_MK_DESCRIPTION)\";" \
109115
))
110116

111117
clean:

Golang.lib.mk

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,10 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
GOLANG_MAKEFILE_KEYS += LIB
18-
GOLANG_LIB_MK_VERSION := v0.1.4
19-
20-
#
21-
#: Go-Curses Packages
22-
#
23-
24-
CDK_GO_PACKAGE ?= github.com/go-curses/cdk
25-
CDK_LOCAL_PATH ?= ../cdk
26-
27-
CTK_GO_PACKAGE ?= github.com/go-curses/ctk
28-
CTK_LOCAL_PATH ?= ../ctk
17+
MAKEFILE_KEYS += GOLANG_LIB
18+
GOLANG_LIB_MK_FILE := Golang.lib.mk
19+
GOLANG_LIB_MK_VERSION := v0.2.0
20+
GOLANG_LIB_MK_DESCRIPTION := go-corelibs support
2921

3022
#
3123
#: Core Library Packages

Golang.cmd.mk renamed to Golang.mk

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
GOLANG_MAKEFILE_KEYS += CMD
18-
GOLANG_CMD_MK_VERSION := v0.1.11
17+
MAKEFILE_KEYS += GOLANG
18+
GOLANG_MK_FILE := Golang.mk
19+
GOLANG_MK_VERSION := v0.2.0
20+
GOLANG_MK_DESCRIPTION := globals, functions and internal targets
1921

20-
.PHONY: __golang __tidy __local __unlocal __be_update
21-
.PHONY: __vet __test __cover __generate
22+
.PHONY: __golang __deps __generate
23+
.PHONY: __vet __test __coverage
24+
.PHONY: __tidy __fmt __reportcard
25+
.PHONY: __local __unlocal __be_update
2226

2327
PWD := $(shell pwd)
2428
SHELL := /bin/bash
@@ -66,6 +70,8 @@ endif
6670
_INTERNAL_BUILD_LOG_ ?= /dev/null
6771

6872
-include Golang.lib.mk
73+
-include Golang.cdk.mk
74+
-include Golang.def.mk
6975

7076
_BUILD_TAGS ?= $(call __build_tags)
7177

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#CMD=echo
1919

2020
-include .env
21-
#export
2221

2322
.PHONY: install-niseroku install-niseroku-logrotate
2423
.PHONY: install-niseroku-systemd install-niseroku-sysv-init
@@ -65,9 +64,9 @@ SRC_AUTOCOMPLETE_FILE := _templates/bash_autocomplete
6564
INCLUDE_DEFAULT_AUTOCOMPLETE_FILE := true
6665
AUTOCOMPLETE_FILES += ${INSTALL_AUTOCOMPLETE_PATH}/niseroku
6766

68-
include Golang.def.mk
69-
include Golang.cmd.mk
70-
include Golang.cdk.mk
67+
all: help
68+
69+
include Golang.mk
7170

7271
define _profile_run
7372
@if [ -f "${BIN_NAME}.${BUILD_OS}.${BUILD_ARCH}" ]; then \

0 commit comments

Comments
 (0)