~tardypad/dotfiles

ref: 7dd5e02494e2821ff6b4fd5758a590ef03b5403b dotfiles/Makefile -rw-r--r-- 2.3 KiB
7dd5e024 — Damien Tardy-Panis add mako package config 2 years ago
                                                                                
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
65
66
67
# XDG common folders
CONFIG_DIR := $(if $(XDG_CONFIG_HOME),$(XDG_CONFIG_HOME),$(HOME)/.config)
DATA_DIR := $(if $(XDG_DATA_HOME),$(XDG_DATA_HOME),$(HOME)/.local/share)
CACHE_DIR := $(if $(XDG_CACHE_HOME),$(XDG_CACHE_HOME),$(HOME)/.cache)

# detect all packages target
PACKAGES := $(subst /,,$(dir $(subst packages/,,$(wildcard packages/*/Makefile))))

IS_LOCAL_INSTALL := $(if $(DESTDIR),'false','true')

# default target first
# install all packages
all: $(PACKAGES)
.PHONY: all $(PACKAGES)

# info display macros
start_setup = @echo -n "… setup $@"
end_setup   = @echo -e "\r✔ setup $@"

# copy macros with colors update
define copy_file
	@mkdir --parents $(DESTDIR)$(dir $(2))
	@cp packages/$@/$(1) $(DESTDIR)$(2)
	@colors/substitute_placeholders $(DESTDIR)$(2)
endef
define copy_folder
	@mkdir --parents $(DESTDIR)$(dir $(2))
	@cp --recursive --force --no-target-directory packages/$@/$(1) $(DESTDIR)$(2)
    @find $(DESTDIR)$(2) -type f -exec colors/substitute_placeholders {} \;
endef

# all Makefiles could be included with "include */Makefile"
# or "$(foreach package, $(PACKAGES), $(eval include $(package)/Makefile))"
# but then we lose the autocompletion in the command line :(
include packages/aria2/Makefile
include packages/coreutils/Makefile
include packages/fontconfig/Makefile
include packages/git/Makefile
include packages/gnupg/Makefile
include packages/htop/Makefile
include packages/httpie/Makefile
include packages/i3blocks/Makefile
include packages/less/Makefile
include packages/libqalculate/Makefile
include packages/mako/Makefile
include packages/mopidy/Makefile
include packages/ncmpcpp/Makefile
include packages/neomutt/Makefile
include packages/newsboat/Makefile
include packages/openssh/Makefile
include packages/qutebrowser/Makefile
include packages/rbtools/Makefile
include packages/tmux/Makefile
include packages/sway/Makefile
include packages/swaylock/Makefile
include packages/systemd/Makefile
include packages/termite/Makefile
include packages/translate-shell/Makefile
include packages/universal-ctags/Makefile
include packages/util-linux/Makefile
include packages/vifm/Makefile
include packages/vim/Makefile
include packages/weechat/Makefile
include packages/xdg-user-dirs/Makefile
include packages/xdg-utils/Makefile
include packages/zathura/Makefile
include packages/zsh/Makefile