How SEP connects a TeX button to make rule

SEP's TeX builds the framework that connect TeX to a make rule.

TeX and the button

It all starts with an button in your tex document: how did you get a button? You used an figure macro such as activeplot. These macros and their functionality are defined in /usr/local/share/TEX/teTeX/texmf/tex/latex/sep2e/sepplot.tex Tex knows to look for macro definitions there (we told it to when installing it)
When you press that figure button, tex triggers accordingly to the the button macro a tex "syscall" with invoking following command:
figname.menu except if you have defined a "nomenu" variable in your tex file: In this case tex invokes
figname.idoc

SEP.action.rules

The SEP.action.rules take it from there. In the case of figname.menu, they set a group of status flags according to the existence of a figname.warning or figname.?.save file. Then they invoke an xtpanel which is called xtpanel.builder using different xtpanel variables depending on its status flags (e.g. DNOREBUILD, CANT_INTERACT)

Xtpanel.builder

xtpanel.builder knows how to make an x-window menu for the user interaction. xtpanel knows where to find it since at compilation time we tell xtpanel to check
/usr/local/lib/X11/xtpanel/builder.xtpanel Before the menu is started, the C-preprocessor sets the xtpanel according to the different status flags. The x-window menu always has a quit button, but probably everything else is governed by the status flag definitions.
the xtpanel builder builds an interactive menu: when pressing any of its buttons it will issue the command spedified for this button. The commands are usually calls to the local Makefile.

Makefile

what happens here is the author's responsibility: the commands the xtpanel menu issues are usually defaulted in the SEP.idoc.rules. Therefore, beaware if you do not anything the SEP.idoc.rules probably will.