author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 13 Mar 2010 15:47:40 +0200 | |
changeset 18 | 2e991b769c95 |
parent 15 | a261abd34f1b |
child 20 | 9cf206648ce7 |
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 |
|
18
2e991b769c95
Move all config file to same dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
15
diff
changeset
|
15 |
ITEMS = .Xdefaults .bashrc .mailsign .xinitrc .mc |
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 \ |
2e991b769c95
Move all config file to same dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
15
diff
changeset
|
20 |
[ -f $$item ] && install -m 640 $$item $(HOME)/$$item; \ |
2e991b769c95
Move all config file to same dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
15
diff
changeset
|
21 |
[ -d $$item ] && for file in `find $$item`; do \ |
2e991b769c95
Move all config file to same dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
15
diff
changeset
|
22 |
[ -d $$file ] && [ -d $(HOME)/$$item ] || mkdir -p $(HOME)/$$item; \ |
2e991b769c95
Move all config file to same dir.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
15
diff
changeset
|
23 |
[ -f $$file ] && install -m 640 $$item $(HOME)/$$item; \ |
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
24 |
done; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
25 |
done |
0 | 26 |
|
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
27 |
.PHONY: uninstall |
0 | 28 |
uninstall: |
29 |
rm -f $(HOME)/.mailsign |
|
30 |
||
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
31 |
.PHONY: clean |
0 | 32 |
clean: |
33 |
||
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
34 |
.PHONY: distclean |
0 | 35 |
distclean: clean |