1
2include ../../GDALmake.opt
3
4ifeq ($(JPEG_SETTING),internal)
5OBJ	=	\
6	jcapimin.o jcapistd.o jccoefct.o jccolor.o jcdctmgr.o jchuff.o \
7        jcinit.o jcmainct.o jcmarker.o jcmaster.o jcomapi.o jcparam.o \
8        jcphuff.o jcprepct.o jcsample.o jctrans.o jdapimin.o jdapistd.o \
9        jdatadst.o jdatasrc.o jdcoefct.o jdcolor.o jddctmgr.o jdhuff.o \
10        jdinput.o jdmainct.o jdmarker.o jdmaster.o jdmerge.o jdphuff.o \
11        jdpostct.o jdsample.o jdtrans.o jerror.o jfdctflt.o jfdctfst.o \
12        jfdctint.o jidctflt.o jidctfst.o jidctint.o jidctred.o jquant1.o \
13        jquant2.o jutils.o jmemmgr.o jmemansi.o \
14	\
15	jpgdataset.o vsidataio.o
16XTRA_OPT	=	-Ilibjpeg -DDEFAULT_MAX_MEM=500000000L
17else
18OBJ	=	jpgdataset.o vsidataio.o
19XTRA_OPT	=
20endif
21
22ifeq ($(JPEG12_ENABLED),yes)
23XTRA_OPT_12 	=	-Ilibjpeg12 -DDEFAULT_MAX_MEM=500000000L
24XTRA_OPT := -DJPEG_DUAL_MODE_8_12 $(XTRA_OPT)
25OBJ :=	jcapimin12.o jcapistd12.o jccoefct12.o jccolor12.o jcdctmgr12.o jchuff12.o \
26        jcinit12.o jcmainct12.o jcmarker12.o jcmaster12.o jcomapi12.o jcparam12.o \
27        jcphuff12.o jcprepct12.o jcsample12.o jctrans12.o jdapimin12.o jdapistd12.o \
28        jdatadst12.o jdatasrc12.o jdcoefct12.o jdcolor12.o jddctmgr12.o jdhuff12.o \
29        jdinput12.o jdmainct12.o jdmarker12.o jdmaster12.o jdmerge12.o jdphuff12.o \
30        jdpostct12.o jdsample12.o jdtrans12.o jerror12.o jfdctflt12.o jfdctfst12.o \
31        jfdctint12.o jidctflt12.o jidctfst12.o jidctint12.o jidctred12.o jquant112.o \
32        jquant212.o jutils12.o jmemmgr12.o jmemansi12.o \
33	$(OBJ) jpgdataset_12.o
34endif
35
36CPPFLAGS	:=	$(XTRA_OPT)  $(CPPFLAGS) -I../mem
37
38default:	install-obj
39
40$(O_OBJ): jpgdataset.cpp
41
42clean:
43	rm -f *.o $(O_OBJ) libjpeg12/*.c libjpeg12/*.h
44
45../o/%.$(OBJ_EXT):	libjpeg/%.c
46	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
47
48../o/%.$(OBJ_EXT):	libjpeg12/%.c
49	$(CC) -c $(XTRA_OPT_12) $(CPPFLAGS) $(CFLAGS) $< -o $@
50
51all:	$(OBJ:.o=.$(OBJ_EXT))
52
53install-obj:	$(O_OBJ:.o=.$(OBJ_EXT))
54
55import:
56	mv libjpeg/jmorecfg.h libjpeg/jmorecfg.h.safe
57	mv libjpeg/jconfig.h libjpeg/jconfig.h.safe
58	(cd libjpeg; copymatch.sh ~/libjpeg *.c *.h)
59	mv libjpeg/jmorecfg.h.safe libjpeg/jmorecfg.h
60	mv libjpeg/jconfig.h.safe libjpeg/jconfig.h
61
62libjpeg12/jcapimin12.c:	libjpeg/jcapimin.c
63	cp libjpeg/*.h libjpeg12
64	cp libjpeg12/jmorecfg.h.12 libjpeg12/jmorecfg.h
65	for x in libjpeg/*.c ; do \
66	  b=`basename $$x .c`; \
67          cp $$x libjpeg12/$${b}12.c; \
68        done
69