Makefile
changeset 957 b491e9c375e7
parent 952 04e8208374bd
child 958 4fdd8bd3d0a4
equal deleted inserted replaced
956:42ecad5e2cfe 957:b491e9c375e7
     1 
     1 
     2 ################################################################
     2 ################################################################
     3 # Standard GNU Makefile settings.
     3 # Standard GNU Makefile settings.
     4 
     4 
     5 SHELL = /bin/sh -eu
     5 SHELL = /bin/bash
       
     6 .SHELLFLAGS = -xeuc
     6 export PATH := /bin:/usr/bin:${PATH}
     7 export PATH := /bin:/usr/bin:${PATH}
     7 
     8 
     8 # Disable built in pattern rules.
     9 # Disable built in pattern rules.
     9 MAKEFLAGS += -r
    10 MAKEFLAGS += -r
    10 # Disable built in variables.
    11 # Disable built in variables.
   105 # Install/uninstall targets.
   106 # Install/uninstall targets.
   106 
   107 
   107 .PHONY: install
   108 .PHONY: install
   108 install:
   109 install:
   109 	for item in $(OVERRIDDEN_ITEMS); do \
   110 	for item in $(OVERRIDDEN_ITEMS); do \
   110 		if [ -f $$item ]; then \
   111 		if [[ -f $$item ]]; then \
   111 			$(INSTALL_DATA) $$item $(HOME)/$$item; \
   112 			$(INSTALL_DATA) $$item $(HOME)/$$item; \
   112 		fi; \
   113 		fi; \
   113 		if [ -d $$item ]; then \
   114 		if [[ -d $$item ]]; then \
   114 			for file in `find $$item`; do \
   115 			for file in `find $$item`; do \
   115 				if [ -d $$file ]; then \
   116 				if [[ -d $$file ]]; then \
   116 					mkdir -p $(HOME)/$$file; \
   117 					mkdir -p $(HOME)/$$file; \
   117 					continue; \
   118 					continue; \
   118 				fi; \
   119 				fi; \
   119 				$(INSTALL_DATA) $$file $(HOME)/$$file; \
   120 				$(INSTALL_DATA) $$file $(HOME)/$$file; \
   120 			done; \
   121 			done; \
   122 	done
   123 	done
   123 	chmod 700 ~/.gnupg/
   124 	chmod 700 ~/.gnupg/
   124 	chmod a+x ~/.fvwm/FvwmKbdd.pl ~/.fvwm/xinit
   125 	chmod a+x ~/.fvwm/FvwmKbdd.pl ~/.fvwm/xinit
   125 	command -v fvwm || exit 0; \
   126 	command -v fvwm || exit 0; \
   126 	for f in /etc/xdg/menus/*.menu; do \
   127 	for f in /etc/xdg/menus/*.menu; do \
   127 		[ -f "$$f" ] || continue; \
   128 		[[ -f "$$f" ]] || continue; \
   128 		fname=$${f%.menu}; \
   129 		fname=$${f%.menu}; \
   129 		fname=$${fname##*/}; \
   130 		fname=$${fname##*/}; \
   130 		python .fvwm/xdg2fvwm.py Menu-$$fname $$f >~/.fvwm/$$fname.hook; \
   131 		python .fvwm/xdg2fvwm.py Menu-$$fname $$f >~/.fvwm/$$fname.hook; \
   131 		echo "Read $$[HOME]/.fvwm/$$fname.hook" >>~/.fvwm/config; \
   132 		echo "Read $$[HOME]/.fvwm/$$fname.hook" >>~/.fvwm/config; \
   132 		echo "AddToMenu MenuMyRoot $$fname Popup Menu-$$fname" >>~/.fvwm/config; \
   133 		echo "AddToMenu MenuMyRoot $$fname Popup Menu-$$fname" >>~/.fvwm/config; \
   133 	done
   134 	done
   134 	mkdir -p ~/.screenshot
   135 	mkdir -p ~/.screenshot
   135 	for item in $(IFNONEXIST_ITEMS); do \
   136 	for item in $(IFNONEXIST_ITEMS); do \
   136 		if [ -f $$item -a ! -f $(HOME)/$$item ]; then \
   137 		if [[ -f $$item ]] && ! [[ -f $(HOME)/$$item ]]; then \
   137 			$(INSTALL_DATA) $$item $(HOME)/$$item; \
   138 			$(INSTALL_DATA) $$item $(HOME)/$$item; \
   138 		fi; \
   139 		fi; \
   139 		if [ -d $$item ]; then \
   140 		if [[ -d $$item ]]; then \
   140 			for file in `find $$item`; do \
   141 			for file in `find $$item`; do \
   141 				if [ -d $$file ]; then \
   142 				if [[ -d $$file ]]; then \
   142 					mkdir -p $(HOME)/$$file; \
   143 					mkdir -p $(HOME)/$$file; \
   143 					continue; \
   144 					continue; \
   144 				fi; \
   145 				fi; \
   145 				if [ ! -f $(HOME)/$$file ]; then \
   146 				if [[ ! -f $(HOME)/$$file ]]; then \
   146 					$(INSTALL_DATA) $$file $(HOME)/$$file; \
   147 					$(INSTALL_DATA) $$file $(HOME)/$$file; \
   147 				fi; \
   148 				fi; \
   148 			done; \
   149 			done; \
   149 		fi; \
   150 		fi; \
   150 	done
   151 	done