1# Makefile for Independent JPEG Group's software
2
3# This makefile is for Microsoft Visual C++ on Windows NT (and 95?).
4# It builds the IJG library as a statically linkable library (.LIB),
5# and builds the sample applications as console-mode apps.
6# Thanks to Xingong Chang, Raymond Everly and others.
7
8# Read installation instructions before saying "nmake" !!
9# To build an optimized library without debug info, say "nmake nodebug=1".
10
11# Pull in standard variable definitions
12!include <win32.mak>
13
14# You may want to adjust these compiler options:
15CFLAGS= $(cflags) $(cdebug) $(cvars) -I.
16# Generally, we recommend defining any configuration symbols in jconfig.h,
17# NOT via -D switches here.
18
19# Link-time options:
20LDFLAGS= $(ldebug) $(conlflags)
21
22# To link any special libraries, add the necessary commands here.
23LDLIBS= $(conlibs)
24
25# Put here the object file name for the correct system-dependent memory
26# manager file.  For NT we suggest jmemnobs.obj, which expects the OS to
27# provide adequate virtual memory.
28SYSDEPMEM= jmemnobs.obj
29
30# miscellaneous OS-dependent stuff
31# file deletion command
32RM= del
33
34# End of configurable options.
35
36
37# source files: JPEG library proper
38LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
39        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
40        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
41        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
42        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
43        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
44        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
45        jquant2.c jutils.c jmemmgr.c
46# memmgr back ends: compile only one of these into a working library
47SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
48# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
49APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
50        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
51        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
52SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
53# files included by source files
54INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
55        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
56# documentation, test, and support files
57DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
58        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
59        coderules.txt filelist.txt change.log
60MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
61        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
62        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
63        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
64        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
65        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
66        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
67        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
68        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
69        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
70        makefile.mms makefile.vms makvms.opt
71CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
72        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
73        jconfig.vms
74CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
75OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
76        libjpeg.map
77TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
78        testimgp.jpg
79DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
80        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
81# library object files common to compression and decompression
82COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
83# compression library object files
84CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
85        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
86        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
87        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
88# decompression library object files
89DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
90        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
91        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
92        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
93        jdmerge.obj
94# These objectfiles are included in libjpeg.lib
95LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
96# object files for sample applications (excluding library files)
97COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
98        rdswitch.obj cdjpeg.obj
99DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
100        rdcolmap.obj cdjpeg.obj
101TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
102
103# Template command for compiling .c to .obj
104.c.obj:
105	$(cc) $(CFLAGS) $*.c
106
107
108all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
109
110libjpeg.lib: $(LIBOBJECTS)
111	$(RM) libjpeg.lib
112	lib -out:libjpeg.lib  $(LIBOBJECTS)
113
114cjpeg.exe: $(COBJECTS) libjpeg.lib
115	$(link) $(LDFLAGS) -out:cjpeg.exe $(COBJECTS) libjpeg.lib $(LDLIBS)
116
117djpeg.exe: $(DOBJECTS) libjpeg.lib
118	$(link) $(LDFLAGS) -out:djpeg.exe $(DOBJECTS) libjpeg.lib $(LDLIBS)
119
120jpegtran.exe: $(TROBJECTS) libjpeg.lib
121	$(link) $(LDFLAGS) -out:jpegtran.exe $(TROBJECTS) libjpeg.lib $(LDLIBS)
122
123rdjpgcom.exe: rdjpgcom.obj
124	$(link) $(LDFLAGS) -out:rdjpgcom.exe rdjpgcom.obj $(LDLIBS)
125
126wrjpgcom.exe: wrjpgcom.obj
127	$(link) $(LDFLAGS) -out:wrjpgcom.exe wrjpgcom.obj $(LDLIBS)
128
129
130clean:
131	$(RM) *.obj *.exe libjpeg.lib
132	$(RM) testout*
133
134setup-vc6:
135	ren jconfig.vc jconfig.h
136	ren makejdsw.vc6 jpeg.dsw
137	ren makeadsw.vc6 apps.dsw
138	ren makejmak.vc6 jpeg.mak
139	ren makejdep.vc6 jpeg.dep
140	ren makejdsp.vc6 jpeg.dsp
141	ren makecmak.vc6 cjpeg.mak
142	ren makecdep.vc6 cjpeg.dep
143	ren makecdsp.vc6 cjpeg.dsp
144	ren makedmak.vc6 djpeg.mak
145	ren makeddep.vc6 djpeg.dep
146	ren makeddsp.vc6 djpeg.dsp
147	ren maketmak.vc6 jpegtran.mak
148	ren maketdep.vc6 jpegtran.dep
149	ren maketdsp.vc6 jpegtran.dsp
150	ren makermak.vc6 rdjpgcom.mak
151	ren makerdep.vc6 rdjpgcom.dep
152	ren makerdsp.vc6 rdjpgcom.dsp
153	ren makewmak.vc6 wrjpgcom.mak
154	ren makewdep.vc6 wrjpgcom.dep
155	ren makewdsp.vc6 wrjpgcom.dsp
156
157setup-v10:
158	ren jconfig.vc jconfig.h
159	ren makejsln.v10 jpeg.sln
160	ren makeasln.v10 apps.sln
161	ren makejvcx.v10 jpeg.vcxproj
162	ren makejfil.v10 jpeg.vcxproj.filters
163	ren makecvcx.v10 cjpeg.vcxproj
164	ren makecfil.v10 cjpeg.vcxproj.filters
165	ren makedvcx.v10 djpeg.vcxproj
166	ren makedfil.v10 djpeg.vcxproj.filters
167	ren maketvcx.v10 jpegtran.vcxproj
168	ren maketfil.v10 jpegtran.vcxproj.filters
169	ren makervcx.v10 rdjpgcom.vcxproj
170	ren makerfil.v10 rdjpgcom.vcxproj.filters
171	ren makewvcx.v10 wrjpgcom.vcxproj
172	ren makewfil.v10 wrjpgcom.vcxproj.filters
173
174test:
175	IF EXIST testout* $(RM) testout*
176	.\djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
177	.\djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg
178	.\cjpeg -dct int -outfile testout.jpg  testimg.ppm
179	.\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
180	.\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
181	.\jpegtran -outfile testoutt.jpg testprog.jpg
182	fc /b testimg.ppm testout.ppm
183	fc /b testimg.bmp testout.bmp
184	fc /b testimg.jpg testout.jpg
185	fc /b testimg.ppm testoutp.ppm
186	fc /b testimgp.jpg testoutp.jpg
187	fc /b testorig.jpg testoutt.jpg
188
189test-build:
190	IF EXIST testout* $(RM) testout*
191	.\djpeg\Release\djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
192	.\djpeg\Release\djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg
193	.\cjpeg\Release\cjpeg -dct int -outfile testout.jpg  testimg.ppm
194	.\djpeg\Release\djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
195	.\cjpeg\Release\cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
196	.\jpegtran\Release\jpegtran -outfile testoutt.jpg testprog.jpg
197	fc /b testimg.ppm testout.ppm
198	fc /b testimg.bmp testout.bmp
199	fc /b testimg.jpg testout.jpg
200	fc /b testimg.ppm testoutp.ppm
201	fc /b testimgp.jpg testoutp.jpg
202	fc /b testorig.jpg testoutt.jpg
203
204
205jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
206jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
207jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
208jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
209jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
210jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
211jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
212jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
213jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
214jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
215jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
216jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
217jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
218jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
219jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
220jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
221jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
222jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
223jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
224jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
225jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
226jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
227jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
228jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
229jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
230jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
231jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
232jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
233jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
234jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
235jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
236jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
237jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
238jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
239jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
240jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
241jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
242jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
243jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
244jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
245jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
246jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
247jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
248jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
249jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
250jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
251jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
252jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
253jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
254jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
255cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
256djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
257jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
258rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
259wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
260cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
261rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
262rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
263transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
264rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
265wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
266rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
267wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
268rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
269wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
270rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
271wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
272rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
273wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
274