Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 08 May 2010 13:05:00 +0300
changeset 75 956a463b63e3
parent 72 a1c1239991de
child 76 85dc8b07017a
permissions -rw-r--r--
Added wgetrc.
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
75
956a463b63e3 Added wgetrc.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 72
diff changeset
    15
ITEMS = .Xdefaults .bashrc .mailsign .xinitrc .mc .vimrc .inputrc .ssh .hgrc .hgignore .bazaar .wgetrc
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 \
21
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    20
		if [ -f $$item ]; then \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    21
			install -m 640 $$item $(HOME)/$$item; \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    22
		fi; \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    23
		if [ -d $$item ]; then \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    24
			for file in `find $$item`; do \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    25
				if [ -d $$file ]; then \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    26
					[ -d $(HOME)/$$file ] || mkdir -p $(HOME)/$$file; \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    27
				fi; \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    28
				if [ -f $$file ]; then \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    29
					install -m 640 $$file $(HOME)/$$file; \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    30
				fi; \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    31
			done; \
a2b9b6ed57af Pattern like
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 20
diff changeset
    32
		fi; \
2
48e601bfbca6 Split files depend of OS. New install algorithm.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 0
diff changeset
    33
	done
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    35
.PHONY: uninstall
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
uninstall:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
	rm -f $(HOME)/.mailsign
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    39
.PHONY: clean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    40
clean:
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
13
9e590e7ef108 Adds .PHONY exactly before corresponding target.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    42
.PHONY: distclean
0
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
distclean: clean