CSC209H1 Lecture Notes - Makefile, Gnu Compiler Collection
Document Summary
Assignment 4 makefile: makefiles were originally designed to support separate compiltation of c files, ex. Flags = -wall -g all : query printlog query : query. o message. o queue. o gcc -o $^ printlog : printlog. o message. o queue. o gcc -o $^ %. o : %. c message. h gcc -c $< clean : rm *. o query printlog: terminology. Cflags= -dport=$(port) -wall werror -g all: buxserver buxfer buxserver: buxserver. o lists. o wrapsock. o. -o buxserver buxserver. o lists. o wrapsock. o buxfer: buxfer. o lists. o. -o buxfer buxfer. o lists. o wrapsock. o: wrapsock. c wrapsock. h. -c $< clean: rm *. o buxfer buxserver: the action for each executable links together the . o files to create the executable. Each . o file included is also in the prereq for the target as well: the pattern rule can be expanded out with the following. Notice wrapsock. o doesn"t follow the pattern and needs its own target before the pattern rule buxfer. o: buxfer. c lists. h.