Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 16 Mar 2010 15:23:52 +0200
changeset 35 20fbd437b2fa
parent 22 887d49d11bfa
child 36 e131d1fd12f0
permissions -rw-r--r--
By default rxvt start shell without args, so it interactive. But if it also login shell then ~/.bashrc will not be read. Awful!

SHELL = /bin/sh

.PHONY: all
all:

ifeq '' '$(HOME)'
  $(error HOME env var not set!)
endif

host_os = linux
ifneq '' '$(COMSPEC)'
  host_os = windows
endif

ITEMS = .Xdefaults .bashrc .mailsign .xinitrc .mc .vimrc

.PHONY: install
install:
	for item in $(ITEMS); do \
		if [ -f $$item ]; then \
			install -m 640 $$item $(HOME)/$$item; \
		fi; \
		if [ -d $$item ]; then \
			for file in `find $$item`; do \
				if [ -d $$file ]; then \
					[ -d $(HOME)/$$file ] || mkdir -p $(HOME)/$$file; \
				fi; \
				if [ -f $$file ]; then \
					install -m 640 $$file $(HOME)/$$file; \
				fi; \
			done; \
		fi; \
	done

.PHONY: uninstall
uninstall:
	rm -f $(HOME)/.mailsign

.PHONY: clean
clean:

.PHONY: distclean
distclean: clean