[4] | 1 | include ../../../config.mk |
---|
| 2 | SAGE_DIR = ../../.. |
---|
| 3 | |
---|
| 4 | # use the PDF Poppler library |
---|
| 5 | #USE_POPPLER=1 |
---|
| 6 | # minimum poppler version 0.5.x |
---|
| 7 | USE_POPPLER=$(shell pkg-config --atleast-version=0.5 poppler && echo 1) |
---|
| 8 | |
---|
| 9 | SDIR=${SAGE_DIR} |
---|
| 10 | QUANTA_CFLAGS=-I${SDIR}/QUANTA/include |
---|
| 11 | QUANTA_LDFLAGS=-L${SDIR}/lib -lquanta |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | ifeq ($(USE_POPPLER), 1) |
---|
| 15 | |
---|
| 16 | USE_POPPLER12=$(shell pkg-config --atleast-version=0.12 poppler && echo 1) |
---|
| 17 | |
---|
| 18 | ifeq ($(USE_POPPLER12), 1) |
---|
| 19 | CFLAGS=-DUSE_POPPLER -DSAGE_POPPLER_VERSION=12 `pkg-config --cflags poppler` `Wand-config --cflags --cppflags` -I$(SAGE_DIR)/include -fno-stack-protector $(QUANTA_CFLAGS) $(PORTAUDIO_CFLAGS) |
---|
| 20 | LIBS= `pkg-config --libs poppler` `Wand-config --ldflags --libs` -L$(SAGE_DIR)/lib -lsail $(QUANTA_LDFLAGS) $(PAUDIO_LIB) -lpthread |
---|
| 21 | else |
---|
| 22 | CFLAGS=-DUSE_POPPLER -DSAGE_POPPLER_VERSION=5 `pkg-config --cflags poppler-glib` `Wand-config --cflags --cppflags` -I$(SAGE_DIR)/include -fno-stack-protector $(QUANTA_CFLAGS) $(PORTAUDIO_CFLAGS) |
---|
| 23 | LIBS= `pkg-config --libs poppler-glib` `Wand-config --ldflags --libs` -L$(SAGE_DIR)/lib -lsail $(QUANTA_LDFLAGS) $(PAUDIO_LIB) -lpthread |
---|
| 24 | endif |
---|
| 25 | |
---|
| 26 | else |
---|
| 27 | |
---|
| 28 | CFLAGS=`Wand-config --cflags --cppflags` -I$(SAGE_DIR)/include -fno-stack-protector $(QUANTA_CFLAGS) $(PORTAUDIO_CFLAGS) |
---|
| 29 | LIBS=`Wand-config --ldflags --libs` -L$(SAGE_DIR)/lib -lsail $(QUANTA_LDFLAGS) $(PAUDIO_LIB) -lpthread -lstdc++ |
---|
| 30 | |
---|
| 31 | endif |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | #---------------- BEGIN FastDXT stuff ----------------# |
---|
| 35 | |
---|
| 36 | OPTIM=1 |
---|
| 37 | |
---|
| 38 | ifeq ($(MACHINE), Darwin) |
---|
| 39 | |
---|
| 40 | CFLAGS+=-m32 |
---|
| 41 | LIBS+=-L/opt/local/lib |
---|
| 42 | |
---|
| 43 | CFLAGS+=-I/opt/local/include |
---|
| 44 | |
---|
| 45 | ifeq ($(ARCHITECTURE), i386) |
---|
| 46 | # Intel Mac |
---|
| 47 | |
---|
| 48 | ifeq ($(OPTIM), 1) |
---|
| 49 | # MacPro |
---|
| 50 | # CXXFLAGS+=-march=nocona -msse3 -DDXT_INTR |
---|
| 51 | |
---|
| 52 | # MacbookPro |
---|
| 53 | # CFLAGS+=-march=i686 -msse2 -DDXT_INTR |
---|
| 54 | CFLAGS+=-DDXT_INTR |
---|
| 55 | endif |
---|
| 56 | |
---|
| 57 | endif |
---|
| 58 | |
---|
| 59 | ifeq ($(ARCHITECTURE), powerpc) |
---|
| 60 | # PowerPC Mac |
---|
| 61 | echo "Disabling SSE instructions on PowerPC" |
---|
| 62 | CFLAGS+= |
---|
| 63 | endif |
---|
| 64 | endif |
---|
| 65 | |
---|
| 66 | ifeq ($(ARCHITECTURE), x86_64) |
---|
| 67 | CFLAGS+=-msse2 -DDXT_INTR |
---|
| 68 | |
---|
| 69 | else |
---|
| 70 | |
---|
| 71 | # everything considered i386/linux |
---|
| 72 | CFLAGS+=-msse2 -DDXT_INTR |
---|
| 73 | |
---|
| 74 | endif |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | #------------------ END FastDXT stuff -------------------# |
---|
| 79 | |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | default: pdfviewer |
---|
| 83 | |
---|
| 84 | install: pdfviewer |
---|
| 85 | /bin/cp -f pdfviewer $(SAGE_DIR)/bin |
---|
| 86 | |
---|
| 87 | pdfviewer: pdfviewer.o dxt.o libdxt.o util.o intrinsic.o |
---|
| 88 | ifeq ($(MACHINE), Darwin) |
---|
| 89 | g++ -m32 -o pdfviewer pdfviewer.o dxt.o libdxt.o intrinsic.o $(LIBS) |
---|
| 90 | else |
---|
| 91 | g++ -o pdfviewer pdfviewer.o dxt.o libdxt.o intrinsic.o $(LIBS) |
---|
| 92 | endif |
---|
| 93 | |
---|
| 94 | %.o: %.cpp |
---|
| 95 | g++ $(CFLAGS) -c -o $@ $< |
---|
| 96 | |
---|
| 97 | clean: |
---|
| 98 | /bin/rm -f *.o *~ pdfviewer |
---|
| 99 | |
---|