1# This file is part of flex. 2 3# Redistribution and use in source and binary forms, with or without 4# modification, are permitted provided that the following conditions 5# are met: 6 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# 2. Redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the 11# documentation and/or other materials provided with the distribution. 12 13# Neither the name of the University nor the names of its contributors 14# may be used to endorse or promote products derived from this software 15# without specific prior written permission. 16 17# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 18# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 19# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20# PURPOSE. 21 22# Notes on building: 23 24# Possible values for DEFS: 25# 26# By default, flex generates 8-bit scanners when using table compression, 27# and 7-bit scanners when using uncompressed tables (-f or -F options). 28# For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256" 29# to DEFS. 30# 31# For Vax/VMS, add "-DVMS" to DEFS. 32# 33# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for 34# additional info. 35 36AM_YFLAGS = -d 37ACLOCAL_AMFLAGS = -I m4 38m4 = @M4@ 39indent = @INDENT@ 40 41bin_PROGRAMS = flex 42lib_LTLIBRARIES = \ 43 libfl.la \ 44 libfl_pic.la 45 46flex_SOURCES = \ 47 ccl.c \ 48 dfa.c \ 49 ecs.c \ 50 scanflags.c \ 51 gen.c \ 52 main.c \ 53 misc.c \ 54 nfa.c \ 55 parse.y \ 56 scan.l \ 57 skel.c \ 58 sym.c \ 59 tblcmp.c \ 60 yylex.c \ 61 options.c \ 62 scanopt.c \ 63 buf.c \ 64 tables.c \ 65 tables_shared.c \ 66 filter.c \ 67 regex.c 68 69 70LDADD = lib/libcompat.la 71 72libfl_la_SOURCES = \ 73 libmain.c \ 74 libyywrap.c 75 76libfl_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ 77 78libfl_pic_la_SOURCES = \ 79 libmain.c \ 80 libyywrap.c 81 82libfl_pic_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ 83 84noinst_HEADERS = \ 85 flexdef.h \ 86 flexint.h \ 87 version.h \ 88 options.h \ 89 scanopt.h \ 90 tables.h \ 91 tables_shared.h 92 93include_HEADERS = \ 94 FlexLexer.h 95 96dist_doc_DATA = \ 97 AUTHORS \ 98 COPYING \ 99 NEWS \ 100 ONEWS \ 101 README \ 102 TODO 103 104EXTRA_DIST = \ 105 .indent.pro \ 106 ABOUT-NLS \ 107 INSTALL \ 108 autogen.sh \ 109 flex.skl \ 110 mkskel.sh \ 111 config.rpath \ 112 gettext.h 113 114BUILT_SOURCES = \ 115 skel.c 116 117SUBDIRS = \ 118 lib \ 119 . \ 120 doc \ 121 examples \ 122 po \ 123 tests 124 125localedir = $(datadir)/locale 126AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl 127LIBS = @LIBINTL@ @LIBS@ 128 129skel.c: flex.skl mkskel.sh flexint.h tables_shared.h 130 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 131 132# Explicitly describe dependencies. 133# You can recreate this with `gcc -I. -MM *.c' 134buf.o: buf.c flexdef.h flexint.h 135ccl.o: ccl.c flexdef.h flexint.h 136dfa.o: dfa.c flexdef.h flexint.h tables.h tables_shared.h 137ecs.o: ecs.c flexdef.h flexint.h 138scanflags.o: scanflags.c flexdef.h flexint.h 139gen.o: gen.c flexdef.h flexint.h tables.h tables_shared.h 140libmain.o: libmain.c 141libyywrap.o: libyywrap.c 142main.o: main.c flexdef.h flexint.h version.h options.h scanopt.h \ 143 tables.h tables_shared.h 144misc.o: misc.c flexdef.h flexint.h tables.h tables_shared.h 145nfa.o: nfa.c flexdef.h flexint.h 146options.o: options.c options.h scanopt.h flexdef.h flexint.h 147parse.o: parse.c flexdef.h flexint.h tables.h tables_shared.h 148scan.o: scan.c flexdef.h flexint.h parse.h 149scanopt.o: scanopt.c flexdef.h flexint.h scanopt.h 150skel.o: skel.c flexdef.h flexint.h 151sym.o: sym.c flexdef.h flexint.h 152tables.o: tables.c flexdef.h flexint.h tables.h tables_shared.h 153tables_shared.o: tables_shared.c flexdef.h flexint.h tables.h \ 154 tables_shared.h 155tblcmp.o: tblcmp.c flexdef.h flexint.h 156yylex.o: yylex.c flexdef.h flexint.h parse.h 157filter.o: filter.c flexdef.h flexint.h 158 159# Create the ChangeLog, but only if we're inside a git working directory 160 161ChangeLog: $(srcdir)/tools/git2cl 162 if [ -d $(srcdir)/.git ] ; then \ 163 $(srcdir)/tools/git2cl > $@ \ 164 ; fi 165 166# Run GNU indent on sources. Don't run this unless all the sources compile cleanly. 167# 168# Whole idea: 169# 1. Check for .indent.pro, otherwise indent will use unknown 170# settings, or worse, the GNU defaults.) 171# 2. Check that this is GNU indent. 172# 3. Make sure to process only the NON-generated .c and .h files. 173# 4. Run indent twice per file. The first time is a test. 174# Otherwise, indent overwrites your file even if it fails! 175indentfiles = \ 176 buf.c \ 177 ccl.c \ 178 dfa.c \ 179 ecs.c \ 180 scanflags.c \ 181 filter.c \ 182 flexdef.h \ 183 gen.c \ 184 libmain.c \ 185 libyywrap.c \ 186 main.c \ 187 misc.c \ 188 nfa.c \ 189 options.c \ 190 options.h \ 191 regex.c \ 192 scanopt.c \ 193 scanopt.h \ 194 sym.c \ 195 tables.c \ 196 tables.h \ 197 tables_shared.c \ 198 tables_shared.h \ 199 tblcmp.c 200 201indent: 202 if [ -f .indent.pro ] ; then \ 203 for f in $(indentfiles);\ 204 do\ 205 echo indenting $$f ;\ 206 $(indent) < $$f >/dev/null && indent $$f || echo $$f FAILED to indent ;\ 207 done \ 208 fi 209 210install-exec-hook: 211 cd $(DESTDIR)$(bindir) && \ 212 $(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT) 213 214.PHONY: ChangeLog tags indent 215