]> granicus.if.org Git - flex/commitdiff
Built flex with itself.
authorWill Estes <westes575@gmail.com>
Mon, 7 Dec 2015 20:37:01 +0000 (15:37 -0500)
committerWill Estes <westes575@gmail.com>
Mon, 7 Dec 2015 20:37:01 +0000 (15:37 -0500)
Changes in scan.l need to be built into flex with the same version of
flex in some cases. Since this build requirement is minimal, we simply
bootstrap flex unconditionally.

We intentionally exclude from version control the bootstrap artifacts as
the extra copy of the lexer, the intermediate scanner and the bootstrap
executable are not of interest.

src/.gitignore
src/Makefile.am

index f3a923404ebae6636a674c806b30a6000fc73890..1daa9f827dd8877096c65e937b8f395b006f03dd 100644 (file)
@@ -8,3 +8,5 @@ parse.c
 parse.h
 scan.c
 skel.c
+stage1scan.[cl]
+stage1flex
index 475120c94cc3de67e39b97f426c0131abb151ed1..97e0317bc7ba52f446ac53c7718675f097dc8365 100644 (file)
@@ -6,11 +6,20 @@ LIBS = @LIBINTL@ @LIBS@
 m4 = @M4@
 
 bin_PROGRAMS = flex
+noinst_PROGRAMS = stage1flex
 lib_LTLIBRARIES = \
        libfl.la \
        libfl_pic.la
 
+stage1flex_SOURCES = \
+       scan.l \
+       $(COMMON_SOURCES)
+
 flex_SOURCES = \
+       stage1scan.l \
+       $(COMMON_SOURCES)
+
+COMMON_SOURCES = \
        buf.c \
        ccl.c \
        dfa.c \
@@ -23,7 +32,6 @@ flex_SOURCES = \
        options.c \
        parse.y \
        regex.c \
-       scan.l \
        scanflags.c \
        scanopt.c \
        skel.c \
@@ -64,6 +72,8 @@ EXTRA_DIST = \
        mkskel.sh \
        gettext.h
 
+DISTCLEANFILES = stage1scan.c
+
 MAINTAINERCLEANFILES = skel.c
 
 $(srcdir)/skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
@@ -76,6 +86,12 @@ $(srcdir)/skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
          $(SHELL) $(srcdir)/mkskel.sh >skel.c.tmp
        mv skel.c.tmp $(srcdir)/skel.c
 
+stage1scan.l: scan.l
+       cp $(srcdir)/scan.l $(srcdir)/stage1scan.l
+
+stage1scan.c: stage1scan.l stage1flex$(EXEEXT)
+       $(top_builddir)/src/stage1flex$(EXEEXT) -o $@ $<
+
 # Explicitly describe dependencies.
 # You can recreate this with `gcc -I. -MM *.c'
 buf.o: buf.c flexdef.h flexint.h