Discussion:
[fpc-pascal] Trouble integrating examples into fpcdoc
Noel Duffy via fpc-pascal
2021-04-05 05:40:47 UTC
Permalink
In the fpcdocs subversion project, there are a number of example
directories each containing one or more small programs and a Makefile.
My question is, is that Makefile automatically generated, or is it
hand-crafted?

I'm writing documentation for the netdb module and want to add some
example programs. I've created the first program and used an example tag
to reference it within netdb.xml, and this works to show the example
code in the generated html. But the example program isn't compiled.

Taking the fpcdocs/linuxex example directory, the Makefile references
the single defined example, ex64.pp, at line 54:

OBJECTS=ex64

This line occurs after this warning:

#######################################################################
# No need to edit after this line.
#######################################################################

Which suggests to me that the Makefiles are generated. But if so, how? I
can't find anything in the Makefile.fpc at the fpcdocs root to reference
them.

On the other hand, the Makefiles are committed to the repository, which
does somewhat suggest that they're not generated.


_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.
Michael Van Canneyt via fpc-pascal
2021-04-05 06:53:52 UTC
Permalink
Post by Noel Duffy via fpc-pascal
In the fpcdocs subversion project, there are a number of example
directories each containing one or more small programs and a Makefile.
My question is, is that Makefile automatically generated, or is it
hand-crafted?
It is hand-crafted.
Post by Noel Duffy via fpc-pascal
I'm writing documentation for the netdb module and want to add some
example programs. I've created the first program and used an example tag
to reference it within netdb.xml, and this works to show the example
code in the generated html. But the example program isn't compiled.
None of the examples are compiled when you make the documentation.
Post by Noel Duffy via fpc-pascal
Taking the fpcdocs/linuxex example directory, the Makefile references
OBJECTS=ex64
#######################################################################
# No need to edit after this line.
#######################################################################
The OBJECTS= line should be before that remark.

Michael.
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/
Noel Duffy via fpc-pascal
2021-04-05 08:30:04 UTC
Permalink
Post by Michael Van Canneyt via fpc-pascal
Post by Noel Duffy via fpc-pascal
In the fpcdocs subversion project, there are a number of example
directories each containing one or more small programs and a Makefile.
My question is, is that Makefile automatically generated, or is it
hand-crafted?
It is hand-crafted.
Great, thanks. That makes the way ahead quite straightforward.
Post by Michael Van Canneyt via fpc-pascal
Post by Noel Duffy via fpc-pascal
I'm writing documentation for the netdb module and want to add some
example programs. I've created the first program and used an example
tag to reference it within netdb.xml, and this works to show the
example code in the generated html. But the example program isn't
compiled.
None of the examples are compiled when you make the documentation.
Yes, I realised after I'd posted it that I should have said when running
"make examples" or "make linuxexamples".

Anyway, I have enough information now to start adding example programs.

_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
https://lists.freepascal.

Loading...