"Alfred M. Szmidt" <[email protected]> writes: > > +telnet.1: $(top_srcdir)/telnet/main.c $(top_srcdir)/configure.ac > > + $(HELP2MAN) \ > > + --name="User interface to TELNET" \ > > + --output=$@ $(top_builddir)/telnet/telnet$(EXEEXT) > > > > Is there no easier way to do this than duplicate each rule? > > The rules aren't completely similar, several things will vary between > each man page: > > 1) the --name parameter is different for each tool (but maybe a .x > file is a better idea here), and > > 2) the dependencies will be different for each tool, and > > 3) the binary name to use will also be different for each tool. > > Ideas for better approaches welcome, I don't see any _easy_ solution > that reduces redundancy, although there may be some more complex > solutions that would reduce redundancy. > > I'm not sure if more complexity is better than less redundancy though, > both are unwanted properties. > > How about something like (depends on GNU Make, but I do not see that > as a problem),
I think adding a dependency on GNU make for people who build InetUtils should be avoided if we can. However looking more at CoreUtils man/Makefile.am I think we can come up with a generic rule that will work without GNU make. I'll propose a new patch later. /Simon > # $(call help2man-rule, TOOL-NAME, DESC, DEPEND) > # Target for help2man generation. > define help2man-rule > $1.1: $(top_srcdir)/$1/$3 $(top_srcdir)/configure.ac > $(HELP2MAN) \ > --name="$2" \ > --output=$@ $(top_builddir)/$1/$1$(EXEEXT) > endef > > $(call help2man-rule, telnet, Telnet client, main.c) > $(call help2man-rule, rsh, Remote shell client, rsh.c) > ...
