# # $Id: Makefile,v 1.13 2003/11/25 23:36:30 dberger Exp $ # # given a single directory project with a source file called # main.${CPPSUFFIX}, this make file should "do the right thing" # CPPFLAGS = -w -Wall -g -Werror -pedantic CC = ${CXX} # add any libraries you need here (e.g. -lm) LDFLAGS = # if you insist on naming files *.cpp, change this next line... CPPSUFFIX = cc SOURCE := $(wildcard *.${CPPSUFFIX}) OBJS = $(SOURCE:.${CPPSUFFIX}=.o) all : main clean : rm -rf main *.o *~ .depend main : ${OBJS} .depend:${SOURCE} @set -e; $(CC) -MM $(CPPFLAGS) ${SOURCE} \ | sed 's/\($*\)\.o[ :]*/\1.o : /g' > .depend; \ [ -s $@ ] || rm -f $@ -include .depend