-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (46 loc) · 1.51 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
.PHONY: pkgs stow pre-stow configure
MKFILE_PATH := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
PATH := $(MKFILE_PATH)/.bin:$(PATH)
CONFIGURE := $(MKFILE_PATH)/configure
STOW := $(MKFILE_PATH)/stow
PRE_STOW := $(MKFILE_PATH)/pre-stow
ifeq ($(shell uname | grep -i linux),)
OS := macos
OSDISTRIBUTION := macos
else
OS := linux
OSDISTRIBUTION := $(shell cat /etc/*-release | grep ^ID | sed -e 's/^.*=//')
endif
ifeq ($(origin FULLINSTALL),undefined)
INSTALL_TYPE := simple-install
else
INSTALL_TYPE := full-install
endif
ifeq ($(OSDISTRIBUTION), arch)
DESKTOP_SERVER := desktop
else ifeq ($(OSDISTRIBUTION), macos)
DESKTOP_SERVER := desktop
else
DESKTOP_SERVER := server
endif
all: pkgs quick
quick: stow configure
pkgs:
(cd $(MKFILE_PATH)/pkgs/$(OSDISTRIBUTION) && $(MAKE))
pre-stow:
find . | grep DS_Store | ifne xargs rm
run-directory $(PRE_STOW)/common
run-directory $(PRE_STOW)/$(OS)
stow: pre-stow
stow --verbose --dir=$(STOW) --target=$(HOME) --stow common
stow --verbose --dir=$(STOW) --target=$(HOME) --stow $(OS)
stow --verbose --dir=$(STOW) --target=$(HOME) --stow $(OSDISTRIBUTION)
stow --verbose --dir=$(STOW) --target=$(HOME) --stow $(INSTALL_TYPE)
stow --verbose --dir=$(STOW) --target=$(HOME) --stow $(DESKTOP_SERVER)
stow-if-command $(STOW)/if-command
configure:
run-directory $(CONFIGURE)/all
run-directory $(CONFIGURE)/if-os/$(OS)
run-directory $(CONFIGURE)/if-osdistribution/$(OSDISTRIBUTION)
run-directory $(CONFIGURE)/$(INSTALL_TYPE)
run-if-command $(CONFIGURE)/if-command-after