Skip to content
Commit e15591aa authored by Nicolas Boulenguez's avatar Nicolas Boulenguez Committed by Manish Pandey2
Browse files

fix(cert_create): let distclean Makefile target remove the cert_create tool

For some targets, Make recursively invokes itself in subdirectories.
When delegating the distclean target to tools/cert_create/Makefile,
the submake is called with the clean target instead of realclean.
Because of this, the submake never removes the cert_create executable.

A proper but more intrusive fix would
* avoid confusion about the semantics by following traditions or using
  new names
  https://www.gnu.org/prep/standards/standards.html#Standard-Targets


* avoid typing errors with the special $@ variable.
Something like:

In tools/cert_create/Makefile:
mostlyclean:
  # Remove most objects but keep some results.
        $(call SHELL_DELETE_ALL, src/build_msg.o ${OBJECTS})
clean: mostlyclean
  # mostlyclean, then remove things built by Make.
        $(call SHELL_DELETE,${BINARY})
distclean: clean
  # clean, then remove things built by ./configure (none here).
realclean maintainer-clean: distclean
  # distclean, then remove things built by autootols (none here).

In Makefile:
mostlyclean clean distclean realclean maintainer-clean:
	$(MAKE) -C subdir1 $@
	$(MAKE) -C subdir2 $@

Signed-off-by: default avatarNicolas Boulenguez <nicolas@debian.org>
Change-Id: Iabfeca3da5724ab90a56ad6dcd6870d0a1d6b07f
parent 510155aa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment