# pcb-rnd hacking - plugin Plug.tmpasm variables

Plug.tmpasm is used for coordinating the build of the plugin. It is written in tmpasm and is processed by scconfig while generating the Makefile. For core (src/) and core plugins (src_plugins/) there is a single central Makefile generated in src/Makefile. The plugin's own Makefile is just a call to the central Makefile for convenience.

Plug.tmpasm is a generic template, its output directly ends up in src/Makefile. This provides the plugin developer some flexibility, but using this feature needs deep understanding of the build system.

For the features that are most commonly needed, the system offers prewritten, turn key solutions. It is strongly recommended to use these features only. These features are accessible through setting /local/rnd/mod/* tmpasm variables (typically with the put and append instructions). The rest of this document lists and explains these variables.

variable | description
--- | ---
/local/rnd/mod | the name of the plugin
/local/rnd/mod/OBJS | a whitespace separated list of local object files to compile, e.g. foo.o
/local/rnd/mod/OBJS_C99 | same as OBJS, but for sources that can be compiled only with a C99 compiler; plugins must not use this variable unless the source depends on 3rd party library which comes with a header that absolutely can not compiled with C89
/local/rnd/mod/CFLAGS |
/local/rnd/mod/LDFLAGS |
/local/rnd/mod/CONF | optional: the name of the conf struct header - if the plugin doesn't have runtime configuration settings, remove this line
/local/rnd/mod/CONFFILE | optional: conf file's internal version: the file name of the conf file (without path) that should be encoded in conf_internal.c
/local/rnd/mod/CONFVAR | optional: conf file's internal version: the variable name to use in conf_internal.c
/local/rnd/mod/YACC | optional: if you have files for yacc-processing, list them without the .y suffix here (whitespace separated list)
/local/rnd/mod/LEX | optional: if you have files for lex-processing, list them without the .l suffix here (whitespace separated list)
/local/rnd/mod/SPHASH | optional: if the plugin uses an sphash (compile time perfect hash), the sphash source file name should be specified in this field