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.v10 \
67        makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
68        makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
69        makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
70        makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
71        makefile.mms makefile.vms makvms.opt
72CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
73        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
74        jconfig.vms
75CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
76        missing ar-lib
77OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map
78TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
79        testimgp.jpg
80DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
81        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
82# library object files common to compression and decompression
83COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
84# compression library object files
85CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
86        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
87        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
88        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
89# decompression library object files
90DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
91        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
92        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
93        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
94        jdmerge.obj
95# These objectfiles are included in libjpeg.lib
96LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
97# object files for sample applications (excluding library files)
98COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
99        rdswitch.obj cdjpeg.obj
100DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
101        rdcolmap.obj cdjpeg.obj
102TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
103
104# need linker response file because file list > 128 chars
105RFILE = libjpeg.ans
106
107
108all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
109
110libjpeg.lib: $(LIBOBJECTS) $(RFILE)
111	del libjpeg.lib
112	lib @$(RFILE)
113
114# linker response file for building libjpeg.lib
115$(RFILE) : makefile
116	del $(RFILE)
117	echo libjpeg.lib >$(RFILE)
118# silly want-to-create-it prompt:
119	echo y >>$(RFILE)
120	echo +jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj & >>$(RFILE)
121	echo +jcparam.obj +jdatadst.obj +jcinit.obj +jcmaster.obj & >>$(RFILE)
122	echo +jcmarker.obj +jcmainct.obj +jcprepct.obj & >>$(RFILE)
123	echo +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj & >>$(RFILE)
124	echo +jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj & >>$(RFILE)
125	echo +jfdctint.obj +jdapimin.obj +jdapistd.obj & >>$(RFILE)
126	echo +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj & >>$(RFILE)
127	echo +jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj & >>$(RFILE)
128	echo +jdcoefct.obj +jdpostct.obj +jddctmgr.obj & >>$(RFILE)
129	echo +jidctfst.obj +jidctflt.obj +jidctint.obj & >>$(RFILE)
130	echo +jdsample.obj +jdcolor.obj +jquant1.obj & >>$(RFILE)
131	echo +jquant2.obj +jdmerge.obj +jaricom.obj +jcomapi.obj & >>$(RFILE)
132	echo +jutils.obj +jerror.obj +jmemmgr.obj & >>$(RFILE)
133	echo $(SYSDEPMEMLIB) ; >>$(RFILE)
134
135cjpeg.exe: $(COBJECTS) libjpeg.lib
136	echo $(COBJECTS) >cjpeg.lst
137	link /STACK:4096 /EXEPACK @cjpeg.lst, cjpeg.exe, , libjpeg.lib, ;
138	del cjpeg.lst
139
140djpeg.exe: $(DOBJECTS) libjpeg.lib
141	echo $(DOBJECTS) >djpeg.lst
142	link /STACK:4096 /EXEPACK @djpeg.lst, djpeg.exe, , libjpeg.lib, ;
143	del djpeg.lst
144
145jpegtran.exe: $(TROBJECTS) libjpeg.lib
146	link /STACK:4096 /EXEPACK $(TROBJECTS), jpegtran.exe, , libjpeg.lib, ;
147
148rdjpgcom.exe: rdjpgcom.c
149	$(CC) -AS -O -W3 rdjpgcom.c
150
151# wrjpgcom needs large model so it can malloc a 64K chunk
152wrjpgcom.exe: wrjpgcom.c
153	$(CC) -AL -O -W3 wrjpgcom.c
154
155jconfig.h: jconfig.txt
156	echo You must prepare a system-dependent jconfig.h file.
157	echo Please read the installation directions in install.txt.
158	exit 1
159
160clean:
161	del *.obj
162	del libjpeg.lib
163	del cjpeg.exe
164	del djpeg.exe
165	del jpegtran.exe
166	del rdjpgcom.exe
167	del wrjpgcom.exe
168	del testout*.*
169
170test: cjpeg.exe djpeg.exe jpegtran.exe
171	del testout*.*
172	djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
173	djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg
174	cjpeg -dct int -outfile testout.jpg  testimg.ppm
175	djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
176	cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
177	jpegtran -outfile testoutt.jpg testprog.jpg
178	fc /b testimg.ppm testout.ppm
179	fc /b testimg.bmp testout.bmp
180	fc /b testimg.jpg testout.jpg
181	fc /b testimg.ppm testoutp.ppm
182	fc /b testimgp.jpg testoutp.jpg
183	fc /b testorig.jpg testoutt.jpg
184
185
186jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
187jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
188jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
189jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
190jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
191jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
192jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
193jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
194jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
195jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
196jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
197jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
198jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
199jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
200jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
201jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
202jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
203jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
204jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
205jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
206jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
207jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
208jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
209jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
210jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
211jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
212jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
213jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
214jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
215jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
216jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
217jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
218jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
219jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
220jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
221jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
222jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
223jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
224jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
225jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
226jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
227jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
228jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
229jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
230jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
231jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
232jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
233jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
234jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
235jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
236cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
237djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
238jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
239rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
240wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
241cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
242rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
243rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
244transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
245rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
246wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
247rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
248wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
249rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
250wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
251rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
252wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
253rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
254wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
255jmemdosa.obj : jmemdosa.asm
256	masm /mx $*;
257