diff options
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | src/roff/groff/Makefile.sub | 50 |
2 files changed, 51 insertions, 17 deletions
@@ -1,3 +1,10 @@ +2013-04-28 Bernd Warken <groff-bernd.warken-72@web.de> +2013-04-28 Werner LEMBERG <wl@gnu.org> + + * src/roff/groff/Makefile.sub: Use `make' variables to get + `groff' options from `getopt' in `groff.cpp'. Create 2 files + `groff_opts_no_arg.txt' and `groff_opts_with_arg.txt'. + 2013-04-26 Bernd Warken <groff-bernd.warken-72@web.de> * src/roff/groff/read_groff_options.pl: Remove this file. It's @@ -11,7 +18,8 @@ Various minor fixes. - * INSTALL.gen: Take the newest version from the `gnulib' repository. + * INSTALL.gen: Take the newest version from the `gnulib' + repository. * configure: Regenerated. @@ -20,13 +28,13 @@ * INSTALL.gen: Restore an older version from `2006' in `groff-1.21'. - * FOR-RELEASE: New file which describes how to prepare `groff' for - a new release. + * FOR-RELEASE: New file which describes how to prepare `groff' + for a new release. 2013-04-26 Bernd Warken <groff-bernd.warken-72@web.de> - * src/roff/groff/read_groff_options.pl: Reads `groff' options from - `groff.cpp' and writes them into the file `groff_options.info'. + * src/roff/groff/read_groff_options.pl: Reads `groff' options from `groff.cpp' and writes them into the file + `groff_options.info'. * src/roff/groff/Makefile.sub: Have the generated file `groff_options.info' be installed into the `groff libdir'. diff --git a/src/roff/groff/Makefile.sub b/src/roff/groff/Makefile.sub index 8fd89cdb..f345c642 100644 --- a/src/roff/groff/Makefile.sub +++ b/src/roff/groff/Makefile.sub @@ -5,7 +5,7 @@ # Copyright (C) 1993-2013 # Free Software Foundation, Inc. -# Last update: 26 Apr 2013 +# Last update: 28 Apr 2013 # `groff' is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -31,26 +31,52 @@ CCSRCS=$(srcdir)/groff.cpp CSRCS=$(srcdir)/pipeline.c HDRS=$(srcdir)/pipeline.h -MOSTLYCLEANADD=groff_options.txt +GROFF_OPTS_OUTPUT := groff_opts_no_arg.txt \ + groff_opts_with_arg.txt + +MOSTLYCLEANADD := $(GROFF_OPTS_OUTPUT) RM=rm -f -all: groff_options.txt +OPTS := $(shell $(EGREP) -e ':.*:.*:' groff.cpp \ + | sed -e 's/[ \t",]//g') + +OPTS_NO_ARG := $(shell echo $(OPTS) \ + | sed -e 's/[a-zA-Z]://g') + +OPTS_WITH_ARG := $(shell echo $(OPTS) \ + | sed "s/[$(OPTS_NO_ARG):]//g") + +show: + @echo opts: $(OPTS) + @echo no: $(OPTS_NO_ARG) + @echo optarg: $(OPTS_WITH_ARG) + +.PHONY: all +all: groff.cpp $(GROFF_OPTS_OUTPUT) + +groff_opts_no_arg.txt: + $(RM) $@ + echo $(OPTS_NO_ARG) > $@ -groff_options.txt: groff.cpp - $(EGREP) -A2 -e 'getopt' $< \ - | sed -n -e '/"/p' \ - | sed -e 's/^[^"\]*"//' \ - | sed -e 's/"[^"]*$$//' > $@ +groff_opts_with_arg.txt: + $(RM) $@ + echo $(OPTS_WITH_ARG) > $@ -install_data: groff_options.txt +.PHONY: install_data +install_data: $(GROFF_OPTS_OUTPUT) -test -d $(DESTDIR)$(libprogramdir) \ || $(mkinstalldirs) $(DESTDIR)$(libprogramdir) - $(RM) $(DESTDIR)$(libprogramdir)/$< - $(INSTALL_SCRIPT) $< $(DESTDIR)$(libprogramdir) + for f in $(GROFF_OPTS_OUTPUT); do \ + $(RM) $(DESTDIR)$(libprogramdir)/$$f; \ + $(INSTALL_SCRIPT) $$f $(DESTDIR)$(libprogramdir); \ + done +.PHONY: uninstall_data uninstall_sub: - $(RM) $(DESTDIR)$(libprogramdir)/groff_options.txt + for f in $(GROFF_OPTS_OUTPUT); do \ + $(RM) $(DESTDIR)$(libprogramdir)/$$f; \ + done -test -d $(DESTDIR)$(libprogramdir) \ && -rmdir $(DESTDIR)$(libprogramdir) |