]> granicus.if.org Git - flex/commitdiff
Simplify some shell code
authorDemi Obenour <demiobenour@gmail.com>
Sun, 25 Sep 2016 03:35:07 +0000 (23:35 -0400)
committerWill Estes <westes575@gmail.com>
Sun, 25 Sep 2016 22:53:29 +0000 (18:53 -0400)
src/Makefile.am
src/mkskel.sh

index 815f244c641e8979355220d944cf91f5ec12b660..e12483627e28b2c587e34f5bd651baabce82266a 100644 (file)
@@ -81,12 +81,11 @@ DISTCLEANFILES = stage1scan.c
 MAINTAINERCLEANFILES = skel.c
 
 skel.c: flex.skl mkskel.sh flexint.h tables_shared.h tables_shared.c
-       sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' $< | \
+       sed 's/4_/a4_/g; s/m4preproc_/m4_/g' $< | \
          $(m4) -P -I $(srcdir)                                            \
            -DFLEX_MAJOR_VERSION=`   echo $(VERSION)|cut -f 1 -d .`        \
            -DFLEX_MINOR_VERSION=`   echo $(VERSION)|cut -f 2 -d .`        \
            -DFLEX_SUBMINOR_VERSION=`echo $(VERSION)|cut -f 3 -d .` |      \
-         sed 's/m4postproc_/m4_/g' |                                      \
          $(SHELL) $(srcdir)/mkskel.sh > $@.tmp
        mv $@.tmp $@
 
index 02c397a81c96c73dffb6bb2b7248489af9db6eb8..512f1f9b4831eade859b176ad2ae1d230c71dbf8 100755 (executable)
 #  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 #  PURPOSE.
 
-cat <<!
-/* File created from flex.skl via mkskel.sh */
+echo '/* File created from flex.skl via mkskel.sh */
 
 #include "flexdef.h"
 
-const char *skel[] = {
-!
+const char *skel[] = {'
 
-sed 's/\\/&&/g' | sed 's/"/\\"/g' | sed 's/.*/  "&",/'
+sed 's/m4_/m4preproc_/g
+s/a4_/4_/g
+s/[\\"]/\\&/g
+s/.*/  "&",/'
 
-cat <<!
-  0
-};
-!
+echo '  0
+};'