Make Concepts

From NovaOrdis Knowledge Base
Revision as of 19:32, 14 December 2023 by Ovidiu (talk | contribs) (→‎.PHONY)
Jump to navigation Jump to search

Internal

.PHONY

By default, make targets are assumed to be files on disk. They will be built from other files as result of executing make with that name as argument. However, sometimes you want make to run commands that do not represent physical files in the filesystem, and if there's a file with the same name in the filesystem, make will be confused and will pick up the file. To avoid this, you can disambiguate with .PHONY:

.PHONY: clean
clean: 
  rm -rf *.o


Variables

CURDIR

CURDIR refers to the directory make is run from:

something:
	"$(CURDIR)/scripts/something.sh"