-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
62 lines (47 loc) · 1.84 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
56
57
58
59
60
61
62
ifneq (,)
.error This Makefile requires GNU Make.
endif
# -------------------------------------------------------------------------------------------------
# Default configuration
# -------------------------------------------------------------------------------------------------
.PHONY: help lint test install
SHELL = /bin/sh
MKDIR_P = mkdir -p
# -------------------------------------------------------------------------------------------------
# Default target
# -------------------------------------------------------------------------------------------------
help:
@echo Options
@echo " make install"
@echo " Install everthing (requires sudo or root)"
@echo
@echo " make lint"
@echo " Shellcheck lint ca-gen and cert-gen"
@echo
@echo " make test"
@echo " Verify that CA and certificates can be generated successfully"
@echo
@echo " make help"
@echo " Show this help screen"
# -------------------------------------------------------------------------------------------------
# Test targets
# -------------------------------------------------------------------------------------------------
lint:
docker run --rm -v "$(PWD)/bin:/mnt" koalaman/shellcheck:stable ca-gen
docker run --rm -v "$(PWD)/bin:/mnt" koalaman/shellcheck:stable cert-gen
test:
.tests/test.sh $(ARGS)
# -------------------------------------------------------------------------------------------------
# Install targets
# -------------------------------------------------------------------------------------------------
install:
@echo "Installing files"
@echo ""
@# Create directories
${MKDIR_P} /usr/local/bin
@# Install binary
install -m 0755 bin/ca-gen /usr/local/bin/ca-gen
install -m 0755 bin/cert-gen /usr/local/bin/cert-gen
@echo "Installation complete:"
@echo "----------------------------------------------------------------------"
@echo ""