update Makefile
[yosql.git] / Makefile
blobbfbbd2d7a7ff43931955b994ae80689d9814d423
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 GREEN := $(shell tput -Txterm setaf 2)
15 WHITE := $(shell tput -Txterm setaf 7)
16 YELLOW := $(shell tput -Txterm setaf 3)
17 RESET := $(shell tput -Txterm sgr0)
19 ######################
20 # INTERNAL FUNCTIONS #
21 ######################
22 HELP_FUN = \
23 %help; \
24 while(<>) { push @{$$help{$$2 // 'targets'}}, [$$1, $$3] if /^([a-zA-Z0-9\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
25 print "usage: make [target]\n\n"; \
26 for (sort keys %help) { \
27 print "${WHITE}$$_:${RESET}\n"; \
28 for (@{$$help{$$_}}) { \
29 $$sep = " " x (32 - length $$_->[0]); \
30 print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
31 }; \
32 print "\n"; }
34 ###############
35 # GOALS/RULES/TARGETS #
36 ###############
37 .PHONY: all
38 all: help
40 .PHONY: help
41 help: ##@other Show this help
42 @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
44 .PHONY: build
45 build: ##@hacking Build everything
46 mvn verify
48 .PHONY: watch
49 watch: ##@hacking Watch for changes and build everything
50 ag -l | entr mvn verify
52 .PHONY: test
53 test: ##@hacking Test everything
54 mvn verify
56 .PHONY: sign-waiver
57 sign-waiver: ##@contributing Sign the WAIVER
58 echo 'use minisign'
60 .PHONY: benchmarks
61 benchmarks: ##@benchmarks Run all benchmarks
62 mvn verify --activate-profiles benchmarks
64 .PHONY: benchmarks-codegen
65 benchmarks-codegen: ##@benchmarks Run code generation benchmarks
66 mvn verify --projects yosql-benchmarks/yosql-benchmarks-codegen --also-make --activate-profiles benchmarks
68 .PHONY: benchmarks-jdbc
69 benchmarks-jdbc: ##@benchmarks Run JDBC benchmarks
70 mvn verify --projects yosql-benchmarks/yosql-benchmarks-jdbc --also-make --activate-profiles benchmarks