Re: Dependencies for clean rule

2019-07-17 Thread Christian Hujer
Hello Erik, While I have no direct answer for you, I have a few tips about cleaning. 1. Use double-colon rules. https://www.gnu.org/software/make/manual/make.html#Double_002dColon They can be combined, so you could have: Makefile1: .PHONY: clean clean:: $(RM) somefile -include Makefile2 Makefil

Re: Dependencies for clean rule

2019-07-17 Thread Kaz Kylheku (gmake)
On 2019-07-17 04:17, Christian Hujer wrote: 2. Use $(RM) instead of rm For removing files, use $(RM). It is more portable, and it expands to rm -f, not just rm. So you don't have to worry about files that do not exist. By the time we reach the level of portability where we are worried about n

Re: Dependencies for clean rule

2019-07-17 Thread David Boyce
A few notes: 1. You can often make use of MAKECMDGOALS to treat clean targets specially. The manual gives an example. 2. I've evolved the pattern below for clean targets: .PHONY: clean clean: cleanups := $(wildcard *.o *.d core) clean: $(if $(cleanups),$(RM) -r $(cleanups)) Of course th