tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Makefile variable names



I have two questions on naming variables in pkgsrc Makefiles.


How to avoid clashes? When using names like CLIENTDIR or CONFIGDIR, I'm
regularly afraid I may clash with current or future "infrastructure" names.
Is there a policy on how to call "private" variables?


How to avoid confusion? I may need a path to the same file in two or more 
versions:
1. relative to ${PREFIX} (i.e. for PLIST usage)
2. with ${PREFIX} to record a filename in a package configuration file or as
   a symlink target
3. with both ${DESTDIR} and ${PREFIX} in do-install.

With emulation, there are also varaints of 2.: with or without the emulation 
dir.

So I end up wth something like:

TSM_CLIENTSUBDIR=       opt/tivoli/tsm/client
TSM_CLIENTDIR=          ${EMULDIR}/${TSM_CLIENTSUBDIR}

and using ${DESTDIR}${TSM_CLIENTDIR}, ${EMULSUBDIR}/${TSM_CLIENTSUBDIR} and
/${TSM_CLIENTSUBDIR}.

This woks, but I guess my view of what xxxDIR and xxxSUBDIR mean is not
everybody else's.

Is there some agreement on how to name such variables or handle the situation?


Home | Main Index | Thread Index | Old Index