-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
28 lines (21 loc) · 678 Bytes
/
makefile
File metadata and controls
28 lines (21 loc) · 678 Bytes
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
.PHONY: all print
# Find top-level directories (result: nvim/)
DIRS := $(wildcard */)
# Remove trailing slashes (result: nvim)
DIRS_CLEAN := $(patsubst %/,%,$(DIRS))
# Filter out directories not to be stowed (e.g., .git)
EXCLUDE := .git .github private documentation
PACKAGES := $(filter-out $(EXCLUDE), $(DIRS_CLEAN))
# Test which directories are detected
print:
@echo $(PACKAGES)
# Default target stows all packages
all: $(PACKAGES)
# "make <package>" stows that package
.PHONY: $(PACKAGES)
$(PACKAGES):
stow --verbose --target=$(HOME) --restow $@
# "make delete-<package>" deletes that package
.PHONY: delete-%
delete-%:
stow --verbose --target=$(HOME) --delete $*