Skip to content

Commit

Permalink
- Added target bom-error to test for BOM in files
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11218 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Feb 28, 2012
1 parent fff231e commit bcc2d83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile.common
Expand Up @@ -148,8 +148,8 @@ clean: qtclean
(cd Compiler/omc_profiler && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd mosh/src && $(MAKE) -f $(defaultMakefileTarget) clean)
rm -rf build/share build/lib build/include build/bin/OMShell* build/bin/OMNotebook* \
build/bin/omc build/bin/omc.exe build/bin/omcd build/bin/omcd.exe build/bin/omcp build/bin/omcp.exe build/bin/omc-diff build/bin/omc-diff.exe

build/bin/omc build/bin/omc.exe build/bin/omcd build/bin/omcd.exe build/bin/omcp build/bin/omcp.exe build/bin/omc-diff build/bin/omc-diff.exe \
bom-error.log bom-error.sh
install-dirs:
@test ! "${DESTDIR}/${prefix}" -ef "${top_builddir}/build" || (echo Error: Install and build dirs are the same && false)
if [ "$(EXE)" = ".app" ]; then mkdir -p ${INSTALL_APPDIR}; fi
Expand Down
8 changes: 8 additions & 0 deletions Makefile.in
Expand Up @@ -77,6 +77,14 @@ fix-svn-eol-style:
fix-bom:
find . -type f \( ! -path '*/.svn/*' -prune \) | while read file;do sed -i '1 s/^\xef\xbb\xbf//' "$$file";done

bom-error:
rm -f bom-error.log bom-error.sh
echo "#!/bin/sh\ntest \"\`head -c3 \\\"\$$1\\\"\`\" = \"\`/bin/echo -ne \"\\xef\\xbb\\xbf\"\`\" && (echo \$$1 contains BOM >> bom-error.log)" > bom-error.sh
find OM*/ Compiler/ SimulationRuntime/ mosh/ -type f \( ! -path '*/.svn/*' -prune \) -exec sh bom-error.sh "{}" ';'
@if test -e bom-error.log; then cat bom-error.log; fi
@test ! -e bom-error.log
rm -f bom-error.log bom-error.sh

.PRECIOUS: Makefile

Makefile: Makefile.in config.status
Expand Down

0 comments on commit bcc2d83

Please sign in to comment.