1# Makefile for Independent JPEG Group's software
2
3# makefile.cfg is edited by configure to produce a custom Makefile.
4
5# Read installation instructions before saying "make" !!
6
7# For compiling with source and object files in different directories.
8srcdir = @srcdir@
9VPATH = @srcdir@
10
11# Where to install the programs and man pages.
12prefix = @prefix@
13exec_prefix = @exec_prefix@
14bindir = $(exec_prefix)/bin
15libdir = $(exec_prefix)/lib
16includedir = $(prefix)/include
17binprefix =
18manprefix =
19manext = 1
20mandir = $(prefix)/man/man$(manext)
21
22# The name of your C compiler:
23CC= @CC@
24
25# You may need to adjust these cc options:
26CFLAGS= @CFLAGS@ @CPPFLAGS@ -I$(srcdir)
27# Generally, we recommend defining any configuration symbols in jconfig.h,
28# NOT via -D switches here.
29# However, any special defines for ansi2knr.c may be included here:
30ANSI2KNRFLAGS= @ANSI2KNRFLAGS@
31
32# Link-time cc options:
33LDFLAGS= @LDFLAGS@
34
35# To link any special libraries, add the necessary -l commands here.
36LDLIBS= @LIBS@
37
38# Put here the object file name for the correct system-dependent memory
39# manager file.  For Unix this is usually jmemnobs.o, but you may want
40# to use jmemansi.o or jmemname.o if you have limited swap space.
41SYSDEPMEM= @MEMORYMGR@
42
43# miscellaneous OS-dependent stuff
44SHELL= /bin/sh
45# linker
46LN= $(CC)
47# file deletion command
48RM= rm -f
49# file rename command
50MV= mv
51# library (.a) file creation command
52AR= ar rc
53# second step in .a creation (use "touch" if not needed)
54AR2= @RANLIB@
55# installation program
56INSTALL= @INSTALL@
57INSTALL_PROGRAM= @INSTALL_PROGRAM@
58INSTALL_DATA= @INSTALL_DATA@
59
60# End of configurable options.
61
62
63# source files: JPEG library proper
64LIBSOURCES= jcapi.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcmainct.c \
65        jcmarker.c jcmaster.c jcomapi.c jcparam.c jcprepct.c jcsample.c \
66        jdapi.c jdatasrc.c jdatadst.c jdcoefct.c jdcolor.c jddctmgr.c \
67        jdhuff.c jdmainct.c jdmarker.c jdmaster.c jdpostct.c jdsample.c \
68        jerror.c jutils.c jfdctfst.c jfdctflt.c jfdctint.c jidctfst.c \
69        jidctflt.c jidctint.c jidctred.c jquant1.c jquant2.c jdmerge.c \
70        jmemmgr.c jmemansi.c jmemname.c jmemnobs.c jmemdos.c
71# source files: cjpeg/djpeg applications, also rdjpgcom/wrjpgcom
72APPSOURCES= cjpeg.c djpeg.c rdcolmap.c rdppm.c wrppm.c rdgif.c wrgif.c \
73        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c rdjpgcom.c \
74        wrjpgcom.c
75SOURCES= $(LIBSOURCES) $(APPSOURCES)
76# files included by source files
77INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
78        jpeglib.h jversion.h cdjpeg.h cderror.h
79# documentation, test, and support files
80DOCS= README install.doc usage.doc cjpeg.1 djpeg.1 rdjpgcom.1 wrjpgcom.1 \
81        example.c libjpeg.doc structure.doc coderules.doc filelist.doc \
82        change.log
83MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.manx \
84        makefile.sas makcjpeg.st makdjpeg.st makljpeg.st makefile.bcc \
85        makefile.mc6 makefile.dj makefile.mms makefile.vms makvms.opt
86CONFIGFILES= jconfig.cfg jconfig.manx jconfig.sas jconfig.st jconfig.bcc \
87        jconfig.mc6 jconfig.dj jconfig.vms
88OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
89TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
90DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
91        $(OTHERFILES) $(TESTFILES)
92# library object files common to compression and decompression
93COMOBJECTS= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
94# compression library object files
95CLIBOBJECTS= jcapi.o jcparam.o jdatadst.o jcmaster.o jcmarker.o jcmainct.o \
96        jcprepct.o jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o \
97        jfdctfst.o jfdctflt.o jfdctint.o
98# decompression library object files
99DLIBOBJECTS= jdapi.o jdatasrc.o jdmaster.o jdmarker.o jdmainct.o jdcoefct.o \
100        jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
101        jdhuff.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
102# These objectfiles are included in libjpeg.a
103LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
104# object files for cjpeg and djpeg applications (excluding library files)
105COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o
106DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o
107
108
109all: @ANSI2KNR@ libjpeg.a cjpeg djpeg rdjpgcom wrjpgcom
110
111# This rule causes ansi2knr to be invoked.
112@ISANSICOM@.c.o:
113@ISANSICOM@	./ansi2knr $(srcdir)/$*.c T$*.c
114@ISANSICOM@	$(CC) $(CFLAGS) -c T$*.c
115@ISANSICOM@	$(RM) T$*.c $*.o
116@ISANSICOM@	$(MV) T$*.o $*.o
117
118ansi2knr: ansi2knr.c
119	$(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
120
121libjpeg.a: @ANSI2KNR@ $(LIBOBJECTS)
122	$(RM) libjpeg.a
123	$(AR) libjpeg.a  $(LIBOBJECTS)
124	$(AR2) libjpeg.a
125
126cjpeg: $(COBJECTS) libjpeg.a
127	$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
128
129djpeg: $(DOBJECTS) libjpeg.a
130	$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
131
132rdjpgcom: rdjpgcom.o
133	$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
134
135wrjpgcom: wrjpgcom.o
136	$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
137
138jconfig.h: jconfig.doc
139	echo You must prepare a system-dependent jconfig.h file.
140	echo Please read the installation directions in install.doc.
141	exit 1
142
143install: cjpeg djpeg rdjpgcom wrjpgcom
144	$(INSTALL_PROGRAM) cjpeg $(bindir)/$(binprefix)cjpeg
145	$(INSTALL_PROGRAM) djpeg $(bindir)/$(binprefix)djpeg
146	$(INSTALL_PROGRAM) rdjpgcom $(bindir)/$(binprefix)rdjpgcom
147	$(INSTALL_PROGRAM) wrjpgcom $(bindir)/$(binprefix)wrjpgcom
148	$(INSTALL_DATA) $(srcdir)/cjpeg.1 $(mandir)/$(manprefix)cjpeg.$(manext)
149	$(INSTALL_DATA) $(srcdir)/djpeg.1 $(mandir)/$(manprefix)djpeg.$(manext)
150	$(INSTALL_DATA) $(srcdir)/rdjpgcom.1 $(mandir)/$(manprefix)rdjpgcom.$(manext)
151	$(INSTALL_DATA) $(srcdir)/wrjpgcom.1 $(mandir)/$(manprefix)wrjpgcom.$(manext)
152
153install-lib: libjpeg.a jconfig.h
154	$(INSTALL_DATA) libjpeg.a $(libdir)/$(binprefix)libjpeg.a
155	$(INSTALL_DATA) jconfig.h $(includedir)/jconfig.h
156	$(INSTALL_DATA) $(srcdir)/jpeglib.h $(includedir)/jpeglib.h
157	$(INSTALL_DATA) $(srcdir)/jmorecfg.h $(includedir)/jmorecfg.h
158	$(INSTALL_DATA) $(srcdir)/jerror.h $(includedir)/jerror.h
159
160clean:
161	$(RM) *.o cjpeg djpeg libjpeg.a rdjpgcom wrjpgcom ansi2knr
162	$(RM) core testout.* config.log config.status
163
164distribute:
165	$(RM) jpegsrc.tar*
166	tar cvf jpegsrc.tar $(DISTFILES)
167	compress -v jpegsrc.tar
168
169test: cjpeg djpeg
170	$(RM) testout.ppm testout.gif testout.jpg
171	./djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
172	./djpeg -dct int -gif -outfile testout.gif  testorig.jpg
173	./cjpeg -dct int -outfile testout.jpg  testimg.ppm
174	cmp testimg.ppm testout.ppm
175	cmp testimg.gif testout.gif
176	cmp testimg.jpg testout.jpg
177
178check: test
179
180# GNU Make likes to know which target names are not really files to be made:
181.PHONY: all install install-lib clean distribute test check
182
183
184jcapi.o : jcapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
185jccoefct.o : jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jccolor.o : jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jcdctmgr.o : jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
188jchuff.o : jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
189jcmainct.o : jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jcmarker.o : jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jcmaster.o : jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
192jcomapi.o : jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
193jcparam.o : jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
194jcprepct.o : jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jcsample.o : jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jdapi.o : jdapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jdatasrc.o : jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
198jdatadst.o : jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
199jdcoefct.o : jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jdcolor.o : jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jddctmgr.o : jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
202jdhuff.o : jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
203jdmainct.o : jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
204jdmarker.o : jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
205jdmaster.o : jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
206jdpostct.o : jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
207jdsample.o : jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
208jerror.o : jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
209jutils.o : jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
210jfdctfst.o : jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
211jfdctflt.o : jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
212jfdctint.o : jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
213jidctfst.o : jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
214jidctflt.o : jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
215jidctint.o : jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
216jidctred.o : jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
217jquant1.o : jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
218jquant2.o : jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
219jdmerge.o : jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
220jmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
221jmemansi.o : jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
222jmemname.o : jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
223jmemnobs.o : jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
224jmemdos.o : jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
225cjpeg.o : cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
226djpeg.o : djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
227rdcolmap.o : rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
228rdppm.o : rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
229wrppm.o : wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
230rdgif.o : rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
231wrgif.o : wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
232rdtarga.o : rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
233wrtarga.o : wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
234rdbmp.o : rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
235wrbmp.o : wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
236rdrle.o : rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
237wrrle.o : wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
238rdjpgcom.o : rdjpgcom.c jinclude.h jconfig.h
239wrjpgcom.o : wrjpgcom.c jinclude.h jconfig.h
240