in reply to nmake error

With help of others I have traced this back to this line of code where BLIB_BASE is set (I think), it is something a hired gun wrote for me some time back, again this code works on other platforms just not windows, I am not exactly sure what it is trying to accomplish, can anybody help me out?

sub postamble { BLIB_BASE=`$(PERL) -MFile::Basename -e 'print dirname $$ARGV[0]' $(INS +T_BIN)` HS_BLIB=$(BLIB_BASE)/my_code MY_CODE_SHARED_BDIR=$(HS_BLIB)/shared [and several more similar lines using the HS_BLIB constant] etc...
g_White

Replies are listed 'Best First'.
Re^2: nmake error (use ..)
by tye (Sage) on Dec 28, 2004 at 03:23 UTC

    ` (back tick) works the same in /bin/sh as it does in Perl (roughly). It doesn't do anything useful in Win32 default shells.

    He's trying to set $BLIB_BASE to be the basename of $INST_BIN. Since INST_BIN is a directory, you could likely just use BLIB_BASE=$(INST_BIN)/.. instead.

    Otherwise you could change sub postamble to look up the value of INST_BIN at the time the makefile is written and have the Perl code inside of sub postamble compute the basename of that and just output BLIB_BASE=$base instead of trying to get Perl to write a makefile that get a shell to run a command that runs perl that outputs a value to be stored in a variable of the makefile.

    - tye        

      After comparing what happens on the Unix box, he wants to create a directory off the directory just below INST_BIN, so if INST_BIN is blib/bin, he just wanted blib, I imagine he did it this way in case someone tried to override the install directories. Anyway, for now I hard coded it, and got my project delivered.

      I appreciate the community support!

      g_White