Page MenuHomeFreeBSD

Sort sample Makefile to be more inline with chapter guidelines
ClosedPublic

Authored by ultima on Jul 7 2017, 7:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 9:54 PM
Unknown Object (File)
Thu, Apr 11, 3:03 PM
Unknown Object (File)
Dec 20 2023, 3:54 AM
Unknown Object (File)
Nov 14 2023, 7:00 PM
Unknown Object (File)
Nov 9 2023, 6:34 AM
Unknown Object (File)
Nov 8 2023, 11:15 PM
Unknown Object (File)
Nov 8 2023, 1:20 AM
Unknown Object (File)
Nov 4 2023, 2:15 AM
Subscribers
None

Details

Summary

The sample Makefile is a bit out of order. This patch will sort the sample Makefile to be more inline with the following sections of the chapter.

Reviewed by\: lifanov (mentor), matthew (mentor), docguru
Approved by\: lifanov (mentor), matthew (mentor), docguru
Differential Revision\: https://reviews.freebsd.org/DXXXXX

One other thing I would like to point out. The USES and USE_x
chapter doesn't mention anything about variables like
GNU_CONFIGURE and WRKSRC. It maybe a good idea to make it more
clear that this section block is for configuring not just
strictly for USES and USE_x. Another alternative is making a
new section block under the USES and USE_x for the other
configuration variables. The former is probably best.

Diff Detail

Repository
rD FreeBSD doc repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Combind the two USES as the Makefile should never have two USES variables.

It's mat who does most of the work on the Porter's Handbook.

en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
73 ↗(On Diff #30548)

This has a different effect than the original code, since in:

USES= gmake
USES= imake

the 2nd line cancels out the first... However, I think your version is more like
what was intended.

  • Add USE_GITHUB and GH_* Under USES
  • Added OPTION section to the sample Makefile
en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
80 ↗(On Diff #30557)

Ah, sorry whitespace change isn't relevant

Removed whitespace change

en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
59 ↗(On Diff #30558)

while you are changing this file, s/we no longer accept/we do not accept/

89 ↗(On Diff #30558)

maybe add an OPTIONS_SUB=yes here.

73 ↗(On Diff #30548)

No, this, here, is not supposed to be a working Makefile, it is supposed to show what you might want. Using both at the same time, here, is a bad idea. It kinda tells you that you are going to need both, whereas there are only 6 ports using both, out of the 270+ using imake and 4k using gmake.

So I would rather this be kept as it was, two separate bits.

GNU_CONFIGURE implies USE_CONFIGURE, so it can be kept with the USE_* block. Maybe I'll change GNU_CONFIGURE to USE_CONFIGURE=gnu.

  • Changed line 59 as suggested
  • Reverted the gmake/imake merge
  • Added OPTION_SUB with small comment
ultima marked an inline comment as done.
  • Added new section, Standard bsd.port.mk Variables
en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
75 ↗(On Diff #30738)

should probably add a comment above this to separate it from imake.

91 ↗(On Diff #30738)

s/add/change/ or something less terse.

493–495 ↗(On Diff #30738)

You should probably add some examples here, this is too vague.

en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
52 ↗(On Diff #30738)

Let's make these real DocBook callouts so they are not mixed with the actual Makefile contents.
See https://www.freebsd.org/doc/en_US.ISO8859-1/books/fdp-primer/docbook-markup-block-elements.html#docbook-markup-callouts

493 ↗(On Diff #30738)

s/are definable/can be defined/

494 ↗(On Diff #30738)

Remove "the", and "belong to" is kind of confusing. "belong in" is a little better, but how is the reader supposed to know where things belong?

73 ↗(On Diff #30548)

Maybe this is not a good example any more. If multiple options are to be shown, better to show a couple of complete, working sample Makefiles rather than one that does not work as shown.

ultima marked 4 inline comments as done.

Added more details to new section, added callouts but will probably require revision.

ultima added inline comments.
en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
120 ↗(On Diff #30795)

I think the callout list is supposed to be under the programlisting, but I'm not sure what this block should be, or is this correct?

52 ↗(On Diff #30738)

Not sure I completely understand how the callouts work, can you check if this looks correct? If so, should this be done for the rest of the sample Makefile?

493–495 ↗(On Diff #30738)

I think this section is looking much better now!

en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
73 ↗(On Diff #30548)

It never was a good example, it tells you what kind of stuff you can put in the Makefile, and where, but it never was a working example of what to do exactly.
I am not sure it makes sense to have multiple examples either, they would probably get outdated fast.

ultima added inline comments.
en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
73 ↗(On Diff #30548)

If this samples [ ]comments are all converted to callouts, combining the USES and adding a call out next to them will make it easily understood that they they are for a specific purpose. I think the callout suggestion is a good idea, I am worried though that in the end there will be so many callouts that this sample won't look so great.

(please, pkg install docproj and run make in that directory to make sure it builds)

en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
52 ↗(On Diff #30795)

The ref is co-patch-dist-strip.

117 ↗(On Diff #30795)

Either <literal>${WRKSRC}</literal> or <filename>${WRKSRC}</filename>

Also, at the end, it should be </para>

120 ↗(On Diff #30795)

It won't build with the calloutlist inside the programlisting.

497 ↗(On Diff #30795)

dupplicated id.

en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
52 ↗(On Diff #30738)

Well, if all the [...] go into callouts, the page will be unreadable, there will be 20+ callouts, and people will keep scrolling up and down to figure out what means what.

Removed Removed calloutlist bits. While I like this idea, I would rather a docs committer make these changes. I also feel that the page maybe harder to read as a result, going to leave this out of the commit.

I also created a patch and added it to misc/freebsd-doc-en to build for QA. I'm not familiar with proper QA for docs, but after creating the patch and adding it in files/patch-file.diff, it builds correctly.

en_US.ISO8859-1/books/porters-handbook/porting-samplem/chapter.xml
500–501 ↗(On Diff #31017)

Move the replaceable bits inside varname.

502 ↗(On Diff #31017)

Please remove the evil PORTDATA, we want to remove it.

ultima marked an inline comment as done.
  • Corrected varname open/close
  • Slayed a spawn of Evil

Looks ok to me.

Do make sure it builds. (pkg install docproj, and run make in the porters-handbook directory)

Approved, subject to running the build test mat specified.

The build Doesn't have any errors, a single warning, but it is irrelevant to this patch, built in poudriere.

Warning: Object directory not changed from original /root/doc/en_US.ISO8859-1/books/porters-handbook

This revision was automatically updated to reflect the committed changes.