Tuesday, October 30, 2012

phony target in make

When you execute make clean, you are using phony target. phony target is a target that doesn't have the dependencies, but only the actions.
# Naming our phony targets
.PHONY: clean install

# Removing the executable and the object files
		rm sample main.o example.o
		echo clean: make complete

# Installing the final product
		cp sample /usr/local
		echo install: make complete

No comments:

Post a Comment