

Phony targets in Makefiles
source link: https://ericmjl.github.io/blog/2021/3/4/phony-targets-in-makefiles/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Phony targets in Makefiles
written by Eric J. Ma on 2021-03-04
| tags: automation computation reproducibility
Makefiles can be used to create a lightweight CLI entry point for your project.
By writing a Makefile
, you can automate repetitive shell commands,
such as building a Dockerfile (which might require you to remember certain incantations):
.PHONY: container container: docker build -t mycontainer -f Dockerfile .
Doing so allows us to build a Docker container using the command make container
when at the command line.
Now, you'll probably notice the .PHONY
line at the top.
What's that all about?
By convention, the command container
would have referred to a file target on disk.
(This is how Makefiles were originally designed.)
However, if we want the command to be independent of any files on disk,
we declare it to be a phony target that doesn't actually exist on disk.
I send out a monthly newsletter with tips and tools for data scientists. Come check it out at TinyLetter.
If you would like to receive deeper, in-depth content as an early subscriber, come support me on Patreon!
Recommend
-
16
Phony Phony is a Pony -inspired proof-of-concept implementation of shared-memory actor-model concurrency in the Go programming language. Actor s automaticall...
-
10
Phony videogame claim rebuttal form 2005-08-14 by qntm If you've ever co...
-
9
Phony Diagnoses Hide High Rates of Drugging at Nursing HomesAt least 21 percent of nursing home residents are on antipsychotic drugs, a Times investigation found.Yvonne Blakeney’s husband, David, a dementia p...
-
9
CRAPCHA: Completely Ridiculous And Phony Captcha that Hassles for Amusement We’ve all run into CAPTCHAs, those annoying registration fields you never...
-
11
Deepfakes study finds doctored text is more manipulative than phony video ...
-
8
SEC Weighs Crackdown on Phony Environmental and Social-Justice Funds Please
-
13
Google earnings show 'some magnitude of advertiser pullback,' analyst says Brad Erickson, RBC Capital Markets internet
-
4
All articles
-
5
Meta security analysts warn of malicious ChatGPT imposters / Meta’s latest security report outlines the latest malware threats, including links to bizarro ChatGPTs distributed on its platform.B...
-
3
The debt-ceiling solution will be phony sp...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK