pcb-rnd knowledge pool
M4 footprints: howto
m4fp_howto by Tibor 'Igor2' Palinkas on 2020-11-22
Tags: howto, m4, parametric, footprint
Abstract: How to use old geda/pcb M4 footprints as parametric footprint in pcb-rnd.
For pcb-rnd a parametric footprint is any executable, compiled program or script, written in any programming language your system is capable to handle, as long as it prints a footprint on its stdout. Even the output footprint file format is arbitrary: can be anything pcb-rnd can load. pcb-rnd passes on parameters as command line arguments.
For old geda/pcb m4 footprints , this means: since m4 can not directly handle command line arguments, a thin shell wrapper is placed in the library that converts command line arguments to an m4 call.
2. make sure dil is executable, e.g. chmod 755 dil
3.a. run pcb-rnd, open the library window and type in the filter box (bottom left):
dil(dip8 U1 opamp 8 300)
3.b. or specify dil(dip8 U1 opamp 8 300) as the footprint attribute in your schematics and do an import schematics
3.c. or specify dil(dip8 U1 opamp 8 300) as the footprint attribute in your schematics and run gsch2pcb-rnd
(The exact meaning of the arguments is specified by the m4 script; for this example dil() copied from geda/pcb 1.7, please look at the comments in dil.inc )