Skip to content

Commit

Permalink
move flex program sources into src/ directory
Browse files Browse the repository at this point in the history
The *.[chly] sources are now in the src directory. This implies a
bunch of changes in Makefile.am and friends to account for the new
location. The .gitignore files are now more local to places where various object files and generated source files occur.
  • Loading branch information
westes committed Feb 16, 2014
1 parent 638d8a1 commit 269620b
Show file tree
Hide file tree
Showing 41 changed files with 191 additions and 200 deletions.
36 changes: 8 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,22 @@
*.orig
*.rej
*.tar.bz2
*.tar.gz
.bootstrap
*.tar.xz
*~
.deps
.libs
ABOUT-NLS
ChangeLog
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache
compile
conf.in
config.cache
config.guess
config.h
build-aux
config.log
config.status*
config.sub
config.status
configure
depcomp
flex
flex-*
install-sh
missing
libtool
mkinstalldirs
parse.c
parse.h
scan.c
skel.c
stamp-*
config.rpath
ylwrap
*.o
.libs
*.lo
*.la
libtool
ltmain.sh
*~
*.orig
*.rej
147 changes: 3 additions & 144 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,180 +33,39 @@
# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
# additional info.

AM_YFLAGS = -d
ACLOCAL_AMFLAGS = -I m4
m4 = @M4@
indent = @INDENT@

bin_PROGRAMS = flex
lib_LTLIBRARIES = \
libfl.la \
libfl_pic.la

flex_SOURCES = \
ccl.c \
dfa.c \
ecs.c \
scanflags.c \
gen.c \
main.c \
misc.c \
nfa.c \
parse.y \
scan.l \
skel.c \
sym.c \
tblcmp.c \
yylex.c \
options.c \
scanopt.c \
buf.c \
tables.c \
tables_shared.c \
filter.c \
regex.c


LDADD = lib/libcompat.la

libfl_la_SOURCES = \
libmain.c \
libyywrap.c

libfl_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@

libfl_pic_la_SOURCES = \
libmain.c \
libyywrap.c

libfl_pic_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@

noinst_HEADERS = \
flexdef.h \
flexint.h \
version.h \
options.h \
scanopt.h \
tables.h \
tables_shared.h

include_HEADERS = \
FlexLexer.h

dist_doc_DATA = \
AUTHORS \
COPYING \
NEWS \
ONEWS \
README \
TODO
README

EXTRA_DIST = \
.indent.pro \
ABOUT-NLS \
INSTALL \
autogen.sh \
flex.skl \
mkskel.sh \
config.rpath \
gettext.h

BUILT_SOURCES = \
skel.c
config.rpath

SUBDIRS = \
lib \
. \
src \
doc \
examples \
po \
tests

localedir = $(datadir)/locale
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl
LIBS = @LIBINTL@ @LIBS@

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

# Explicitly describe dependencies.
# You can recreate this with `gcc -I. -MM *.c'
buf.o: buf.c flexdef.h flexint.h
ccl.o: ccl.c flexdef.h flexint.h
dfa.o: dfa.c flexdef.h flexint.h tables.h tables_shared.h
ecs.o: ecs.c flexdef.h flexint.h
scanflags.o: scanflags.c flexdef.h flexint.h
gen.o: gen.c flexdef.h flexint.h tables.h tables_shared.h
libmain.o: libmain.c
libyywrap.o: libyywrap.c
main.o: main.c flexdef.h flexint.h version.h options.h scanopt.h \
tables.h tables_shared.h
misc.o: misc.c flexdef.h flexint.h tables.h tables_shared.h
nfa.o: nfa.c flexdef.h flexint.h
options.o: options.c options.h scanopt.h flexdef.h flexint.h
parse.o: parse.c flexdef.h flexint.h tables.h tables_shared.h
scan.o: scan.c flexdef.h flexint.h parse.h
scanopt.o: scanopt.c flexdef.h flexint.h scanopt.h
skel.o: skel.c flexdef.h flexint.h
sym.o: sym.c flexdef.h flexint.h
tables.o: tables.c flexdef.h flexint.h tables.h tables_shared.h
tables_shared.o: tables_shared.c flexdef.h flexint.h tables.h \
tables_shared.h
tblcmp.o: tblcmp.c flexdef.h flexint.h
yylex.o: yylex.c flexdef.h flexint.h parse.h
filter.o: filter.c flexdef.h flexint.h

# Create the ChangeLog, but only if we're inside a git working directory

ChangeLog: $(srcdir)/tools/git2cl
if [ -d $(srcdir)/.git ] ; then \
$(srcdir)/tools/git2cl > $@ \
; fi

# Run GNU indent on sources. Don't run this unless all the sources compile cleanly.
#
# Whole idea:
# 1. Check for .indent.pro, otherwise indent will use unknown
# settings, or worse, the GNU defaults.)
# 2. Check that this is GNU indent.
# 3. Make sure to process only the NON-generated .c and .h files.
# 4. Run indent twice per file. The first time is a test.
# Otherwise, indent overwrites your file even if it fails!
indentfiles = \
buf.c \
ccl.c \
dfa.c \
ecs.c \
scanflags.c \
filter.c \
flexdef.h \
gen.c \
libmain.c \
libyywrap.c \
main.c \
misc.c \
nfa.c \
options.c \
options.h \
regex.c \
scanopt.c \
scanopt.h \
sym.c \
tables.c \
tables.h \
tables_shared.c \
tables_shared.h \
tblcmp.c

indent:
if [ -f .indent.pro ] ; then \
for f in $(indentfiles);\
do\
echo indenting $$f ;\
$(indent) < $$f >/dev/null && indent $$f || echo $$f FAILED to indent ;\
done \
fi

install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
Expand Down
10 changes: 6 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@

# autoconf requirements and initialization

AC_INIT([the fast lexical analyser generator], [2.6.0
AC_INIT([the fast lexical analyser generator], [2.6.0],
[[email protected]], [flex])
SHARED_VERSION_INFO="2:0:0"
AC_SUBST(SHARED_VERSION_INFO)
AC_CONFIG_SRCDIR([scan.l])
AC_CONFIG_SRCDIR([src/scan.l])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([gnu check-news std-options dist-bzip2 dist-xz 1.10])
AC_CONFIG_HEADER([config.h:conf.in])
AC_CONFIG_HEADER([src/config.h])
AC_CONFIG_LIBOBJ_DIR([lib])
AC_CONFIG_MACRO_DIR([m4])

# checks for programs

Expand Down Expand Up @@ -118,6 +119,7 @@ examples/fastwc/Makefile
examples/manual/Makefile
lib/Makefile
po/Makefile.in
src/Makefile
tests/Makefile
tests/TEMPLATE/Makefile
tests/test-array-nr/Makefile
Expand Down
41 changes: 19 additions & 22 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
*.aux
*.cp
*.cps
*.dvi
*.fn
*.fns
*.hk
*.hks
*.info*
*.ky
*.log
*.op
*.ops
*.pg
*.toc
*.tp
*.tps
*.vr
*.vrs
flex.aux
flex.cp
flex.cps
flex.dvi
flex.fn
flex.fns
flex.hk
flex.hks
flex.info*
flex.ky
flex.log
flex.op
flex.ops
flex.pg
flex.toc
flex.tp
flex.tps
flex.vr
flex.vrs
Makefile
Makefile.in
flex.1
flex.pdf
flex.ps
mdate-sh
stamp-*
version.texi
flex.html
texinfo.tex
4 changes: 2 additions & 2 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ CLEANFILES = \
flex.vr \
flex.vrs

$(dist_man_MANS): $(top_srcdir)/main.c
$(dist_man_MANS): $(top_srcdir)/src/main.c
for i in $(dist_man_MANS) ; do \
$(help2man) --name='$(PACKAGE_NAME)' \
--section=`echo $$i | sed -e 's/.*\.\([^.]*\)$$/\1/'` \
../flex$(EXEEXT) > $$i || rm -f $$i ; \
$(top_srcdir)/src/flex$(EXEEXT) > $$i || rm -f $$i ; \
done
3 changes: 3 additions & 0 deletions lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.la
*.lo
*.o
10 changes: 10 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.la
*.lo
*.o
config.h
config.h.in
flex
parse.c
parse.h
scan.c
skel.c
File renamed without changes.
Loading

0 comments on commit 269620b

Please sign in to comment.