Bladeren bron

Add separate INSTALL_SCRIPT macro and use it to install scripts,
This allows packagers to override INSTALL_SCRIPT/INSTALL_BIN to
perform additional functionality when installing (e.g strip binary).

Maxim Sobolev 17 jaren geleden
bovenliggende
commit
1c5f04ac86
2 gewijzigde bestanden met toevoegingen van 18 en 3 verwijderingen
  1. 17 3
      Makefile
  2. 1 0
      Makefile.defs

+ 17 - 3
Makefile

@@ -219,8 +219,8 @@ modules_full_path=$(join  $(modules), $(addprefix /, $(modules_names)))
 # which utils need compilation (directory path) and which to install
 # (full path including file name)
 utils_compile=	utils/gen_ha1 utils/sercmd
-utils_install=	utils/gen_ha1/gen_ha1 \
-				scripts/mysql/ser_mysql.sh utils/sercmd/sercmd
+utils_bin_install=	$(utils_compile)
+utils_script_install=	scripts/mysql/ser_mysql.sh
 
 
 ALLDEP=Makefile Makefile.sources Makefile.defs Makefile.rules
@@ -482,7 +482,7 @@ install-modules: $(modules_prefix)/$(modules_dir)
 	done; true
 
 install-utils: utils $(bin_prefix)/$(bin_dir)
-	@for r in $(utils_install) "" ; do \
+	@for r in $(utils_bin_install) "" ; do \
 		if [ -n "$$r" ]; then \
 			if [ -f "$$r" ]; then \
 				$(INSTALL_TOUCH) \
@@ -496,6 +496,20 @@ install-utils: utils $(bin_prefix)/$(bin_dir)
 			fi ;\
 		fi ; \
 	done; true
+	@for r in $(utils_script_install) "" ; do \
+		if [ -n "$$r" ]; then \
+			if [ -f "$$r" ]; then \
+				$(INSTALL_TOUCH) \
+					$(bin_prefix)/$(bin_dir)/`basename "$$r"` ; \
+				$(INSTALL_SCRIPT)  "$$r"  $(bin_prefix)/$(bin_dir) ; \
+			else \
+				echo "ERROR: $$r not compiled" ; \
+				if [ ${err_fail} = 1 ] ; then \
+					exit 1; \
+				fi ; \
+			fi ;\
+		fi ; \
+	done; true
 
 
 

+ 1 - 0
Makefile.defs

@@ -220,6 +220,7 @@ INSTALL_TOUCH = touch          # used to create the file first (good to
                                #  make solaris install work)
 INSTALL_CFG = $(INSTALL) -m 644
 INSTALL_BIN = $(INSTALL) -m 755
+INSTALL_SCRIPT = $(INSTALL) -m 755
 INSTALL_MODULES = $(INSTALL) -m 755
 INSTALL_LIB = $(INSTALL) -m 755
 INSTALL_DOC = $(INSTALL) -m 644