]> granicus.if.org Git - flex/commitdiff
Generated skel.c explicitly in srcdir.
authorAkim Demaille <akim@lrde.epita.fr>
Fri, 4 Dec 2015 15:37:03 +0000 (16:37 +0100)
committerWill Estes <westes575@gmail.com>
Fri, 4 Dec 2015 20:07:11 +0000 (15:07 -0500)
Rewrote the target for skel.c to explicitly mention the srcdir. This
should help when building flex from a directory outside the flex
tree. Spread the rule out over several lines to enhance readability.

src/Makefile.am

index 6dc14e8e62fb27fa29d7a78ea556f01db42bbbe4..475120c94cc3de67e39b97f426c0131abb151ed1 100644 (file)
@@ -66,8 +66,15 @@ EXTRA_DIST = \
 
 MAINTAINERCLEANFILES = skel.c
 
-skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
-       sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' $(srcdir)/flex.skl | $(m4) -P -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  >skel.c
+$(srcdir)/skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
+       sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' $(srcdir)/flex.skl | \
+         $(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 >skel.c.tmp
+       mv skel.c.tmp $(srcdir)/skel.c
 
 # Explicitly describe dependencies.
 # You can recreate this with `gcc -I. -MM *.c'