Next: , Previous: , Up: Compiling your application   [Contents]


3.4.2 Breakdown of example makefile: version control improvements

If you’ve used version control systems (VCS) before, you have probably encountered conventions for what files are allowed to be stored on the VCS. One strategy that often occurs is to not commit temporary files such as *.o files to your VCS. To facilitate for this, you can add some clean-up recipes to the makefile like the following:

RM = rm –f

clean:
	$(RM) $(OBJS) $(TARGET)

Typing ‘make clean’ on your command line within the respective project folder will remove all of the generated *.o files as well as the compiled executable. This is a good first step in cleaning up your working directory before committing your local changes to a VCS.