-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (38 loc) · 1.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Development management facilities
#
# This file specifies useful routines to streamline development management.
# See https://www.gnu.org/software/make/.
# Consume environment variables
ifneq (,$(wildcard .env))
include .env
endif
# Tool configuration
SHELL := /bin/bash
GNUMAKEFLAGS += --no-print-directory
# Path record
ROOT_DIR ?= $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DATA_DIR ?= .contentlayer/
CONTENT_DIR ?= content/
# Target files
ENV_FILE ?= .env
EPHEMERAL_ARCHIVES ?= \
**/$(DATA_DIR)
# Executables definition
# Behavior definition
%: # Treat unrecognized targets
@ printf "\033[31;1mUnrecognized routine: '$(*)'\033[0m\n"
$(MAKE) help
help:: ## Show this help
@ printf '\033[33;1mGNU-Make available routines:\n'
egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[37;1m%-20s\033[0m %s\n", $$1, $$2}'
init:: veryclean ## Initialize development environment
npm install
parse:: ## Transpile source code
npm run parse
clean:: ## Delete project ephemeral archives
-rm -fr $(EPHEMERAL_ARCHIVES)
veryclean:: clean ## Delete all generated files
-rm -fr node_modules
.EXPORT_ALL_VARIABLES:
.ONESHELL:
.PHONY: help init parse clean veryclean