Permalink
Browse files

[Makefiles] sort out init.ini installation

strip comments and blank lines during install
and factor out this command for reuse in other cases

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
1 parent 0a6d0f3 commit dbfbe5b5ad07be57949321bba8e8b86702922c96 @hxw hxw committed Nov 4, 2010
Showing with 11 additions and 3 deletions.
  1. +8 −2 Makefile
  2. +2 −0 samo-lib/Mk/definitions.mk
  3. +1 −1 samo-lib/grifo/Makefile
View
@@ -211,7 +211,13 @@ install: validate-destdir mahatma-install forth-install fonts-install nls-instal
# install grifo version
.PHONY: ginstall
-ginstall: validate-destdir grifo-install forth-install fonts-install nls-install misc-files-install version clear-history
+ginstall: validate-destdir grifo-install init-ini-install forth-install fonts-install nls-install misc-files-install version clear-history
+
+# install the default init.ini
+.PHONY: init-ini-install
+init-ini-install: validate-destdir
+ ${STRIP_HASH_OR_BLANK_LINES} "${LICENSE_DIR}"/init.ini > "${DESTDIR_PATH}"/init.ini
+
# set up version and checksum files
.PHONY: version
@@ -234,7 +240,7 @@ clear-history: validate-destdir
${RM} "${DESTDIR_PATH}"/[wW][iI][kK][iI].[iI][nN][fF]
dd if=/dev/zero of="${DESTDIR_PATH}/wiki.hst" bs=67584 count=1
dd if=/dev/zero of="${DESTDIR_PATH}/wiki.pas" bs=40 count=1
- grep -v '^[[:space:]]*\(#.*\)[[:space:]]*$$' "${LICENSE_DIR}"/wiki.inf > "${DESTDIR_PATH}"/wiki.inf
+ ${STRIP_HASH_OR_BLANK_LINES} "${LICENSE_DIR}"/wiki.inf > "${DESTDIR_PATH}"/wiki.inf
id=$$(grep -n -m 1 '${WIKI_LANGUAGE}${WIKI_DIR_SUFFIX}' "${DESTDIR_PATH}/wiki.inf"); \
id=$${id%%:*}; \
[ -z "$${id}" ] && id=1; \
@@ -54,6 +54,8 @@ RM = rm -f
MKDIR = mkdir -p
COPY = cp -p
TOUCH = touch
+STRIP_HASH_OR_BLANK_LINES = grep -v '^[[:space:]]*\(\#.*\)\?[[:space:]]*$$'
+
ifeq (Linux,${OS})
View
@@ -158,9 +158,9 @@ install: all
ifneq (YES,$(strip ${INSTALL_GRIFO_SIMULATION}))
${COPY} grifo.elf "${DESTDIR}"/kernel.elf
endif
- ${COPY} init.ini "${DESTDIR}"/
${MAKE} -C applications install INSTALL_GRIFO_SIMULATION="${INSTALL_GRIFO_SIMULATION}"
ifeq (YES,$(strip ${BUILD_EXAMPLES}))
+ ${COPY} init.ini "${DESTDIR}"/
${MAKE} -C examples install INSTALL_GRIFO_SIMULATION="${INSTALL_GRIFO_SIMULATION}"
endif

0 comments on commit dbfbe5b

Please sign in to comment.