Makefile
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--
Automated merge with file:///E:\srv\hg\skel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
52322e5cc6bb Proper determine Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2
diff changeset
     1
SHELL = /bin/sh
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
endif
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    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
a261abd34f1b Remove debug code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 14
diff changeset
    36
			[ -n $$dir ] && mkdir -p $(HOME)/$$dir; \
a261abd34f1b Remove debug code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 14
diff changeset
    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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    41
.PHONY: uninstall
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
uninstall:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
	rm -f $(HOME)/.mailsign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    45
.PHONY: clean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    46
clean:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    47
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    48
.PHONY: distclean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    49
distclean: clean
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50