author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 12 Mar 2010 21:45:39 +0200 | |
changeset 29 | 1a0b84ed3954 |
parent 15 | a261abd34f1b |
child 18 | 2e991b769c95 |
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 |
|
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
15 |
ALL_DIR = all |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
16 |
LINUX_DIR = linux |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
17 |
WIN_DIR = win |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
18 |
|
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
19 |
ifeq 'linux' '$(host_os)' |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
20 |
DIRS = all linux |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
21 |
endif |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
22 |
ifeq 'windows' '$(host_os)' |
14
ebe743b087ae
Fix fname and dname calculation. Refactor code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
23 |
DIRS = all |
ebe743b087ae
Fix fname and dname calculation. Refactor code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
24 |
# DIRS += win |
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
25 |
endif |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
26 |
|
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
27 |
.PHONY: install |
0 | 28 |
install: |
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
29 |
for srcdir in $(DIRS); do \ |
14
ebe743b087ae
Fix fname and dname calculation. Refactor code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
30 |
prefix=$$PWD/$$srcdir; \ |
ebe743b087ae
Fix fname and dname calculation. Refactor code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
31 |
for item in `find $$prefix -type f`; do \ |
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
32 |
fname=$${item##*/}; \ |
14
ebe743b087ae
Fix fname and dname calculation. Refactor code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
33 |
file=$${item#$${prefix}/}; \ |
ebe743b087ae
Fix fname and dname calculation. Refactor code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
34 |
dir=$${file%$${fname}}; \ |
ebe743b087ae
Fix fname and dname calculation. Refactor code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
13
diff
changeset
|
35 |
dir=$${dir%/}; \ |
15 | 36 |
[ -n $$dir ] && mkdir -p $(HOME)/$$dir; \ |
37 |
install -m 660 $$srcdir/$$file $(HOME)/$$dir; \ |
|
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
38 |
done; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
39 |
done |
0 | 40 |
|
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
41 |
.PHONY: uninstall |
0 | 42 |
uninstall: |
43 |
rm -f $(HOME)/.mailsign |
|
44 |
||
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
45 |
.PHONY: clean |
0 | 46 |
clean: |
47 |
||
13
9e590e7ef108
Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
12
diff
changeset
|
48 |
.PHONY: distclean |
0 | 49 |
distclean: clean |
50 |