Makefile
changeset 18 2e991b769c95
parent 15 a261abd34f1b
child 20 9cf206648ce7
--- a/Makefile	Fri Mar 12 12:00:09 2010 +0200
+++ b/Makefile	Sat Mar 13 15:47:40 2010 +0200
@@ -12,29 +12,15 @@
   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
+ITEMS = .Xdefaults .bashrc .mailsign .xinitrc .mc
 
 .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; \
+	for item in $(ITEMS); do \
+		[ -f $$item ] && install -m 640 $$item $(HOME)/$$item; \
+		[ -d $$item ] && for file in `find $$item`; do \
+			[ -d $$file ] && [ -d $(HOME)/$$item ] || mkdir -p $(HOME)/$$item; \
+			[ -f $$file ] && install -m 640 $$item $(HOME)/$$item; \
 		done; \
 	done
 
@@ -47,4 +33,3 @@
 
 .PHONY: distclean
 distclean: clean
-