wording
[yosql.git] / Makefile
blobab6db5a25875f204a70a575ad136b9b52e09251f
1 ############
2 # PROLOGUE #
3 ############
4 MAKEFLAGS += --warn-undefined-variables
5 SHELL = /bin/bash
6 .SHELLFLAGS := -eu -o pipefail -c
7 .DEFAULT_GOAL := all
8 .DELETE_ON_ERROR:
9 .SUFFIXES:
11 ######################
12 # INTERNAL VARIABLES #
13 ######################
14 TIMESTAMPED_VERSION := $(shell /bin/date "+%Y.%m.%d-%H%M%S")
15 CURRENT_DATE := $(shell /bin/date "+%Y-%m-%d")
16 USERNAME := $(shell id -u -n)
17 USERID := $(shell id -u)
18 GREEN := $(shell tput -Txterm setaf 2)
19 WHITE := $(shell tput -Txterm setaf 7)
20 YELLOW := $(shell tput -Txterm setaf 3)
21 RESET := $(shell tput -Txterm sgr0)
23 ######################
24 # INTERNAL FUNCTIONS #
25 ######################
26 HELP_FUN = \
27 %help; \
28 while(<>) { push @{$$help{$$2 // 'targets'}}, [$$1, $$3] if /^([a-zA-Z0-9\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
29 print "usage: make [target]\n\n"; \
30 for (sort keys %help) { \
31 print "${WHITE}$$_:${RESET}\n"; \
32 for (@{$$help{$$_}}) { \
33 $$sep = " " x (32 - length $$_->[0]); \
34 print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
35 }; \
36 print "\n"; }
38 ###############
39 # GOALS/RULES #
40 ###############
41 .PHONY: all
42 all: help
44 help: ##@other Show this help
45 @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
47 .PHONY: build
48 build: ##@hacking Build everything
49 mvn verify
51 .PHONY: watch
52 watch: ##@hacking Watch for changes and build everything
53 ag -l | entr mvn verify
55 .PHONY: test
56 test: ##@hacking Test everything
57 mvn verify
59 .PHONY: sign-waiver
60 sign-waiver: ##@contributing Sign the WAIVER
61 echo 'use minisign'