Makefile
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--
Move all config file to same dir.
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
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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    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
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    27
.PHONY: uninstall
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
uninstall:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
	rm -f $(HOME)/.mailsign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    31
.PHONY: clean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
clean:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    34
.PHONY: distclean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
distclean: clean