-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (32 loc) · 1.12 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
# makefile to automatically install dot files. it makes a (minor)
# attempt to avoid clobbering any local changes, but no guarantees.
# use "make force" if you _want_ to clobber them. "make import"
# will pull local changes back to the git working directory.
default:
./update_dot_files
./update_dirs
help:
@echo "usage: make - update dot files if older than the repo"
@echo " make force - update dot files even if newer than the repo"
@echo " make diff - diffs between the repo and existing files"
@echo " make import - update the repo from the dot files"
force:
./update_dot_files -f
./update_dirs
diff:
@(./update_dot_files -t; ./update_dirs -t) | grep local_mod | \
while read key file; do \
sfile=`echo $$file | sed -e 's/^_/./'`; \
sfile="$$HOME/$$sfile"; \
echo diff $$file $$sfile; \
diff $$file $$sfile; \
done; \
exit 0
import:
@(./update_dot_files -t; ./update_dirs -t) | grep local_mod | \
while read key file; do \
sfile=`echo $$file | sed -e 's/^_/./'`; \
sfile="$$HOME/$$sfile"; \
echo "copying $$sfile over $$file"; \
cp $$sfile $$file; \
done