# set the flags for the C and C++ compiler to give lots of warnings # include the following when making the blackboard system # INCDIR=../include ODIR=obj LIBDIR=./ CFLAGS = -I$(INCDIR) \ -O2 \ -g \ -Wall \ -Wstrict-prototypes \ -Wnested-externs \ -Wmissing-prototypes \ -Wmissing-declarations \ -DREVERSE_PIXEL \ -DSVM_CAMERA_XOFFSET=0 # set the C++ flags to be the same thing CPPFLAGS = $(CFLAGS) # put all of the relevant include files here _DEPS = ppmIO.h # convert them to point to the right place DEPS = $(patsubst %,$(INCDIR)/%,$(_DEPS)) # put a list of all the object files (with .o endings) _COMMON = ppmIO.o # convert them to point to the right place COMMON = $(patsubst %,$(ODIR)/%,$(_COMMON)) # patterns for compiling source code $(ODIR)/%.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) $(ODIR)/%.o: %.C $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) $(ODIR)/%.o: %.cpp $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) # output library OUTPUT_LIB = libppmIO.a # make rules all: $(OUTPUT_LIB) # library tool defs AR = ar ARFLAGS = rv RANLIB = ranlib $(OUTPUT_LIB) : $(COMMON) $(DEPS) rm -f $@ $(AR) $(ARFLAGS) $@ $(COMMON) $(RANLIB) $@ .PHONY: clean clean: rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~