Signal Eleven
Signal Eleven

Reputation: 241

Make rule for man pages (same rule for multiple extensions)

I have a project that contains a library and some applications, and I am including man pages. I am generating the man pages using ronn, and I have a rule in my makefile that looks like:

%.1 : %.1.ronn
    $(RONN) -r $<

This works well, and I create the man pages using markdown and ronn happily spits out the man pages.

The problem is that not all of my man pages are for section 1 of the manual. I would like to put the library pages in section 3, and I may need other sections later as well. I could define more rules, one for each section, changing the %.1 to %.2, %.3, etc. I was wondering, though, if there is a way to simply do %.n (where n would match any number or maybe single character), to cut down on the number of rules in my makefile.

Is this possible? My google results are not showing anything, and nothing I have tried so far has worked.

Thanks in advance for any help

Upvotes: 0

Views: 104

Answers (1)

2501
2501

Reputation: 25752

Use % instead of %.1, and %.ronn instead of %.1.ronn.

If you have files name.1.ronn, name.2.ronn, the % will match name.1 and name.2.

Upvotes: 1

Related Questions