Re: building guncap-0.35 in cygwin

Dan McMahill <[email protected]> Tue, 28 Nov 2006 20:17:48 -0500
Newsgroups gmane.comp.gnu.gnucap.bugs
Message-ID <[email protected]>
Dan McMahill wrote:
> Jon Choy wrote:
> 
>>
>>  I'm attempting to do a build in the most recent version of cygwin. 
>> During the "make", I get the following errors:
>>
>>
>> Making all in modelgen
>> make[2]: Entering directory `/home/src/gnucap-0.35/modelgen'
>> make[2]: Nothing to be done for `all'.
>> make[2]: Leaving directory `/home/src/gnucap-0.35/modelgen'
>> Making all in src
>> make[2]: Entering directory `/home/src/gnucap-0.35/src'
>> make[2]: *** No rule to make target `d_bjt.cc', needed by 
>> `c_getckt.o'.  Stop.
>> make[2]: Leaving directory `/home/src/gnucap-0.35/src'
>> make[1]: *** [all-recursive] Error 1
>> make[1]: Leaving directory `/home/src/gnucap-0.35'
>> make: *** [all] Error 2
>>
>>
>>  I noticed in the announcement for a November release (which I also 
>> tried) some statements about the link order being very important. 
>> http://archives.seul.org/geda/dev/Nov-2006/msg00030.html
>>
>>  Could this be related? I'm dying to try gnucap out within cygwin and 
>> am looking forward to the Verilog A release which is what intrigues me 
>> abou this tool.
> 
> 
> no, your problem is something else.
> 
> 
> Do you have the file  "/home/src/gnucap-0.35/src/d_bjt.model"?
> 
> in src/Makefile.in there is something like this:
> 
> .SUFFIXES: .model .cc .o .obj
> 
> and later:
> 
> c_getckt.${OBJEXT}: ${MODELSRCS}
> 
> %.cc : %.model %.h ${MODELGEN}
>         ${MODELGEN} -cc $<
> 
> %.h : %.model ${MODELGEN}
>         ${MODELGEN} -h $<
> 
> and d_bjt.cc is listed in MODELSRCS.  So make should be able to figure 
> out from the suffix rule that if it has a d_bjt.model and needs a 
> d_bjt.cc then just run modelgen.
> 


ok, here's whats wrong.  I put in pattern rules for the modelgen 
generated sources.  Thats the:

%.cc : %.model %.h ${MODELGEN}
         ${MODELGEN} -cc $<

%.h : %.model ${MODELGEN}
         ${MODELGEN} -h $<


part in src/Makefile.am and src/Makefile.in

The problem is with pattern rules, GNU make will look at %.model and 
${MODELGEN} (the dependencies both explicit and patterns) and see if it 
knows how to produce those.  If so, then it knows it can produce the 
target.  The kicker is that ${MODELGEN} ends up being something like 
../modelgen/gnucap-modelgen but on cygwin there is also a .exe 
extension.  So I think all that is needed is to modify the above to be:


%.cc : %.model %.h ${MODELGEN}${EXEEXT}
         ${MODELGEN} -cc $<

%.h : %.model ${MODELGEN}${EXEEXT}
         ${MODELGEN} -h $<


This seems to work for me.

-Dan