Previous: Compiling and linking, Up: Building your Emodule [Contents][Index]
The sole purpose of the above examples is to show off. Making emodules has become as easy as making children, but basically you are not restricted to the above way. Hence an assortment of useful clues:
gcc -g -O2 -shared -o my-module.so.0 my-source.c
f77 -g -O2 -shared -o my-module.so.0 my-source.f
sxemacs --make-docfile
and pass all arguments you would
normally pass thereafter.
The target of the example in the previous section then reads:
make_docfile = sxemacs --make-docfile SUFFIXES = .doc.c source.doc.c: $(my_module_la_SOURCES) $(make_docfile) --modname $* -E $ $^
On the other hand, having its suffix be .doc.c facilitates the use of a pattern-based rule in your Makefile when your emodule consists of many single source files which otherwise means that you had to create a ‘file.doc.c’ rule for each file.
We ourselves use the following pattern-based rule:
make_docfile = $(SXEMACS) --make-docfile SUFFIXES = .doc.c .c.doc.c: $(make_docfile) --modname $* -E $ $<
where the SXEMACS variable points to the just built sxemacs binary.
For all make-agnostics the above rule means that given a C file foo.c the rule to create a file foo.doc.c with the documentation strings in it goes:
$(SXEMACS) --make-docfile --modname foo -E foo.doc.c foo.c
when the command is maximally expanded.
make-docfile [--modname <name>] -E <outfile> <infile> [<infile> …]
Previous: Compiling and linking, Up: Building your Emodule [Contents][Index]