Makefile
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 13 Jan 2010 22:30:59 +0200
changeset 15 a261abd34f1b
parent 14 ebe743b087ae
child 18 2e991b769c95
permissions -rw-r--r--
Remove debug code.

SHELL = /bin/sh

.PHONY: all
all:

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

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

ALL_DIR = all
LINUX_DIR = linux
WIN_DIR = win

ifeq 'linux' '$(host_os)'
  DIRS = all linux
endif
ifeq 'windows' '$(host_os)'
  DIRS = all
  # DIRS += win
endif

.PHONY: install
install:
	for srcdir in $(DIRS); do \
		prefix=$$PWD/$$srcdir; \
		for item in `find $$prefix -type f`; do \
			fname=$${item##*/}; \
			file=$${item#$${prefix}/}; \
			dir=$${file%$${fname}}; \
			dir=$${dir%/}; \
			[ -n $$dir ] && mkdir -p $(HOME)/$$dir; \
			install -m 660 $$srcdir/$$file $(HOME)/$$dir; \
		done; \
	done

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

.PHONY: clean
clean:

.PHONY: distclean
distclean: clean