# $Id$

INCLUDE  = -I../../include
   
CXX_SOURCE = \
   DecodeJP2ToBBB.cpp \
   DecodeJP2ToJPG.cpp \
   DecodeJP2ToMemory.cpp \
   DecodeMrSIDBandSelection.cpp \
   DecodeMrSIDLidar.cpp \
   DecodeMrSIDToMemory.cpp \
   DecodeMrSIDToRaw.cpp \
   DecodeMrSIDToTIFF.cpp \
   DecodeNITFToBBB.cpp \
   DerivedImageFilter.cpp \
   DerivedImageReader.cpp \
   DerivedImageWriter.cpp \
   DerivedStream.cpp \
   ErrorHandling.cpp \
   GeoScene.cpp \
   ImageInfo.cpp \
   InterruptDelegate.cpp \
   MetadataDump.cpp \
   Mosaic.cpp \
   Pipeline.cpp \
   ProgressDelegate.cpp \
   SceneBuffer.cpp \
   UserTest.cpp \
   UsingStreams.cpp \
   main.cpp \
   support.cpp

CC_SOURCE = \
   UsingCInterface.c \
   UsingCStream.c

CCFLAGS = -D_REENTRANT -fPIC -O3
LDFLAGS = -Wl,-rpath-link,../../lib,-rpath,\$$ORIGIN/../../lib -lpthread -ldl

LIBRARIES = -L../../lib -lltidsdk

OBJECTS = $(CXX_SOURCE:.cpp=.o) $(CC_SOURCE:.c=.o)

all: examples

examples: $(OBJECTS)
	$(CXX) $(CCFLAGS) -o $@ $(OBJECTS) $(LIBRARIES) $(LDFLAGS)

.c.o:
	$(CC) -c $(CCFLAGS) $(INCLUDE) -o $@ $<

.cpp.o:
	$(CXX) -c $(CCFLAGS) $(INCLUDE) -o $@ $<

clean:
	rm -f *.o
	rm -f examples


.PHONY: all clean
