[4] | 1 | include ../../../config.mk |
---|
| 2 | DXT=1 # comment out for no DXT support |
---|
| 3 | |
---|
| 4 | SAGE_DIR = ../../.. |
---|
| 5 | |
---|
| 6 | CFLAGS=$(SAGE_CFLAGS) -I$(SAGE_DIR)/include $(QUANTA_CFLAGS) $(GLEW_CFLAGS) $(GLSL_YUV_DEFINE) $(PORTAUDIO_CFLAGS) |
---|
| 7 | LIBS+=$(SAGE_LDFLAGS) -L$(SAGE_DIR)/lib -lsail -lz -ljpeg $(QUANTA_LDFLAGS) $(PAUDIO_LIB) |
---|
| 8 | |
---|
| 9 | CFLAGS += `Wand-config --cflags --cppflags` -fno-stack-protector |
---|
| 10 | LIBS += `Wand-config --ldflags --libs` -lpthread |
---|
| 11 | |
---|
| 12 | ifeq ($(MACHINE), Darwin) |
---|
| 13 | LIBS+= -L/opt/local/lib -lstdc++ -lltdl |
---|
| 14 | endif |
---|
| 15 | |
---|
| 16 | FILES=imageviewer.o |
---|
| 17 | TARGET=imageviewer |
---|
| 18 | |
---|
| 19 | #---------------- BEGIN FastDXT stuff ----------------# |
---|
| 20 | ifdef DXT |
---|
| 21 | #echo "USING DXT" |
---|
| 22 | FILES+=dxt.o libdxt.o util.o intrinsic.o |
---|
| 23 | TARGET+=imgToDxt |
---|
| 24 | CFLAGS+=-DUSE_DXT |
---|
| 25 | |
---|
| 26 | OPTIM=1 |
---|
| 27 | |
---|
| 28 | MACHINE=$(shell uname -s) |
---|
| 29 | ARCHITECTURE=$(shell uname -p) |
---|
| 30 | |
---|
| 31 | ifeq ($(MACHINE), Darwin) |
---|
| 32 | |
---|
| 33 | CFLAGS+=-I/opt/local/include |
---|
| 34 | |
---|
| 35 | ifeq ($(ARCHITECTURE), i386) |
---|
| 36 | # Intel Mac |
---|
| 37 | |
---|
| 38 | ifeq ($(OPTIM), 1) |
---|
| 39 | # MacPro |
---|
| 40 | CXXFLAGS+=-march=nocona -msse3 -DDXT_INTR |
---|
| 41 | |
---|
| 42 | # MacbookPro |
---|
| 43 | #CFLAGS+=-march=i686 -msse2 -DDXT_INTR |
---|
| 44 | endif |
---|
| 45 | |
---|
| 46 | endif |
---|
| 47 | |
---|
| 48 | ifeq ($(ARCHITECTURE), powerpc) |
---|
| 49 | # PowerPC Mac |
---|
| 50 | #echo "Disabling SSE instructions on PowerPC" |
---|
| 51 | CFLAGS+= |
---|
| 52 | endif |
---|
| 53 | endif |
---|
| 54 | |
---|
| 55 | ifeq ($(ARCHITECTURE), x86_64) |
---|
| 56 | # Opteron |
---|
| 57 | CFLAGS+=-march=opteron -msse2 -DDXT_INTR |
---|
| 58 | |
---|
| 59 | else |
---|
| 60 | |
---|
| 61 | # everything considered i386/linux |
---|
| 62 | CFLAGS+=-msse2 -DDXT_INTR |
---|
| 63 | |
---|
| 64 | endif |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | endif |
---|
| 68 | #------------------ END FastDXT stuff -------------------# |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | default: $(TARGET) |
---|
| 73 | |
---|
| 74 | install: $(TARGET) |
---|
| 75 | /bin/cp -f imageviewer $(SAGE_DIR)/bin |
---|
| 76 | ifdef DXT |
---|
| 77 | /bin/cp -f imgToDxt dirToDxt.py $(SAGE_DIR)/bin/fileServer |
---|
| 78 | endif |
---|
| 79 | |
---|
| 80 | imageviewer: $(FILES) |
---|
| 81 | g++ -o imageviewer $(FILES) $(LIBS) |
---|
| 82 | |
---|
| 83 | imgToDxt: imgToDxt.o dxt.o libdxt.o util.o intrinsic.o |
---|
| 84 | g++ -o imgToDxt imgToDxt.o dxt.o libdxt.o util.o intrinsic.o $(LIBS) |
---|
| 85 | |
---|
| 86 | %.o: %.cpp |
---|
| 87 | g++ $(CFLAGS) -c -o $@ $< |
---|
| 88 | |
---|
| 89 | clean: |
---|
| 90 | /bin/rm -f *.o *~ imageviewer imgToDxt |
---|
| 91 | |
---|