author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 10 Oct 2009 12:36:45 +0300 | |
changeset 5 | bd38a3b4e196 |
parent 2 | 48e601bfbca6 |
child 12 | 52322e5cc6bb |
permissions | -rw-r--r-- |
0 | 1 |
|
2 |
||
3 |
ifeq '' '$(HOME)' |
|
4 |
$(error HOME env var and prefix var are not set!) |
|
5 |
endif |
|
6 |
||
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
7 |
host_os = linux |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
8 |
ifneq '' '$(WINDRIVE)' # TODO |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
9 |
host_os = windows |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
10 |
endif |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
11 |
|
0 | 12 |
.PHONY: all install uninstall clean distclean |
13 |
||
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
14 |
ALL_DIR = all |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
15 |
LINUX_DIR = linux |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
16 |
WIN_DIR = win |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
17 |
|
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
18 |
ifeq 'linux' '$(host_os)' |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
19 |
DIRS = all linux |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
20 |
endif |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
21 |
ifeq 'windows' '$(host_os)' |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
22 |
DIRS = all win |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
23 |
endif |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
24 |
|
0 | 25 |
install: |
2
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
26 |
for srcdir in $(DIRS); do \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
27 |
for item in `cd $$srcdir; find $$PWD -type f`; do \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
28 |
file=$${item#$${PWD}/$${srcdir}/}; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
29 |
fname=$${item##*/}; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
30 |
dir=$${item#$${PWD}/$${srcdir}}; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
31 |
dir=$${dir%/$${fname}}; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
32 |
dir=$${dir#/}; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
33 |
echo mkdir -p $(HOME)/$$dir; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
34 |
echo install -m 660 $$srcdir/$$file $(HOME)/$$dir; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
35 |
done; \ |
48e601bfbca6
Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
0
diff
changeset
|
36 |
done |
0 | 37 |
|
38 |
uninstall: |
|
39 |
rm -f $(HOME)/.mailsign |
|
40 |
||
41 |
clean: |
|
42 |
||
43 |
distclean: clean |
|
44 |