fix forkability title
[generic-types.git] / Makefile
bloba46b0b603c042a9a440182ac30cd91206063d8d8
1 # http://www.gnu.org/software/make/manual/make.html
2 # https://www.gnu.org/prep/standards/html_node/Makefile-Basics.html#Makefile-Basics
3 # http://clarkgrubb.com/makefile-style-guide
5 ############
6 # PROLOGUE #
7 ############
8 MAKEFLAGS += --warn-undefined-variables
9 SHELL = /bin/sh
10 .SHELLFLAGS := -eu -o pipefail -c
11 .DEFAULT_GOAL := all
12 .DELETE_ON_ERROR:
13 .SUFFIXES:
15 ######################
16 # INTERNAL VARIABLES #
17 ######################
18 TIMESTAMP := $(shell /bin/date "+%Y%m%d%H%M%S")
19 USERID := $(shell id -u)
20 GREEN := $(shell tput -Txterm setaf 2)
21 WHITE := $(shell tput -Txterm setaf 7)
22 YELLOW := $(shell tput -Txterm setaf 3)
23 RESET := $(shell tput -Txterm sgr0)
25 ######################
26 # INTERNAL FUNCTIONS #
27 ######################
28 HELP_FUN = \
29 %help; \
30 while(<>) { push @{$$help{$$2 // 'targets'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
31 print "usage: make [target]\n\n"; \
32 for (sort keys %help) { \
33 print "${WHITE}$$_:${RESET}\n"; \
34 for (@{$$help{$$_}}) { \
35 $$sep = " " x (32 - length $$_->[0]); \
36 print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
37 }; \
38 print "\n"; }
40 ###############
41 # GOALS/RULES #
42 ###############
43 .PHONY: all
44 all: help
46 .PHONY: help
47 help: ##@other Show this help
48 @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
50 .PHONY: sonar-analysis
51 sonar-analysis: ##@sebhoss Perform Sonarqube analysis
52 # http://docs.sonarqube.org/display/SONAR/Analyzing+with+Maven
53 mvn clean install
54 mvn sonar:sonar -Dsonar.host.url=http://localhost:59000 -Dsonar.pitest.mode=reuseReport
56 .PHONY: sign-waiver
57 sign-waiver: ##@contributing Sign the WAIVER
58 gpg2 --no-version --armor --sign AUTHORS/WAIVER
60 .PHONY: docker-verify
61 docker-verify: ##@docker Verify project in pre-defined build environment
62 docker-compose -f build/docker/build-environment.yml run --rm verify-project
63 # since we are 'root' inside the container, we need another container run to cleanup after ourselves
64 docker-compose -f build/docker/build-environment.yml run --rm clean-project
65 # findbugs likes to create these
66 rm -rf ?/
68 .PHONY: update-parent
69 update-parent: ##@maintenance Updates the Maven parent to its latest version
70 mvn versions:update-parent -U -DgenerateBackupPoms=false
71 git add pom.xml
72 git commit pom.xml -s -S -m 'Update to latest parent'
74 .PHONY: release-into-local-nexus
75 release-into-local-nexus: ##@release Release all artifacts into a local nexus
76 mvn clean deploy scm:tag -Prelease -Drevision=$(TIMESTAMP) -DpushChanges=false -DskipLocalStaging=true -Drelease=local
78 .PHONY: release-into-sonatype-nexus
79 release-into-sonatype-nexus: ##@release Release all artifacts into Maven Central (through Sonatype OSSRH)
80 mvn clean deploy scm:tag -Prelease -Drevision=$(TIMESTAMP) -DpushChanges=false -Drelease=sonatype
81 git push --tags origin master