-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (24 loc) · 822 Bytes
/
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
PKGS ?=
DESTDIR ?= $(HOME)
SYSTEM ?= $(shell uname -o)
VERBOSE ?= 1
ifndef PKGS
ifneq ($(shell grep -c -E "^$(SYSTEM) ?=" .systems 2> /dev/null),0)
PKGS = $(shell grep -E "^\* ?=" .systems | cut -f2- -d= | tail -n1)
PKGS += $(shell grep -E "^$(SYSTEM) ?=" .systems | cut -f2- -d= | tail -n1)
else
$(error No setup defined for system '$(SYSTEM)')
endif
endif
ifeq ($(PKGS),)
$(error Nothing to do)
endif
override PKGS := $(shell for PKG in $(PKGS); do printf "%s\n" "$${PKG}"; done | sed -e 's/^-/\\-/g' -e 's/.*/"&"/g')
all: none
none:
@echo "Everything is in place, run 'make install'"
install:
@stow --verbose="$(VERBOSE)" --target="$(DESTDIR)" --stow $(PKGS)
uninstall:
@stow --verbose="$(VERBOSE)" --target="$(DESTDIR)" --delete $(PKGS)
.PHONY: install uninstall