1
0
Fork 0

adjustment for different build dir

This commit is contained in:
Frank Celler 2012-01-04 15:23:58 +01:00
parent fd52e86702
commit e084c89617
7 changed files with 51 additions and 119 deletions

View File

@ -19,73 +19,22 @@ include Makefile.files
## FLEX ## FLEX
################################################################################ ################################################################################
if ENABLE_FLEX JsonParser/%.c: @srcdir@/JsonParser/%.l
@top_srcdir@/config/flex-c.sh $(LEX) "$@" "$^"
@srcdir@/%.c: @srcdir@/%.l
@top_srcdir@/config/flex-c.sh $(LEX) `dirname $@` `basename $^ .l`
else
@srcdir@/%.c: @srcdir@/%.l
@echo '+---------------------------------------------------------------+'
@echo '| WARNING: required FLEX version not found, cannot update files |'
@echo '+---------------------------------------------------------------+'
endif
################################################################################ ################################################################################
## FLEX++ ## FLEX++
################################################################################ ################################################################################
if ENABLE_FLEX V8/%.cpp: @srcdir@/V8/%.ll
@top_srcdir@/config/flex-c++.sh $(LEX) "$@" "$^"
@srcdir@/%.cpp: @srcdir@/%.ll
@top_srcdir@/config/flex-c++.sh $(LEX) `dirname $@` `basename $^ .ll`
else
@srcdir@/%.cpp: @srcdir@/%.ll
@echo '+---------------------------------------------------------------+'
@echo '| WARNING: required FLEX version not found, cannot update files |'
@echo '+---------------------------------------------------------------+'
endif
################################################################################
## BISON
################################################################################
if ENABLE_BISON
@srcdir@/%.cpp: @srcdir@/%.yy
@top_srcdir@/config/bison-c.sh $(BISON) `dirname $@` `basename $^ .yy`
else
@srcdir@/%.cpp: @srcdir@/%.yy
@echo '+----------------------------------------------------------------+'
@echo '| WARNING: required BISON version not found, cannot update files |'
@echo '+----------------------------------------------------------------+'
endif
################################################################################ ################################################################################
## BISON++ ## BISON++
################################################################################ ################################################################################
if ENABLE_BISON JsonParserX/%.cpp: @srcdir@/JsonParserX/%.yy
@top_srcdir@/config/bison-c++.sh $(BISON) "$@" "$^"
@srcdir@/%.cpp: @srcdir@/%.yy
@top_srcdir@/config/bison-c++.sh $(BISON) `dirname $@` `basename $^ .yy`
else
@srcdir@/%.cpp: @srcdir@/%.yy
@echo '+----------------------------------------------------------------+'
@echo '| WARNING: required BISON version not found, cannot update files |'
@echo '+----------------------------------------------------------------+'
endif
################################################################################ ################################################################################
## build information ## build information

View File

@ -219,18 +219,23 @@ BUILT_SOURCES += \
@builddir@/js/js-modules.h @builddir@/js/js-modules.h
@builddir@/js/js-modules.h: @srcdir@/js/modules.js @builddir@/js/js-modules.h: @srcdir@/js/modules.js
@test -d @builddir@/js || mkdir @builddir@/js || true
@top_srcdir@/config/js2c.sh $^ > $@ @top_srcdir@/config/js2c.sh $^ > $@
@builddir@/js/js-json.h: @srcdir@/js/json.js @builddir@/js/js-json.h: @srcdir@/js/json.js
@test -d @builddir@/js || mkdir @builddir@/js || true
@top_srcdir@/config/js2c.sh $^ > $@ @top_srcdir@/config/js2c.sh $^ > $@
@builddir@/js/js-graph.h: @srcdir@/js/graph.js @builddir@/js/js-graph.h: @srcdir@/js/graph.js
@test -d @builddir@/js || mkdir @builddir@/js || true
@top_srcdir@/config/js2c.sh $^ > $@ @top_srcdir@/config/js2c.sh $^ > $@
@builddir@/js/js-shell.h: @srcdir@/js/shell.js @builddir@/js/js-shell.h: @srcdir@/js/shell.js
@test -d @builddir@/js || mkdir @builddir@/js || true
@top_srcdir@/config/js2c.sh $^ > $@ @top_srcdir@/config/js2c.sh $^ > $@
@builddir@/js/js-actions.h: @srcdir@/js/actions.js @builddir@/js/js-actions.h: @srcdir@/js/actions.js
@test -d @builddir@/js || mkdir @builddir@/js || true
@top_srcdir@/config/js2c.sh $^ > $@ @top_srcdir@/config/js2c.sh $^ > $@
################################################################################ ################################################################################

View File

@ -1,22 +1,11 @@
#!/bin/sh #!/bin/sh
BISON="$1" BISON="$1"
SRC="$2" OUTPUT="$2"
DST="$2" INPUT="$3"
FILE="$3"
if test "x$BISON" = x -o "x$SRC" = x -o "x$DST" = x -o "x$FILE" = x; then if test "x$BISON" = x -o "x$OUTPUT" = x -o "x$INPUT" = x; then
echo "usage: $0 <bison> <directory> <file-prefix>" echo "usage: $0 <bison> <output> <input>"
exit 1
fi
if test ! -d "$SRC"; then
echo "$0: expecting '$SRC' to be a directory"
exit 1
fi
if test ! -d "$DST"; then
echo "$0: expecting '$DST' to be a directory"
exit 1 exit 1
fi fi
@ -24,33 +13,34 @@ fi
## bison ## bison
############################################################################# #############################################################################
${BISON} -l -d -ra -S lalr1.cc -o "${DST}/${FILE}.cpp" "${SRC}/${FILE}.yy" ${BISON} -l -d -ra -S lalr1.cc -o ${OUTPUT} ${INPUT}
############################################################################# #############################################################################
## sanity checks ## sanity checks
############################################################################# #############################################################################
test -f ${SRC}/${FILE}.hpp || exit 1 PREFIX=`echo ${OUTPUT} | sed -e 's:\.cpp$::'`
test -f ${SRC}/${FILE}.cpp || exit 1
test -f ${SRC}/position.hh || exit 1 test -f ${PREFIX}.hpp || exit 1
test -f ${PREFIX}.cpp || exit 1
############################################################################# #############################################################################
## rename file ## rename file
############################################################################# #############################################################################
mv ${SRC}/${FILE}.hpp ${SRC}/${FILE}.h || exit 1 mv ${PREFIX}.hpp ${PREFIX}.h || exit 1
############################################################################# #############################################################################
## fix header file name in source, fix defines ## fix header file name in source, fix defines
############################################################################# #############################################################################
sed -e 's:\.hpp:.h:' < ${SRC}/${FILE}.cpp \ sed -e 's:\.hpp:.h:' < ${OUTPUT} \
| sed -e 's:# if YYENABLE_NLS:# if defined(YYENABLE_NLS) \&\& YYENABLE_NLS:' \ | sed -e 's:# if YYENABLE_NLS:# if defined(YYENABLE_NLS) \&\& YYENABLE_NLS:' \
> ${SRC}/${FILE}.cpp.tmp > ${OUTPUT}.tmp
# give some information # give some information
diff -u ${SRC}/${FILE}.cpp ${SRC}/${FILE}.cpp.tmp diff -u ${OUTPUT} ${OUTPUT}.tmp
# and move the files to the final destination # and move the files to the final destination
mv ${SRC}/${FILE}.cpp.tmp ${SRC}/${FILE}.cpp || exit 1 mv ${OUTPUT}.tmp ${OUTPUT} || exit 1

View File

@ -11,12 +11,12 @@ if test -d .svn; then
revision=`svnversion` revision=`svnversion`
else else
if test ! -f "$INFO"; then if test ! -f "$INFO"; then
echo "$0: cannot open info file $INFO" echo "WARNING: cannot open info file $INFO"
exit 1 revision="exported"
fi else
revision=`grep 'Revision:' $INFO | awk '{print $2}'` revision=`grep 'Revision:' $INFO | awk '{print $2}'`
fi fi
fi
if test -z "$revision"; then if test -z "$revision"; then
echo "$0: cannot read revision from file $INFO" echo "$0: cannot read revision from file $INFO"

View File

@ -1,16 +1,11 @@
#!/bin/sh #!/bin/sh
FLEX="$1" FLEX="$1"
DIR="$2" OUTPUT="$2"
FILE="$3" INPUT="$3"
if test "x$FLEX" = "x" -o "x$DIR" = "x" -o "x$FILE" = "x" -o ! -d "$DIR"; then if test "x$FLEX" = "x" -o "x$OUTPUT" = "x" -o "x$INPUT" = "x"; then
echo "usage: $0 <flex> <directory> <file-prefix>" echo "usage: $0 <flex> <output> <input>"
exit 1
fi
if test ! -d "$DIR"; then
echo "$0: expecting '$DIR' to be a directory"
exit 1 exit 1
fi fi
@ -18,24 +13,24 @@ fi
## flex ## flex
############################################################################# #############################################################################
${FLEX} -L -o${DIR}/${FILE}.cpp ${DIR}/${FILE}.ll ${FLEX} -L -o${OUTPUT} ${INPUT}
############################################################################# #############################################################################
## sanity checks ## sanity checks
############################################################################# #############################################################################
test -f ${DIR}/${FILE}.cpp || exit 1 test -f ${OUTPUT} || exit 1
############################################################################# #############################################################################
## fix casts ## fix casts
############################################################################# #############################################################################
cat ${DIR}/${FILE}.cpp \ cat ${OUTPUT} \
| sed -e 's:(yy_n_chars), (size_t) num_to_read );:(yy_n_chars), (int) num_to_read );:' \ | sed -e 's:(yy_n_chars), (size_t) num_to_read );:(yy_n_chars), (int) num_to_read );:' \
> ${DIR}/${FILE}.cpp.tmp > ${OUTPUT}.tmp
# give some information # give some information
diff -u ${DIR}/${FILE}.cpp ${DIR}/${FILE}.cpp.tmp diff -u ${OUTPUT} ${OUTPUT}.tmp
# and move the files to the final destination # and move the files to the final destination
mv ${DIR}/${FILE}.cpp.tmp ${DIR}/${FILE}.cpp || exit 1 mv ${OUTPUT}.tmp ${OUTPUT} || exit 1

View File

@ -1,16 +1,11 @@
#!/bin/sh #!/bin/sh
FLEX="$1" FLEX="$1"
DIR="$2" OUTPUT="$2"
FILE="$3" INPUT="$3"
if test "x$FLEX" = "x" -o "x$DIR" = "x" -o "x$FILE" = "x" -o ! -d "$DIR"; then if test "x$FLEX" = "x" -o "x$OUTPUT" = "x" -o "x$INPUT" = "x"; then
echo "usage: $0 <flex> <directory> <file-prefix>" echo "usage: $0 <flex> <output> <input>"
exit 1
fi
if test ! -d "$DIR"; then
echo "$0: expecting '$DIR' to be a directory"
exit 1 exit 1
fi fi
@ -18,27 +13,25 @@ fi
## flex ## flex
############################################################################# #############################################################################
${FLEX} -L -o${DIR}/${FILE}.c ${DIR}/${FILE}.l ${FLEX} -L -o${OUTPUT} ${INPUT}
############################################################################# #############################################################################
## sanity checks ## sanity checks
############################################################################# #############################################################################
test -f ${DIR}/${FILE}.c || exit 1 test -f ${OUTPUT} || exit 1
############################################################################# #############################################################################
## fix casts ## fix casts
############################################################################# #############################################################################
cat ${DIR}/${FILE}.c \ cat ${OUTPUT} \
| sed -e 's:yy_n_chars, (size_t) num_to_read );:yy_n_chars, (int) num_to_read );:' \ | sed -e 's:yy_n_chars, (size_t) num_to_read );:yy_n_chars, (int) num_to_read );:' \
| sed -e 's:extern int isatty (int );:#ifndef _WIN32\ | awk '$0 == "extern int isatty (int );" {print "#ifndef _WIN32"; print $0; print "#endif"; next;} {print $0}' \
\0\ > ${OUTPUT}.tmp
#endif:' \
> ${DIR}/${FILE}.c.tmp
# give some information # give some information
diff -u ${DIR}/${FILE}.c ${DIR}/${FILE}.c.tmp diff -u ${OUTPUT} ${OUTPUT}.tmp
# and move the files to the final destination # and move the files to the final destination
mv ${DIR}/${FILE}.c.tmp ${DIR}/${FILE}.c || exit 1 mv ${OUTPUT}.tmp ${OUTPUT} || exit 1

View File

@ -3,4 +3,4 @@ NAME=`basename $1 .js`
cat $1 \ cat $1 \
| sed -e 's:\(["\]\):\\\0:g' \ | sed -e 's:\(["\]\):\\\0:g' \
| awk 'BEGIN {print "static string JS_'$NAME' = " } { print " \"" $$0 "\\n\"" } END { print ";"}' | awk 'BEGIN {print "static string JS_'$NAME' = " } { print " \"" $0 "\\n\"" } END { print ";"}'