sub postamble { BLIB_BASE=`$(PERL) -MFile::Basename -e 'print dirname $$ARGV[0]' $(INST_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...