Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 11 Oct 2009 22:06:00 +0300
changeset 6 687b3cb8c59a
parent 2 48e601bfbca6
child 12 52322e5cc6bb
permissions -rw-r--r--
Save line space.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
ifeq '' '$(HOME)'
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
  $(error HOME env var and prefix var are not set!)
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
endif
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
.PHONY: all install uninstall clean distclean
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
uninstall:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
	rm -f $(HOME)/.mailsign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
clean:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
distclean: clean
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    44