Skip to content
This repository
Browse code

[Makefile] clean-sha added, version target changes

clean-sha to remove all checksum files

version only builds checksum file if it is out of date

change nls-install not to update wiki.nls if the contents would be the same
otherwise the time stamp change triggers a slow and unnecessary checksum rebuild

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
commit e0242eaac9a95f39e857acae94e84b0d8eccce75 1 parent 93ee268
Christopher Hall authored April 26, 2012

Showing 1 changed file with 20 additions and 3 deletions. Show diff stats Hide diff stats

  1. 23  Makefile
23  Makefile
@@ -236,9 +236,17 @@ version: validate-destdir
236 236
 	${RM} "${VERSION_FILE}" "${DESTDIR_PATH}"/*.idx-tmp "${DESTDIR_PATH}"/*~
237 237
 	${RM} "${DESTDIR_PATH}"/*/*.idx-tmp
238 238
 	echo VERSION: ${VERSION_TAG} >> "${VERSION_FILE}"
239  
-	find "${DESTDIR_PATH}" -type d -print -exec \
240  
-	  sh -c "cd '{}' && ${RM} '${CHECKSUM_FILE}' && sha${SHA_LEVEL}sum * > '${CHECKSUM_FILE}'" ';'
  239
+	find "${DESTDIR_PATH}" -mindepth 1 -type d -print -exec \
  240
+	  ${MAKE} -C '{}' -f '${PWD}/$(firstword ${MAKEFILE_LIST})' DESTDIR='${DESTDIR_PATH}' '${CHECKSUM_FILE}' ';'
241 241
 
  242
+.PHONY: clean-sha
  243
+clean-sha:
  244
+	find "${DESTDIR_PATH}" -type f -name '${CHECKSUM_FILE}' -print -delete
  245
+
  246
+# rebuild checksum if out of date
  247
+${CHECKSUM_FILE}: $(filter-out ${CHECKSUM_FILE},$(wildcard *))
  248
+	${RM} '$@'
  249
+	sha${SHA_LEVEL}sum * > '$@'
242 250
 
243 251
 # create empty history and password files
244 252
 # set up other required files
@@ -785,11 +793,20 @@ nls-install: validate-destdir
785 793
 	          ${SCRIPTS}/nls-installer --prefix="${DESTDIR_PATH}" \
786 794
                                            --language="$${language}" \
787 795
                                            --suffix="$${suffix}" \
788  
-                                           --output="wiki.nls" \
  796
+                                           --output="wiki.nls.tmp" \
789 797
                                            --base="${LICENSE_DIR}/en/wiki.nls" \
790 798
                                            --nls="$${src}" \
791 799
                                            --change="$${native_name}" \
792 800
                                            --verbose ; \
  801
+	          t_in="${DESTDIR_PATH}/$${language}$${suffix}/wiki.nls.tmp" ; \
  802
+	          t_out="${DESTDIR_PATH}/$${language}$${suffix}/wiki.nls" ; \
  803
+	          if cmp -s "$${t_in}" "$${t_out}" ; \
  804
+	          then \
  805
+	            rm -f "$${t_in}" ; \
  806
+	          else \
  807
+	            rm -f "$${t_out}" ; \
  808
+	            mv "$${t_in}" "$${t_out}" ; \
  809
+	          fi ; \
793 810
 	          break ; \
794 811
 	        fi ; \
795 812
 	      done \

0 notes on commit e0242ea

Please sign in to comment.
Something went wrong with that request. Please try again.