title: Makefile: Target dependency - How to always-make it?
body: <p><sub>This will most probably be obvious and / or a banality. But since I am trying different approaches for hours without success...</sub></p>
  
  <p>I am on Linux Mint 19. I am entirely new to Makefiles. Excuse me, if the problem is trivial.</p>
  
  <p>Let it be clear, that I care for the <code>distrib</code> and <code>SHA512SUMS</code> targets only in this question.</p>
  
  <p>As I heavily change the code of those scripts, I would like the <code>SHA512SUMS</code> file to be re-generated each time I run the <code>distrib</code> target, but not in case I run the <code>check</code> target, of course, that would make the <code>check</code> target irrelevant, as you can see.</p>
  
  <p>This Makefile is becoming to be a little complicated for a shell scripter. Any help will be appreciated.</p>
  
  <hr>
  
  <pre><code>PREFIX?=/usr/local/bin
  install_path=$(DESTDIR)$(PREFIX)
  
  encrypt_script=encrypt-file-aes256
  decrypt_script=decrypt-file-aes256
  distrib_name=openssl-file-encryption-decryption-shell-scripts
  
  .PHONY: check install uninstall distrib
  
  check: $(encrypt_script) $(decrypt_script) SHA512SUMS
      echo &amp;&amp; sha512sum --check --status SHA512SUMS &amp;&amp; ( echo "Ok. You may use 'sudo make install' or '(sudo) make install PREFIX=SomeDir' command now." ) || ( echo "ERROR: Files hash sum mismatch!" &amp;&amp; echo &amp;&amp; exit 1 )
  
  install: check
      echo &amp;&amp; [ -d $(install_path) ] || mkdir --parents $(install_path)
      install --verbose --mode=0755 --target-directory=$(install_path) $(encrypt_script) $(decrypt_script)
  
  uninstall:
      rm $(install_path)/$(encrypt_script) $(install_path)/$(decrypt_script)
      rmdir --ignore-fail-on-non-empty $(install_path)
  
  distrib: check $(encrypt_script) $(decrypt_script) Makefile SHA512SUMS
      if [ $$(id --user) -eq 0 ]; then ( echo &amp;&amp; echo "Target 'distrib' has to be run as normal user!" &amp;&amp; echo &amp;&amp; exit 1 ) fi
      rm --force $(distrib_name).tar.xz
      rm --force $(distrib_name).tar.xz.asc
      rm --force --recursive $(distrib_name)
      mkdir $(distrib_name)
  #   sha512sum $(encrypt_script) $(decrypt_script) &gt; $(distrib_name)/SHA512SUMS
      cp $(encrypt_script) $(decrypt_script) Makefile SHA512SUMS $(distrib_name)
      wget --quiet --output-document=$(distrib_name)/LICENSE https://git.io/fxByv # https://raw.githubusercontent.com/burianvlastimil/openssl-file-encryption-decryption-shell-scripts/master/LICENSE
      wget --quiet --output-document=$(distrib_name)/README.md https://git.io/fxByJ # https://raw.githubusercontent.com/burianvlastimil/openssl-file-encryption-decryption-shell-scripts/master/README.md
      chmod 755 $(distrib_name)/$(encrypt_script) $(distrib_name)/$(decrypt_script)
      chmod 644 $(distrib_name)/Makefile $(distrib_name)/SHA512SUMS $(distrib_name)/LICENSE $(distrib_name)/README.md
      tar --create --file=$(distrib_name).tar $(distrib_name)
      xz --format=xz -9 --extreme --check=sha256 $(distrib_name).tar
      rm --force --recursive $(distrib_name)
      gpg --local-user 7D2E022E39A88ACF3EF6D4498F37AF4CE46008C3 --sign --armor --output $(distrib_name).tar.xz.asc --detach-sig $(distrib_name).tar.xz
  
  SHA512SUMS:
      sha512sum --check --status SHA512SUMS || sha512sum $(encrypt_script) $(decrypt_script) &gt; SHA512SUMS
  </code></pre>