-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 1.46 KB
/
Makefile
File metadata and controls
64 lines (49 loc) · 1.46 KB
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
63
64
# Makefile for tries.py
.PHONY: all help gallery tests clean install uninstall
# Default target
all: gallery tests
help:
@echo "Available targets:"
@echo
@echo " make Run gallery + tests (default)"
@echo " make gallery Generate theme PDFs into EXAMPLES/"
@echo " make tests Generate feature tests into EXAMPLES/tests/"
@echo " make clean Remove all generated output"
@echo " make install Install tries into $${PREFIX:-$$HOME}/bin"
@echo " make uninstall Remove installed tries binary"
@echo
@echo "Environment variables:"
@echo " PREFIX=DIR Override install prefix (default: $$HOME)"
gallery: EXAMPLES
./generate-gallery.sh
tests: EXAMPLES/tests
./generate-tests.sh
EXAMPLES:
mkdir -p EXAMPLES
EXAMPLES/tests:
mkdir -p EXAMPLES/tests
clean:
$(RM) -r EXAMPLES
# Installation variables
PREFIX ?= $(HOME)
BINDIR := $(PREFIX)/bin
ifeq ($(PREFIX),$(HOME))
SHAREDIR := $(HOME)/.local/share/tries
else
SHAREDIR := $(PREFIX)/share/tries
endif
install:
mkdir -p "$(BINDIR)"
mkdir -p "$(SHAREDIR)"
# Install main executable
install -m 755 tries.py "$(BINDIR)/tries"
# Support files
install -m 644 themes.py "$(SHAREDIR)/themes.py"
install -m 644 samples.py "$(SHAREDIR)/samples.py"
@echo "Installed tries to $(BINDIR)/tries"
@echo "Installed support files to $(SHAREDIR)"
uninstall:
$(RM) "$(BINDIR)/tries"
$(RM) "$(SHAREDIR)/themes.py"
$(RM) "$(SHAREDIR)/samples.py"
@echo "Removed tries and support files"