SUDO_LIBS = @SUDO_LIBS@ @AFS_LIBS@ $(LIBS) $(NET_LIBS)
# C preprocessor flags
-CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
+CPPFLAGS = -I$(srcdir) -I. @CPPFLAGS@
# Usually -O and/or -g
CFLAGS = @CFLAGS@
SRCS = alloc.c alloca.c check.c closefrom.c def_data.c defaults.c env.c err.c \
fileops.c find_path.c fnmatch.c getcwd.c getprogname.c getspwuid.c \
- gettime.c goodpath.c interfaces.c ldap.c lex.yy.c lsearch.c logging.c \
- mon_systrace.c parse.c parse.lex parse.yacc set_perms.c sigaction.c \
- snprintf.c strcasecmp.c strerror.c strlcat.c strlcpy.c sudo.c \
- sudo_noexec.c sudo.tab.c sudo_edit.c testsudoers.c tgetpass.c utimes.c \
- visudo.c zero_bytes.c $(AUTH_SRCS)
+ gettime.c goodpath.c gram.c gram.y interfaces.c ldap.c logging.c \
+ match.c mon_systrace.c parse.c set_perms.c sigaction.c snprintf.c \
+ strcasecmp.c strerror.c strlcat.c strlcpy.c sudo.c sudo_noexec.c \
+ sudo_edit.c testsudoers.c tgetpass.c toke.c toke.l utimes.c visudo.c \
+ zero_bytes.c $(AUTH_SRCS)
AUTH_SRCS = auth/afs.c auth/aix_auth.c auth/bsdauth.c auth/dce.c auth/fwtk.c \
auth/kerb4.c auth/kerb5.c auth/pam.c auth/passwd.c auth/rfc1938.c \
auth/sudo_auth.c
HDRS = compat.h def_data.h defaults.h ins_2001.h ins_classic.h ins_csops.h \
- ins_goons.h insults.h interfaces.h logging.h parse.h sudo.h sudo.tab.h \
- version.h auth/sudo_auth.h emul/err.h emul/fnmatch.h emul/search.h \
- emul/utime.h
+ ins_goons.h insults.h interfaces.h logging.h parse.h sudo.h gram.h \
+ version.h auth/sudo_auth.h emul/err.h emul/fnmatch.h emul/utime.h
AUTH_OBJS = sudo_auth.o @AUTH_OBJS@
-PARSEOBJS = sudo.tab.o lex.yy.o defaults.o
+PARSEOBJS = gram.o toke.o match.o defaults.o
SUDOBJS = alloc.o check.o env.o getspwuid.o gettime.o goodpath.o fileops.o \
find_path.o interfaces.o logging.o parse.o set_perms.o sudo.o \
all: $(PROGS)
-.SUFFIXES: .o .c .h .lex .yacc .man .cat .lo
+.SUFFIXES: .o .c .h .l .y .man .cat .lo
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir)
# Uncomment the following if you want "make distclean" to clean the parser
-@DEV@PARSESRCS = sudo.tab.h sudo.tab.c lex.yy.c def_data.c def_data.h
+@DEV@PARSESRCS = gram.h gram.c toke.c def_data.c def_data.h
-# Uncomment the following if you intend to modify parse.yacc
-@DEV@sudo.tab.c sudo.tab.h: parse.yacc
-@DEV@ rm -f sudo.tab.h sudo.tab.c
-@DEV@ $(YACC) -d -b sudo $(srcdir)/parse.yacc
+# Uncomment the $(YACC) and mv lines if you intend to modify gram.y
+gram.c gram.h: gram.y
+@DEV@ $(YACC) -d $(srcdir)/gram.y
+@DEV@ mv -f y.tab.c gram.c
+@DEV@ mv -f y.tab.h gram.h
+ -@true
-# Uncomment the following if you intend to modify parse.lex
-@DEV@lex.yy.c: parse.lex
-@DEV@ rm -f lex.yy.c
-@DEV@ $(LEX) $(srcdir)/parse.lex
+# Uncomment the $(LEX) and mv lines if you intend to modify toke.l
+toke.c: toke.l
+@DEV@ $(LEX) $(srcdir)/toke.l
+@DEV@ mv -f lex.yy.c toke.c
+ -@true
# Uncomment the following if you intend to modify def_data.in
@DEV@def_data.h def_data.c: def_data.in
sudo.o: sudo.c $(SUDODEP) interfaces.h version.h
interfaces.o: interfaces.c $(SUDODEP) interfaces.h
testsudoers.o: testsudoers.c $(SUDODEP) parse.h interfaces.h
-parse.o: parse.c $(SUDODEP) parse.h interfaces.h
-lex.yy.o: lex.yy.c $(SUDODEP) parse.h sudo.tab.h
-sudo.tab.o: sudo.tab.c $(SUDODEP) parse.h sudo.tab.c sudo.tab.h
+match.o: match.c $(SUDODEP) parse.h interfaces.h
+parse.o: parse.c $(SUDODEP) parse.h
+toke.o: toke.c $(SUDODEP) parse.h gram.h
+gram.o: gram.c $(SUDODEP) parse.h gram.c gram.h
defaults.o: defaults.c $(SUDODEP) def_data.c auth/sudo_auth.h
fnmatch.o: fnmatch.c config.h compat.h emul/fnmatch.h
getcwd.o: getcwd.c config.h compat.h
-lsearch.o: lsearch.c config.h compat.h emul/search.h
snprintf.o: snprintf.c config.h compat.h
strcasecmp.o: strcasecmp.c config.h
strlcat.o: strlcat.c config.h