MFC r244224, r248753

  Minor refactoring prior to .symbols file changes

  - Combine .if x and .if !x using .else
  - Separate out beforelinking dependency
  - Add comments to clarify .if nesting

  Always define and use PROGNAME

  This avoids having separate cases in the install rule for PROGNAME set
  and not set.  This is a minor cleanup in advance of further support for
  standalone debug files.