shiblon / latex-makefile

A Makefile for LaTeX - drop it in, type make, and magic happens.
Other
185 stars 30 forks source link

Make clean target a double colon target #137

Closed shiblon closed 8 years ago

shiblon commented 8 years ago

Originally reported on Google Code with ID 124

I'd like to clean some generated file by my script. I think it makes sense to make the
clean target a double colon:
http://www.gnu.org/software/make/manual/make.html#Double_002dColon
http://stackoverflow.com/questions/1644920/override-target-in-makefile-to-add-more-commands

It may also make sense to make the all target double colon.
Thx!

Reported by andre.rauh on 2011-04-07 21:23:00

shiblon commented 8 years ago
I'm not sure I believe that a :: target is needed, here.  Just to be sure that I understand
the use case, you are asking for the ability to add your own dependencies to clean?

But, make already supports that with single-colon targets, and this makefile makes
abundant use of those.

You could, for example, have the following in your Targets.ini file:

.PHONY: clean-foo
clean-foo:
  rm *.my-foo

clean: clean-foo

And that would do it.  There's no need to make it a double-colon target.  The same
goes for "all".

Reported by shiblon on 2011-04-08 17:51:18

shiblon commented 8 years ago
I verified that the above works, so I think we're all set!

Please reopen this issue if you are unable to get this working.

Reported by shiblon on 2011-04-22 15:46:55