forked from biosan/jsonresume-theme-macchiato
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (40 loc) · 1.22 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
PROJECT := $(notdir $(CURDIR))
PORT ?= 8080
JSON := ./test/kitchen-sink.json
ASSETS := $(shell find ./test/ -type f -name "*.jpg")
THEME := .
# Targets that don't result in output of the same name.
.PHONY: clean \
distclean \
validate \
serve \
test
# When no target is specified, the default target to run.
.DEFAULT_GOAL := test
# Target that cleans build output
clean:
@rm -rf public
# Target that cleans build output and local dependencies.
distclean: clean
@rm -rf node_modules
# Target to install Node.js dependencies.
node_modules: package.json package.json
@echo "Installing dependencies..."
@npm i
@-touch node_modules
# Target to create the output directories.
public: $(ASSETS)
@echo "Creating $@..."
@mkdir -p $(CURDIR)/$@
@echo "Copying assets..."
@cp test/*.jpg $@
# Target to create the validate the JSON against the schema.
validate: ${JSON}
@echo "Validating $<..."
@npx resume validate --resume $<
# Target to generate and preview the theme using the 'kitchen-sink'
serve: ${JSON}
@echo "Starting '$(PROJECT)' on 'http://localhost:$(PORT)'..."
@npx resume serve --resume $< --port $(PORT) --theme ${THEME}
# Validates and Serves the CV
test: node_modules validate public serve