# The Makefile allows us to specify how a project is compiled. # It is not all that important for a simple program like Hello World, # but we have to start somewhere. # # Execute this Makefile by copying it into the same directory as the # hello.c file, and typing # # make hello # or # make all # or just # make # # The first rule tells us that by default, if the user just types "make", # we will build the hello program. all: hello # This rule tells us two things: # 1) The hello program requires (depends on) the hello.c source file, # 2) The command for actually building the hello program. hello: hello.c gcc -o hello hello.c # Good make etiquette requires that we include a "clean" rule, so that # running "make clean" leaves just the source code for the program. # You should run "make clean" before turning in your projects and labs. clean: rm -f *.o hello