-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 874 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
33
include make/boilerplate.mk
# Find all the file/folder ending with .symlink
file_to_symlink := $(shell find . -name '*.symlink')
# Extract just the name.symlink from the previous list
symlinks := $(patsubst %.symlink, %, $(shell basename $(file_to_symlink)))
# Generate the complete list of symlink target we need
#$(info "symlink")
#$(info $(symlinks))
symlinks_path := $(addprefix ${HOME}/., $(symlinks))
# All directory to search for *.symlink files/folder
dir := $(shell find . -type d -not -path '*/\.*')
$(info "dir")
$(info $(dir))
# VPATH tell make to search this list of folder when using the % pattern
VPATH = $(dir)
.PHONY: link install
link: install
install: $(symlinks_path)
# Create all symlink
${HOME}/.%: %.symlink
ln -s $(abspath $<) $@
.PHONY: rebuild
rebuild:
darwin-rebuild build --flake .#pro-m2
switch:
darwin-rebuild switch --flake .#pro-m2