# Sample Makefile. Comments start with '#' # What compiler to use CC=gcc # Any additional C compiler flags. # -Wall turns on all warnings # -Wunused warns for unused variables # Could use -ggdb3 to turn on debugging information for gdb CFLAGS=-Wall -Wunused # Any additional linker flags (libraries to be linked) # -lm links libm (math library, use with math.h) LFLAGS=-lm # Template for a makefile rules: # # target: dependency dependency dependency # command to create target from dependencies # Rules to build executables for this project: # To build this, use 'make hello' from the command line, or just 'make' if # this is the first one listed hello: hello.c $(CC) $(CFLAGS) hello.c -o hello $(LFLAGS) # Get rid of executables, intermediate files if any, and temp files. # Use 'make clean' to invoke this. clean: /bin/rm hello