Next: , Previous: , Up: Building your Emodule   [Contents][Index]


3.2 Compiling and linking your emodule

Basically using autotools and libtool your emodule is compiled with almost a one liner:

module_LTLIBRARIES = my-module
my_module_SOURCES = source1.c source2.c …
my_module_LDFLAGS = -module
Makefile.am assuming moduledir is properly defined.

It becomes a wee bit more complex than that if you define lisp bindings for which documentation strings are supposed to be exported.

module_LTLIBRARIES = my-module.la
my_module_la_SOURCES = source1.c source2.c …
nodist_my_module_la_SOURCES = source.doc.c
my_module_la_LDFLAGS = -module
BUILT_SOURCES = source.doc.c

SUFFIXES = .doc.c
source.doc.c: $(my_module_la_SOURCES)
	$(make_docfile) --modname $* -E $ $^
Makefile.am for emodule ‘my-module’ with built
documentation strings

Note: In both examples we assume that you defined a (make) variable moduledir. The final emodule will be installed there. In the second example we also assume that the variable make_docfile points to the make-docfile utility.