author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 15 Mar 2010 22:41:03 +0200 | |
changeset 38 | 76d2bf3ac7c3 |
parent 22 | 887d49d11bfa |
child 36 | e131d1fd12f0 |
permissions | -rw-r--r-- |
12
52322e5cc6bb
Proper determine Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2
diff
changeset
|
1 |
SHELL = /bin/sh |
0 | 2 |
|
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
3 |
.PHONY: all |
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
4 |
all: |
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
5 |
|
0 | 6 |
ifeq '' '$(HOME)' |
12
52322e5cc6bb
Proper determine Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2
diff
changeset
|
7 |
$(error HOME env var not set!) |
0 | 8 |
endif |
9 |
||
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
10 |
host_os = linux |
12
52322e5cc6bb
Proper determine Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2
diff
changeset
|
11 |
ifneq '' '$(COMSPEC)' |
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
12 |
host_os = windows |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
13 |
endif |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
14 |
|
22
887d49d11bfa
Added .vimrc to install.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
21
diff
changeset
|
15 |
ITEMS = .Xdefaults .bashrc .mailsign .xinitrc .mc .vimrc |
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
16 |
|
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
17 |
.PHONY: install |
0 | 18 |
install: |
18
2e991b769c95
Move all config file to same dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
15
diff
changeset
|
19 |
for item in $(ITEMS); do \ |
21 | 20 |
if [ -f $$item ]; then \ |
21 |
install -m 640 $$item $(HOME)/$$item; \ |
|
22 |
fi; \ |
|
23 |
if [ -d $$item ]; then \ |
|
24 |
for file in `find $$item`; do \ |
|
25 |
if [ -d $$file ]; then \ |
|
26 |
[ -d $(HOME)/$$file ] || mkdir -p $(HOME)/$$file; \ |
|
27 |
fi; \ |
|
28 |
if [ -f $$file ]; then \ |
|
29 |
install -m 640 $$file $(HOME)/$$file; \ |
|
30 |
fi; \ |
|
31 |
done; \ |
|
32 |
fi; \ |
|
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
33 |
done |
0 | 34 |
|
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
35 |
.PHONY: uninstall |
0 | 36 |
uninstall: |
37 |
rm -f $(HOME)/.mailsign |
|
38 |
||
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
39 |
.PHONY: clean |
0 | 40 |
clean: |
41 |
||
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
42 |
.PHONY: distclean |
0 | 43 |
distclean: clean |