<div dir="ltr">Ah thanks, that did it! I also figured out I could build by adding<div><br></div><div>cflags = -I . -L . -l s7<br></div><div><br></div><div>but that did seem to be defeating the whole purpose the of the magic make file. </div><div><br></div><div>Compiling now, thanks!</div><div>iain</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 27, 2020 at 4:03 PM Christof Ressi <<a href="mailto:info@christofressi.com">info@christofressi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Hi,<br>
    </p>
    <p>here's the explanation:
<a href="https://github.com/pure-data/pd-lib-builder/blob/e6cff665a3a30a967c72c382c6fe92bcdedd7b44/Makefile.pdlibbuilder#L45" target="_blank">https://github.com/pure-data/pd-lib-builder/blob/e6cff665a3a30a967c72c382c6fe92bcdedd7b44/Makefile.pdlibbuilder#L45</a></p>
    <p>"class.sources" assumes one source per class. What you need is "<span><classname>.class.sources", i.e.
        "s4pd.class.sources = </span><span>s4pd.c s7.c"<br>
      </span></p>
    <p><span>"common.sources" would have worked too, you
        just made a typo ;-) However, I think the solution above is
        clearer, as "common.sources" is really meant for the case where
        you have *multiple* classes with same shared code.<br>
      </span></p>
    <p>Christof<br>
    </p>
    <div>On 27.10.2020 23:44, Iain Duncan wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hi devs, I'm trying to get pd-lib-builder working,
        but I think my lack of C building experience has me stuck. I was
        able to get my empty helloworld working ok, but not managing to
        link in S7.
        <div><br>
        </div>
        <div>My project has one C file, and needs to also include s7.h
          and build s7.c  I've included my (not working) Makefile below.
          When I try the below s7 does get compiled, producing an s7.o
          file, but instead of static linking I get an s7.pd_darwin file
          with all of the S7 stuff (it's big) and a tiny s4pd.pd_darwin
          file. And the external tries to load an s7 function and fails.
          Any tips much appreciated!
          <div><br>
          </div>
          <div>thanks,</div>
          <div>Iain</div>
          <div><br>
          </div>
          <div>My Makefile:</div>
          <div><br>
          </div>
          <div># library name<br>
            <a href="http://lib.name" target="_blank">lib.name</a>
            = s4pd<br>
            <br>
            # tried these too, to no avail<br>
            #lib.setup.sources = s7.c<br>
            #common.source = s7.c<br>
            <br>
            # input source file (class name == source file basename)<br>
            class.sources = s4pd.c s7.c<br>
            <br>
            # all extra files to be included in binary distribution of
            the library<br>
            datafiles = README.md<br>
            <br>
            # include Makefile.pdlibbuilder from submodule directory
            'pd-lib-builder'<br>
            PDLIBBUILDER_DIR=pd-lib-builder/<br>
            include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder<br>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
Pd-dev mailing list
<a href="mailto:Pd-dev@lists.iem.at" target="_blank">Pd-dev@lists.iem.at</a>
<a href="https://lists.puredata.info/listinfo/pd-dev" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a>
</pre>
    </blockquote>
  </div>

_______________________________________________<br>
Pd-dev mailing list<br>
<a href="mailto:Pd-dev@lists.iem.at" target="_blank">Pd-dev@lists.iem.at</a><br>
<a href="https://lists.puredata.info/listinfo/pd-dev" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a><br>
</blockquote></div>