Split files depend of OS. New install algorithm.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 02 Sep 2009 22:18:21 +0300
changeset 2 48e601bfbca6
parent 1 3e1f409cb848
child 3 a1e69064ee0b
Split files depend of OS. New install algorithm.
.mailsign
Makefile
README
all/.mailsign
--- a/.mailsign	Sun Aug 30 12:38:46 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-
-Best regards!
--- a/Makefile	Sun Aug 30 12:38:46 2009 +0300
+++ b/Makefile	Wed Sep 02 22:18:21 2009 +0300
@@ -4,10 +4,36 @@
   $(error HOME env var and prefix var are not set!)
 endif
 
+host_os = linux
+ifneq '' '$(WINDRIVE)'         # TODO
+  host_os = windows
+endif
+
 .PHONY: all install uninstall clean distclean
 
+ALL_DIR = all
+LINUX_DIR = linux
+WIN_DIR = win
+
+ifeq 'linux' '$(host_os)'
+  DIRS = all linux
+endif
+ifeq 'windows' '$(host_os)'
+  DIRS = all win
+endif
+
 install:
-	install -m 440 .mailsign $(HOME)
+	for srcdir in $(DIRS); do \
+		for item in `cd  $$srcdir; find $$PWD -type f`; do \
+			file=$${item#$${PWD}/$${srcdir}/}; \
+			fname=$${item##*/}; \
+			dir=$${item#$${PWD}/$${srcdir}}; \
+			dir=$${dir%/$${fname}}; \
+			dir=$${dir#/}; \
+			echo mkdir -p $(HOME)/$$dir; \
+			echo install -m 660 $$srcdir/$$file $(HOME)/$$dir; \
+		done; \
+	done
 
 uninstall:
 	rm -f $(HOME)/.mailsign
--- a/README	Sun Aug 30 12:38:46 2009 +0300
+++ b/README	Wed Sep 02 22:18:21 2009 +0300
@@ -1,8 +1,10 @@
 -*- mode: outline; coding: utf-8 -*-
 
+* How install?
+
+  $ make install
+
 * Skeleton config file.
 
   .mailsign
                 signature for mail
-
-*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/all/.mailsign	Wed Sep 02 22:18:21 2009 +0300
@@ -0,0 +1,2 @@
+
+Best regards!