HEADERS = game.h preferences.h LIBS = -lm -lreadline OBJECTS = engine.o ai.o keyboard.o game.o all: game editor game: $(OBJECTS) gcc -o game $(OBJECTS) $(LIBS) %.o: %.c $(HEADERS) gcc -c $< -o $@ # Plenty of punctuation here, not many words though. # `%' # %.o and %.c match all .o and .c files in the current directory # $< is the first word in the dependancy list (in this case the .c file). # $@ is the target. # A `#' in a line (other than in command text) starts a comment # until the end of the (logical) line. # passed to the shell, where the shell's normal # rules apply) in column 1 as the first character of introduces a comment (until the end editor: editor.c $(HEADERS) gcc -o editor editor.c $(LIBS)