summaryrefslogtreecommitdiffstats
path: root/webkit/build
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-25 18:25:12 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-25 18:25:12 +0000
commit19229ff42262516c58625070cb9b19688334ec30 (patch)
tree707b6f5ff9bd3a8ff98b80002bf6fa37a1d08db6 /webkit/build
parentad002771a61333fdfc56f27a1285f8ef90abf069 (diff)
downloadchromium_src-19229ff42262516c58625070cb9b19688334ec30.zip
chromium_src-19229ff42262516c58625070cb9b19688334ec30.tar.gz
chromium_src-19229ff42262516c58625070cb9b19688334ec30.tar.bz2
Simplify and unify some calls to yacc, making them work on Linux too.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/build')
-rw-r--r--webkit/build/port/SConscript41
1 files changed, 14 insertions, 27 deletions
diff --git a/webkit/build/port/SConscript b/webkit/build/port/SConscript
index be8eebf..49b58e9 100644
--- a/webkit/build/port/SConscript
+++ b/webkit/build/port/SConscript
@@ -566,33 +566,20 @@ env.Command(['$DERIVED_DIR/UserAgentStyleSheets.h',
'$DERIVED_DIR/quirks.css'],
'$PERL ${SOURCES[0].posix} ${TARGETS.posix} ${SOURCES[1:].posix}')
-env.Command(['$DERIVED_DIR/XPathGrammar.cpp',
- '$DERIVED_DIR/XPathGrammar.h'],
- ['$WEBKIT_PORT_DIR/xml/XPathGrammar.y'],
- '$YACC -d -p xpathyy ${SOURCES[0].posix} -o ${TARGET.posix} && ' + \
- 'echo #ifndef XPathGrammar_h ' + \
- '> $DERIVED_DIR\\XPathGrammar.h && ' + \
- 'echo #define XPathGrammar_h ' + \
- '>> $DERIVED_DIR\\XPathGrammar.h && ' + \
- 'type $DERIVED_DIR\\XPathGrammar.hpp ' + \
- '>> $DERIVED_DIR\\XPathGrammar.h && ' + \
- 'echo #endif ' + \
- '>> $DERIVED_DIR\\XPathGrammar.h && ' + \
- 'del $DERIVED_DIR\\XPathGrammar.hpp')
-
-env.Command(['$DERIVED_DIR/CSSGrammar.cpp',
- '$DERIVED_DIR/CSSGrammar.h'],
- ['$WEBKIT_PORT_DIR/css/CSSGrammar.y'],
- '$YACC -d -p cssyy ${SOURCES[0].posix} -o ${TARGET.posix} && ' + \
- 'echo #ifndef CSSGrammar_h ' + \
- '> $DERIVED_DIR\\CSSGrammar.h && ' + \
- 'echo #define CSSGrammar_h ' + \
- '>> $DERIVED_DIR\\CSSGrammar.h && ' + \
- 'type $DERIVED_DIR\\CSSGrammar.hpp ' + \
- '>> $DERIVED_DIR\\CSSGrammar.h && ' + \
- 'echo #endif ' + \
- '>> $DERIVED_DIR\\CSSGrammar.h && ' + \
- 'del $DERIVED_DIR\\CSSGrammar.hpp')
+def BuildYacc(env, dir, name, file):
+ env.Command(['$DERIVED_DIR/%s.cpp' % file,
+ '$DERIVED_DIR/%s.h' % file],
+ ['$WEBKIT_PORT_DIR/%s/%s.y' % (dir, file)],
+ ('$YACC -d -p %syy ${SOURCES[0].posix} ' % name +
+ '-o ${TARGET.posix} && ' +
+ '(echo \#ifndef %s_h;' % file +
+ ' echo \#define %s_h;' % file +
+ ' cat $DERIVED_DIR/%s.hpp;' % file +
+ ' echo \#endif) >> $DERIVED_DIR/%s.h && ' % file +
+ 'rm $DERIVED_DIR/%s.hpp' % file))
+
+BuildYacc(env, 'xml', 'xpath', 'XPathGrammar')
+BuildYacc(env, 'css', 'css', 'CSSGrammar')
# TODO(bradnelson): need to add in error checking