From: PatR Date: Sun, 6 Dec 2015 07:26:41 +0000 (-0800) Subject: unix/Makefile.utl: tweak lex/yacc postprocessing X-Git-Tag: NetHack-3.6.0_RC02~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=996c0a3741930d078b2ba1689cee3913bf605c4a;p=nethack unix/Makefile.utl: tweak lex/yacc postprocessing --- diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index ef1a496da..d5d30426b 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,5 @@ # Makefile for NetHack's utility programs. -# NetHack 3.6 Makefile.utl $NHDT-Date: 1448711183 2015/11/28 11:46:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.26 $ +# NetHack 3.6 Makefile.utl $NHDT-Date: 1449386560 2015/12/06 07:22:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.27 $ # Root of source tree: NHSROOT=.. @@ -235,13 +235,19 @@ lev_lex.o: lev_lex.c $(HACK_H) ../include/lev_comp.h ../include/sp_lev.h lev_yacc.c: lev_comp.y $(YACC) $(YACCDIST) -d lev_comp.y - sed -e 's#"$(YTABC)"#"$@"#' $(YTABC) > $@ && rm $(YTABC) + sed -e 's#"$(YTABC)"#"$@"#' -e 's#$(YTABC):#$@:#' $(YTABC) > $@ \ + && rm $(YTABC) sed -e 's#"$(YTABH)"#"lev_comp.h"#' $(YTABH) > ../include/lev_comp.h \ && rm $(YTABH) lev_lex.c: lev_comp.l $(LEX) $(FLEXDIST) lev_comp.l - sed -e 's#"$(LEXYYC)"#"$@"#' $(LEXYYC) > $@ && rm $(LEXYYC) + sed -e 's#"$(LEXYYC)"#"$@"#' -e 's# *$$##' $(LEXYYC) > $@ \ + && rm $(LEXYYC) +# note: flex code construction using m4 macros results in some trailing +# spaces; is basic RE substitute for +# and we don't bother stripping trailing tabs because that gets messy; +# make expands into which is RE end-of-line. # with all of extern.h's functions to complain about, we drown in # 'defined but not used' without -u @@ -267,13 +273,16 @@ dgn_lex.o: dgn_lex.c $(CONFIG_H) ../include/dgn_comp.h ../include/dgn_file.h dgn_yacc.c: dgn_comp.y $(YACC) $(YACCDIST) -d dgn_comp.y - sed -e 's#"$(YTABC)"#"$@"#' $(YTABC) > $@ && rm $(YTABC) + sed -e 's#"$(YTABC)"#"$@"#' -e 's#$(YTABC):#$@:#' $(YTABC) > $@ \ + && rm $(YTABC) sed -e 's#"$(YTABH)"#"dgn_comp.h"#' $(YTABH) > ../include/dgn_comp.h \ && rm $(YTABH) dgn_lex.c: dgn_comp.l $(LEX) $(FLEXDIST) dgn_comp.l - sed -e 's#"$(LEXYYC)"#"$@"#' $(LEXYYC) > $@ && rm $(LEXYYC) + sed -e 's#"$(LEXYYC)"#"$@"#' -e 's# *$$##' $(LEXYYC) > $@ \ + && rm $(LEXYYC) +# note: is basic RE substitute for # with all of extern.h's functions to complain about, we drown in # 'defined but not used' without -u