NAME=testDrawing OBJS=drawing.o all: ${NAME} CC = g++ -O3 CFLAGS=-g -I. -I/usr/local/fltk-1.1.4/include -I/usr/X11R6/include LFLAGS=-L/usr/local/fltk-1.1.4/lib -L/usr/X11R6/lib LIBS= -lfltk -lX11 -lXext -lsupc++ %.o: %.cpp %.h @echo "Compiling..." ${CC} -c ${CFLAGS} -o $@ $< ${NAME}: ${NAME}.cpp ${OBJS} @echo "Linking..." ${CC} -o $@ $< ${CFLAGS} ${LFLAGS} ${OBJS} ${LIBS} clean: rm -f *.o ${NAME} #Meaning of macros #$@ = Full name of the current target. #$? = A list of files for current dependency which are out-of-date. #$< = The source file of the current {single} dependency. #% = Particular file