Bump peaceiris/actions-gh-pages from 3 to 4
[ilo.git] / Makefile
blob532abf1f27c221aeed61085337ac54c5c91fe9f8
1 # SPDX-FileCopyrightText: The ilo Authors
2 # SPDX-License-Identifier: 0BSD
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 TIMESTAMPED_VERSION := $(shell /bin/date "+%Y.%m.%d-%H%M%S")
12 CURRENT_DATE := $(shell /bin/date "+%Y-%m-%d")
13 USERNAME := $(shell id -u -n)
14 USERID := $(shell id -u)
15 GREEN := $(shell tput -Txterm setaf 2)
16 WHITE := $(shell tput -Txterm setaf 7)
17 YELLOW := $(shell tput -Txterm setaf 3)
18 RESET := $(shell tput -Txterm sgr0)
20 HELP_FUN = \
21 %help; \
22 while(<>) { push @{$$help{$$2 // 'targets'}}, [$$1, $$3] if /^([a-zA-Z0-9\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \
23 print "usage: make [target]\n\n"; \
24 for (sort keys %help) { \
25 print "${WHITE}$$_:${RESET}\n"; \
26 for (@{$$help{$$_}}) { \
27 $$sep = " " x (32 - length $$_->[0]); \
28 print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \
29 }; \
30 print "\n"; }
32 .PHONY: all
33 all: help
35 .PHONY: help
36 help: ##@other Show this help
37 @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
39 .PHONY: build
40 build: ##@hacking Build everything
41 mvn verify
43 .PHONY: native-image
44 native-image: ##@hacking Create a native image using GraalVM
45 mvn verify --define skipNativeBuild=false
47 .PHONY: clean
48 clean: ##@hacking Clean build artifacts
49 mvn clean
51 .PHONY: ilo-build
52 ilo-build: ##@hacking Build everything with ilo
53 ilo @dev/build
55 .PHONY: ilo-native
56 ilo-native: ##@hacking Create a native image using GraalVM with ilo
57 ilo @dev/native
59 .PHONY: ilo-env
60 ilo-env: ##@hacking Open a new development environment with ilo
61 ilo @dev/env
63 .PHONY: ilo-website
64 ilo-website: ##@hacking Build the website with ilo
65 ilo @dev/website
67 .PHONY: ilo-serve
68 ilo-serve: ##@hacking Serve the website locally with ilo
69 ilo @dev/serve