1# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Borland C on MS-DOS or OS/2.
4# It works with Borland C++ for DOS, revision 3.0 or later,
5# and has been tested with Borland C++ for OS/2.
6# Watch out for optimization bugs in the OS/2 compilers --- see notes below!
7# Thanks to Tom Wright and Ge' Weijers (original DOS) and
8# Ken Porter (OS/2) for this file.
9
10# Read installation instructions before saying "make" !!
11
12# Are we under DOS or OS/2?
13!if !$d(DOS) && !$d(OS2)
14!if $d(__OS2__)
15OS2=1
16!else
17DOS=1
18!endif
19!endif
20
21# The name of your C compiler:
22CC= bcc
23
24# You may need to adjust these cc options:
25!if $d(DOS)
26CFLAGS= -O2 -mm -w-par -w-stu -w-ccc -w-rch
27!else
28CFLAGS= -O1 -w-par -w-stu -w-ccc -w-rch
29!endif
30# -O2 enables full code optimization (for pre-3.0 Borland C++, use -O -G -Z).
31# -O2 is buggy in Borland OS/2 C++ revision 2.0, so use -O1 there for now.
32# If you have Borland OS/2 C++ revision 1.0, use -O or no optimization at all.
33# -mm selects medium memory model (near data, far code pointers; DOS only!)
34# -w-par suppresses warnings about unused function parameters
35# -w-stu suppresses warnings about incomplete structures
36# -w-ccc suppresses warnings about compile-time-constant conditions
37# -w-rch suppresses warnings about unreachable code
38# Generally, we recommend defining any configuration symbols in jconfig.h,
39# NOT via -D switches here.
40
41# Link-time cc options:
42!if $d(DOS)
43LDFLAGS= -mm
44# memory model option here must match CFLAGS!
45!else
46LDFLAGS=
47# -lai full-screen app
48# -lc case-significant link
49!endif
50
51# Put here the object file name for the correct system-dependent memory
52# manager file.
53# For DOS, we recommend jmemdos.c and jmemdosa.asm.
54# For OS/2, we recommend jmemnobs.c (flat memory!)
55# SYSDEPMEMLIB must list the same files with "+" signs for the librarian.
56!if $d(DOS)
57SYSDEPMEM= jmemdos.obj jmemdosa.obj
58SYSDEPMEMLIB= +jmemdos.obj +jmemdosa.obj
59!else
60SYSDEPMEM= jmemnobs.obj
61SYSDEPMEMLIB= +jmemnobs.obj
62!endif
63
64# End of configurable options.
65
66
67# source files: JPEG library proper
68LIBSOURCES= jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
69        jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
70        jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
71        jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
72        jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
73        jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
74        jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
75        jquant2.c jutils.c jmemmgr.c
76# memmgr back ends: compile only one of these into a working library
77SYSDEPSOURCES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
78# source files: cjpeg/djpeg/jpegtran applications, also rdjpgcom/wrjpgcom
79APPSOURCES= cjpeg.c djpeg.c jpegtran.c rdjpgcom.c wrjpgcom.c cdjpeg.c \
80        rdcolmap.c rdswitch.c transupp.c rdppm.c wrppm.c rdgif.c wrgif.c \
81        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c
82SOURCES= $(LIBSOURCES) $(SYSDEPSOURCES) $(APPSOURCES)
83# files included by source files
84INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
85        jpeglib.h jversion.h cdjpeg.h cderror.h transupp.h
86# documentation, test, and support files
87DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
88        wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
89        coderules.txt filelist.txt change.log
90MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
91        makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
92        makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
93        makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
94        maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
95        makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.vc9 \
96        makeasln.vc9 makejvcp.vc9 makecvcp.vc9 makedvcp.vc9 maketvcp.vc9 \
97        makervcp.vc9 makewvcp.vc9 makeproj.mac makcjpeg.st makdjpeg.st \
98        makljpeg.st maktjpeg.st makefile.manx makefile.sas makefile.mms \
99        makefile.vms makvms.opt
100CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
101        jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
102        jconfig.vms
103CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
104OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
105        libjpeg.map
106TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
107        testimgp.jpg
108DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
109        $(CONFIGUREFILES) $(OTHERFILES) $(TESTFILES)
110# library object files common to compression and decompression
111COMOBJECTS= jaricom.obj jcomapi.obj jutils.obj jerror.obj jmemmgr.obj $(SYSDEPMEM)
112# compression library object files
113CLIBOBJECTS= jcapimin.obj jcapistd.obj jcarith.obj jctrans.obj jcparam.obj \
114        jdatadst.obj jcinit.obj jcmaster.obj jcmarker.obj jcmainct.obj \
115        jcprepct.obj jccoefct.obj jccolor.obj jcsample.obj jchuff.obj \
116        jcdctmgr.obj jfdctfst.obj jfdctflt.obj jfdctint.obj
117# decompression library object files
118DLIBOBJECTS= jdapimin.obj jdapistd.obj jdarith.obj jdtrans.obj jdatasrc.obj \
119        jdmaster.obj jdinput.obj jdmarker.obj jdhuff.obj jdmainct.obj \
120        jdcoefct.obj jdpostct.obj jddctmgr.obj jidctfst.obj jidctflt.obj \
121        jidctint.obj jdsample.obj jdcolor.obj jquant1.obj jquant2.obj \
122        jdmerge.obj
123# These objectfiles are included in libjpeg.lib
124LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
125# object files for sample applications (excluding library files)
126COBJECTS= cjpeg.obj rdppm.obj rdgif.obj rdtarga.obj rdrle.obj rdbmp.obj \
127        rdswitch.obj cdjpeg.obj
128DOBJECTS= djpeg.obj wrppm.obj wrgif.obj wrtarga.obj wrrle.obj wrbmp.obj \
129        rdcolmap.obj cdjpeg.obj
130TROBJECTS= jpegtran.obj rdswitch.obj cdjpeg.obj transupp.obj
131
132
133all: libjpeg.lib cjpeg.exe djpeg.exe jpegtran.exe rdjpgcom.exe wrjpgcom.exe
134
135libjpeg.lib: $(LIBOBJECTS)
136	- del libjpeg.lib
137	tlib libjpeg.lib /E /C @&&|
138+jcapimin.obj +jcapistd.obj +jcarith.obj +jctrans.obj +jcparam.obj &
139+jdatadst.obj +jcinit.obj +jcmaster.obj +jcmarker.obj +jcmainct.obj &
140+jcprepct.obj +jccoefct.obj +jccolor.obj +jcsample.obj +jchuff.obj &
141+jcdctmgr.obj +jfdctfst.obj +jfdctflt.obj +jfdctint.obj +jdapimin.obj &
142+jdapistd.obj +jdarith.obj +jdtrans.obj +jdatasrc.obj +jdmaster.obj &
143+jdinput.obj +jdmarker.obj +jdhuff.obj +jdmainct.obj +jdcoefct.obj &
144+jdpostct.obj +jddctmgr.obj +jidctfst.obj +jidctflt.obj +jidctint.obj &
145+jdsample.obj +jdcolor.obj +jquant1.obj +jquant2.obj +jdmerge.obj &
146+jaricom.obj +jcomapi.obj +jutils.obj +jerror.obj +jmemmgr.obj &
147$(SYSDEPMEMLIB)
148|
149
150cjpeg.exe: $(COBJECTS) libjpeg.lib
151	$(CC) $(LDFLAGS) -ecjpeg.exe $(COBJECTS) libjpeg.lib
152
153djpeg.exe: $(DOBJECTS) libjpeg.lib
154	$(CC) $(LDFLAGS) -edjpeg.exe $(DOBJECTS) libjpeg.lib
155
156jpegtran.exe: $(TROBJECTS) libjpeg.lib
157	$(CC) $(LDFLAGS) -ejpegtran.exe $(TROBJECTS) libjpeg.lib
158
159rdjpgcom.exe: rdjpgcom.c
160!if $d(DOS)
161	$(CC) -ms -O rdjpgcom.c
162!else
163	$(CC) $(CFLAGS) rdjpgcom.c
164!endif
165
166# On DOS, wrjpgcom needs large model so it can malloc a 64K chunk
167wrjpgcom.exe: wrjpgcom.c
168!if $d(DOS)
169	$(CC) -ml -O wrjpgcom.c
170!else
171	$(CC) $(CFLAGS) wrjpgcom.c
172!endif
173
174# This "{}" syntax allows Borland Make to "batch" source files.
175# In this way, each run of the compiler can build many modules.
176.c.obj:
177	$(CC) $(CFLAGS) -c{ $<}
178
179jconfig.h: jconfig.txt
180	echo You must prepare a system-dependent jconfig.h file.
181	echo Please read the installation directions in install.txt.
182	exit 1
183
184clean:
185	- del *.obj
186	- del libjpeg.lib
187	- del cjpeg.exe
188	- del djpeg.exe
189	- del jpegtran.exe
190	- del rdjpgcom.exe
191	- del wrjpgcom.exe
192	- del testout*.*
193
194test: cjpeg.exe djpeg.exe jpegtran.exe
195	- del testout*.*
196	djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
197	djpeg -dct int -bmp -colors 256 -outfile testout.bmp  testorig.jpg
198	cjpeg -dct int -outfile testout.jpg  testimg.ppm
199	djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
200	cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
201	jpegtran -outfile testoutt.jpg testprog.jpg
202!if $d(DOS)
203	fc /b testimg.ppm testout.ppm
204	fc /b testimg.bmp testout.bmp
205	fc /b testimg.jpg testout.jpg
206	fc /b testimg.ppm testoutp.ppm
207	fc /b testimgp.jpg testoutp.jpg
208	fc /b testorig.jpg testoutt.jpg
209!else
210	echo n > n.tmp
211	comp testimg.ppm testout.ppm < n.tmp
212	comp testimg.bmp testout.bmp < n.tmp
213	comp testimg.jpg testout.jpg < n.tmp
214	comp testimg.ppm testoutp.ppm < n.tmp
215	comp testimgp.jpg testoutp.jpg < n.tmp
216	comp testorig.jpg testoutt.jpg < n.tmp
217	del n.tmp
218!endif
219
220
221jaricom.obj: jaricom.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
222jcapimin.obj: jcapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
223jcapistd.obj: jcapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
224jcarith.obj: jcarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
225jccoefct.obj: jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
226jccolor.obj: jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
227jcdctmgr.obj: jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
228jchuff.obj: jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
229jcinit.obj: jcinit.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
230jcmainct.obj: jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
231jcmarker.obj: jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
232jcmaster.obj: jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
233jcomapi.obj: jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
234jcparam.obj: jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
235jcprepct.obj: jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
236jcsample.obj: jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
237jctrans.obj: jctrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
238jdapimin.obj: jdapimin.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
239jdapistd.obj: jdapistd.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
240jdarith.obj: jdarith.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
241jdatadst.obj: jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
242jdatasrc.obj: jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
243jdcoefct.obj: jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
244jdcolor.obj: jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
245jddctmgr.obj: jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
246jdhuff.obj: jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
247jdinput.obj: jdinput.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
248jdmainct.obj: jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
249jdmarker.obj: jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
250jdmaster.obj: jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
251jdmerge.obj: jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
252jdpostct.obj: jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
253jdsample.obj: jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
254jdtrans.obj: jdtrans.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
255jerror.obj: jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
256jfdctflt.obj: jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
257jfdctfst.obj: jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
258jfdctint.obj: jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
259jidctflt.obj: jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
260jidctfst.obj: jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
261jidctint.obj: jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
262jquant1.obj: jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
263jquant2.obj: jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
264jutils.obj: jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
265jmemmgr.obj: jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
266jmemansi.obj: jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
267jmemname.obj: jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
268jmemnobs.obj: jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
269jmemdos.obj: jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
270jmemmac.obj: jmemmac.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
271cjpeg.obj: cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
272djpeg.obj: djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
273jpegtran.obj: jpegtran.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h transupp.h jversion.h
274rdjpgcom.obj: rdjpgcom.c jinclude.h jconfig.h
275wrjpgcom.obj: wrjpgcom.c jinclude.h jconfig.h
276cdjpeg.obj: cdjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
277rdcolmap.obj: rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
278rdswitch.obj: rdswitch.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
279transupp.obj: transupp.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h transupp.h
280rdppm.obj: rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
281wrppm.obj: wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
282rdgif.obj: rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
283wrgif.obj: wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
284rdtarga.obj: rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
285wrtarga.obj: wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
286rdbmp.obj: rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
287wrbmp.obj: wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
288rdrle.obj: rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
289wrrle.obj: wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
290jmemdosa.obj: jmemdosa.asm
291	tasm /mx jmemdosa.asm
292