Add flex support in configure scripts.

This commit is contained in:
Mateusz Hromada 2009-06-06 13:40:55 +02:00
parent 63a5739817
commit 44f59b8b51
4 changed files with 12 additions and 2 deletions

View File

@ -10,6 +10,7 @@ DEFAULT_PROJECT_MAIL='utt@wmid.amu.edu.pl'
DEFAULT_SHELL='/bin/sh'
DEFAULT_CC='/usr/bin/gcc'
DEFAULT_BISON='/usr/bin/bison'
DEFAULT_FLEX='/usr/bin/flex'
DEFAULT_RM='/bin/rm -f'
DEFAULT_RMDIR='/bin/rm -rf'
DEFAULT_TEST='/usr/bin/test'

View File

@ -13,6 +13,7 @@ if [ -z "$PROJECT_MAIL" ]; then PROJECT_MAIL=$DEFAULT_PROJECT_MAIL;
if [ -z "$SHELL" ]; then SHELL=$DEFAULT_SHELL; fi
if [ -z "$CC" ]; then CC=$DEFAULT_CC; fi
if [ -z "$BISON" ]; then BISON=$DEFAULT_BISON; fi
if [ -z "$FLEX" ]; then FLEX=$DEFAULT_FLEX; fi
if [ -z "$RM" ]; then RM=$DEFAULT_RM; fi
if [ -z "$RMDIR" ]; then RMDIR=$DEFAULT_RMDIR; fi
if [ -z "$TEST" ]; then TEST=$DEFAULT_TEST; fi
@ -64,6 +65,7 @@ do
SHELL=*) SHELL="$value" ;;
CC=*) CC="$value" ;;
BISON=*) BISON="$value" ;;
FLEX=*) FLEX="$value" ;;
RM=*) RM="$value" ;;
RMDIR=*) RMDIR="$value" ;;
TEST=*) TEST="$value" ;;

View File

@ -7,6 +7,7 @@ cat << EOF > Makefile
SHELL = $SHELL
CC = $CC
BISON = $BISON
FLEX = $FLEX
RM = $RM
RMDIR = $RMDIR
TEST = $TEST
@ -37,12 +38,13 @@ ALL_CFLAGS = \$(CFLAGS)
ALL_LDFLAGS = \$(LDFLAGS)
ALL_LDLIBS = \$(LDLIBS)
ALL_BFLAGS = \$(BFLAGS)
ALL_FFLAGS = \$(FFLAGS)
ALL_FFLAGS = -t \$(FFLAGS)
VPATH = ./src
PROGRAMS = tok
TOK_OBJ_FILES = tok.o
TOK_OBJ_FILES = tok.o tok_cmdline.o
TOK_FLEX_FILES = tok.l
CONFIG_FILES = src/config.h Makefile
.SUFFIXES:
@ -66,6 +68,7 @@ help:
clean:
\$(RM) \$(PROGRAMS)
\$(RM) \$(TOK_OBJ_FILES)
\$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
#make -C app clean
.PHONY: distclean
@ -83,6 +86,9 @@ uninstall:
%.o: %.c
\$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
%.o: %.l
\$(FLEX) -t \$< > \$@
%: %.o
\$(CC) \$? -o \$@ \$(ALL_LDFLAGS) \$(ALL_CFLAGS) \$(ALL_LDLIBS)

View File

@ -28,6 +28,7 @@ Configuration summary
SHELL : $SHELL
CC : $CC
BISON : $BISON
FLEX : $FLEX
RM : $RM
RMDIR : $RMDIR
TEST : $TEST