1# Makefile for Independent JPEG Group's software
2
3# This makefile is for Microsoft C for MS-DOS, version 6.00A and up.
4# Use NMAKE, not Microsoft's brain-damaged MAKE.
5# Thanks to Alan Wright and Chris Turner of Olivetti Research Ltd.
6
7# Read installation instructions before saying "nmake" !!
8
9# You may need to adjust these compiler options:
10CFLAGS = -AM -Oecigt -Gs -W3
11# -AM medium memory model (or use -AS for small model, if you remove features)
12# -Oecigt -Gs  maximum safe optimisation (-Ol has bugs in MSC 6.00A)
13# -W3 warning level 3
14# You might also want to add -G2 if you have an 80286, etc.
15# Generally, we recommend defining any configuration symbols in jconfig.h,
16# NOT via -D switches here.
17
18# Jan-Herman Buining suggests the following switches for MS C 8.0 and a 486:
19# CFLAGS = /AM /f- /FPi87 /G3 /Gs /Gy /Ob1 /Oc /Oe /Og /Oi /Ol /On /Oo /Ot \
20#          /OV4 /W3
21# except for jquant1.c, which must be compiled with /Oo- to avoid a compiler
22# crash.
23
24# Ingar Steinsland suggests the following switches when building
25# a 16-bit Windows DLL:
26# CFLAGS = -ALw -Gsw -Zpe -W3 -O2 -Zi -Zd
27
28# Put here the object file name for the correct system-dependent memory
29# manager file.  For DOS, we recommend jmemdos.c and jmemdosa.asm.
30# (But not for Windows; see install.txt if you use this makefile for Windows.)
31SYSDEPMEM= jmemdos.obj jmemdosa.obj
32# SYSDEPMEMLIB must list the same files with "+" signs for the librarian.
33SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj
34
35# End of configurable options.
36
37
38# source files: JPEG library proper
39LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
40        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
41        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
42        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
43        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
44        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
45        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
46        jquant2.c jutils.c jmemmgr.c
47# memmgr back ends: compile only one of these into a working library
48SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
49# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
50APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
51        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
52        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
53SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
54# files included by source files
55INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
56        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
57# documentation, test, and support files
58DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
59        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
60        coderules.txt filelist.txt change.log
61MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
62        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
63        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
64        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
65        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
66        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.vc9 \
67        makeasln.vc9 makejvcp.vc9 makecvcp.vc9 makedvcp.vc9 maketvcp.vc9 \
68        makervcp.vc9 makewvcp.vc9 makeproj.mac makcjpeg.st makdjpeg.st \
69        makljpeg.st maktjpeg.st makefile.manx makefile.sas makefile.mms \
70        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# need linker response file because file list > 128 chars
104RFILE = libjpeg.ans
105
106
107all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
108
109libjpeg.lib: $(LIBOBJECTS) $(RFILE)
110	del libjpeg.lib
111	lib @$(RFILE)
112
113# linker response file for building libjpeg.lib
114$(RFILE) : makefile
115	del $(RFILE)
116	echo libjpeg.lib >$(RFILE)
117# silly want-to-create-it prompt:
118	echo y >>$(RFILE)
119	echo +jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj & >>$(RFILE)
120	echo +jcparam.obj +jdatadst.obj +jcinit.obj +jcmaster.obj & >>$(RFILE)
121	echo +jcmarker.obj +jcmainct.obj +jcprepct.obj & >>$(RFILE)
122	echo +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj & >>$(RFILE)
123	echo +jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj & >>$(RFILE)
124	echo +jfdctint.obj +jdapimin.obj +jdapistd.obj & >>$(RFILE)
125	echo +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj & >>$(RFILE)
126	echo +jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj & >>$(RFILE)
127	echo +jdcoefct.obj +jdpostct.obj +jddctmgr.obj & >>$(RFILE)
128	echo +jidctfst.obj +jidctflt.obj +jidctint.obj & >>$(RFILE)
129	echo +jdsample.obj +jdcolor.obj +jquant1.obj & >>$(RFILE)
130	echo +jquant2.obj +jdmerge.obj +jaricom.obj +jcomapi.obj & >>$(RFILE)
131	echo +jutils.obj +jerror.obj +jmemmgr.obj & >>$(RFILE)
132	echo $(SYSDEPMEMLIB) ; >>$(RFILE)
133
134cjpeg.exe: $(COBJECTS) libjpeg.lib
135	echo $(COBJECTS) >cjpeg.lst
136	link /STACK:4096 /EXEPACK @cjpeg.lst, cjpeg.exe, , libjpeg.lib, ;
137	del cjpeg.lst
138
139djpeg.exe: $(DOBJECTS) libjpeg.lib
140	echo $(DOBJECTS) >djpeg.lst
141	link /STACK:4096 /EXEPACK @djpeg.lst, djpeg.exe, , libjpeg.lib, ;
142	del djpeg.lst
143
144jpegtran.exe: $(TROBJECTS) libjpeg.lib
145	link /STACK:4096 /EXEPACK $(TROBJECTS), jpegtran.exe, , libjpeg.lib, ;
146
147rdjpgcom.exe: rdjpgcom.c
148	$(CC) -AS -O -W3 rdjpgcom.c
149
150# wrjpgcom needs large model so it can malloc a 64K chunk
151wrjpgcom.exe: wrjpgcom.c
152	$(CC) -AL -O -W3 wrjpgcom.c
153
154jconfig.h: jconfig.txt
155	echo You must prepare a system-dependent jconfig.h file.
156	echo Please read the installation directions in install.txt.
157	exit 1
158
159clean:
160	del *.obj
161	del libjpeg.lib
162	del cjpeg.exe
163	del djpeg.exe
164	del jpegtran.exe
165	del rdjpgcom.exe
166	del wrjpgcom.exe
167	del testout*.*
168
169test: cjpeg.exe djpeg.exe jpegtran.exe
170	del testout*.*
171	djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
172	djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg
173	cjpeg -dct int -outfile testout.jpg  testimg.ppm
174	djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
175	cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
176	jpegtran -outfile testoutt.jpg testprog.jpg
177	fc /b testimg.ppm testout.ppm
178	fc /b testimg.bmp testout.bmp
179	fc /b testimg.jpg testout.jpg
180	fc /b testimg.ppm testoutp.ppm
181	fc /b testimgp.jpg testoutp.jpg
182	fc /b testorig.jpg testoutt.jpg
183
184
185jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
186jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
188jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
189jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
192jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
193jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
194jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
198jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
199jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
202jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
203jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
204jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
205jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
206jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
207jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
208jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
209jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
210jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
211jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
212jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
213jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
214jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
215jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
216jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
217jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
218jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
219jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
220jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
221jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
222jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
223jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
224jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
225jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
226jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
227jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
228jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
229jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
230jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
231jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
232jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
233jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
234jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
235cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
236djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
237jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
238rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
239wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
240cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
241rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
242rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
243transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
244rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
245wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
246rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
247wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
248rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
249wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
250rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
251wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
252rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
253wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
254jmemdosa.obj : jmemdosa.asm
255	masm /mx $*;
256