1# Makefile for Independent JPEG Group's software
2
3# This makefile is for DJGPP (Delorie's GNU C port) on MS-DOS.
4# Say "make exe" to get stub-style .exe's, or
5# "make standalone" to get standalone .exe's.
6
7# Read installation instructions before saying "make" !!
8
9# To do "make standalone", you'll need to be sure this points to go32.exe:
10GO32= d:/djgpp/bin/go32.exe
11
12# The name of your C compiler:
13CC= gcc
14
15# You may need to adjust these cc options:
16CFLAGS= -O2 -Wall
17# Generally, we recommend defining any configuration symbols in jconfig.h,
18# NOT via -D switches here.
19
20# Link-time cc options:
21LDFLAGS=
22
23# To link any special libraries, add the necessary -l commands here.
24LDLIBS=
25
26# Put here the object file name for the correct system-dependent memory
27# manager file.  For DJGPP this is usually jmemnobs.o, but you could
28# use jmemname.o if you want to use named temp files instead of swap space.
29SYSDEPMEM= jmemnobs.o
30
31# miscellaneous OS-dependent stuff
32# linker
33LN= $(CC)
34# file deletion command
35RM= del
36# library (.a) file creation command
37AR= ar rc
38# second step in .a creation (use "touch" if not needed)
39AR2= ranlib
40
41# End of configurable options.
42
43
44# source files: JPEG library proper
45LIBSOURCES= jcapi.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcmainct.c \
46        jcmarker.c jcmaster.c jcomapi.c jcparam.c jcprepct.c jcsample.c \
47        jdapi.c jdatasrc.c jdatadst.c jdcoefct.c jdcolor.c jddctmgr.c \
48        jdhuff.c jdmainct.c jdmarker.c jdmaster.c jdpostct.c jdsample.c \
49        jerror.c jutils.c jfdctfst.c jfdctflt.c jfdctint.c jidctfst.c \
50        jidctflt.c jidctint.c jidctred.c jquant1.c jquant2.c jdmerge.c \
51        jmemmgr.c jmemansi.c jmemname.c jmemnobs.c jmemdos.c
52# source files: cjpeg/djpeg applications, also rdjpgcom/wrjpgcom
53APPSOURCES= cjpeg.c djpeg.c rdcolmap.c rdppm.c wrppm.c rdgif.c wrgif.c \
54        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c rdjpgcom.c \
55        wrjpgcom.c
56SOURCES= $(LIBSOURCES) $(APPSOURCES)
57# files included by source files
58INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
59        jpeglib.h jversion.h cdjpeg.h cderror.h
60# documentation, test, and support files
61DOCS= README install.doc usage.doc cjpeg.1 djpeg.1 rdjpgcom.1 wrjpgcom.1 \
62        example.c libjpeg.doc structure.doc coderules.doc filelist.doc \
63        change.log
64MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.manx \
65        makefile.sas makcjpeg.st makdjpeg.st makljpeg.st makefile.bcc \
66        makefile.mc6 makefile.dj makefile.mms makefile.vms makvms.opt
67CONFIGFILES= jconfig.cfg jconfig.manx jconfig.sas jconfig.st jconfig.bcc \
68        jconfig.mc6 jconfig.dj jconfig.vms
69OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
70TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
71DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
72        $(OTHERFILES) $(TESTFILES)
73# library object files common to compression and decompression
74COMOBJECTS= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
75# compression library object files
76CLIBOBJECTS= jcapi.o jcparam.o jdatadst.o jcmaster.o jcmarker.o jcmainct.o \
77        jcprepct.o jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o \
78        jfdctfst.o jfdctflt.o jfdctint.o
79# decompression library object files
80DLIBOBJECTS= jdapi.o jdatasrc.o jdmaster.o jdmarker.o jdmainct.o jdcoefct.o \
81        jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
82        jdhuff.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
83# These objectfiles are included in libjpeg.a
84LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
85# object files for cjpeg and djpeg applications (excluding library files)
86COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o
87DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o
88
89
90all: libjpeg.a cjpeg djpeg rdjpgcom wrjpgcom
91
92libjpeg.a: $(LIBOBJECTS)
93	$(RM) libjpeg.a
94	$(AR) libjpeg.a  $(LIBOBJECTS)
95	$(AR2) libjpeg.a
96
97cjpeg: $(COBJECTS) libjpeg.a
98	$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
99
100djpeg: $(DOBJECTS) libjpeg.a
101	$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
102
103rdjpgcom: rdjpgcom.o
104	$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
105
106wrjpgcom: wrjpgcom.o
107	$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
108
109exe: cjpeg djpeg rdjpgcom wrjpgcom
110	coff2exe cjpeg
111	coff2exe djpeg
112	coff2exe rdjpgcom
113	coff2exe wrjpgcom
114
115standalone: cjpeg djpeg rdjpgcom wrjpgcom
116	coff2exe -s $(GO32) cjpeg
117	coff2exe -s $(GO32) djpeg
118	coff2exe -s $(GO32) rdjpgcom
119	coff2exe -s $(GO32) wrjpgcom
120
121jconfig.h: jconfig.doc
122	echo You must prepare a system-dependent jconfig.h file.
123	echo Please read the installation directions in install.doc.
124	exit 1
125
126clean:
127	$(RM) *.o
128	$(RM) cjpeg
129	$(RM) djpeg
130	$(RM) rdjpgcom
131	$(RM) wrjpgcom
132	$(RM) libjpeg.a
133	$(RM) testout.*
134
135test: cjpeg djpeg
136	$(RM) testout.*
137	go32 djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
138	go32 djpeg -dct int -gif -outfile testout.gif  testorig.jpg
139	go32 cjpeg -dct int -outfile testout.jpg  testimg.ppm
140	fc /b testimg.ppm testout.ppm
141	fc /b testimg.gif testout.gif
142	fc /b testimg.jpg testout.jpg
143
144
145jcapi.o : jcapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
146jccoefct.o : jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
147jccolor.o : jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
148jcdctmgr.o : jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
149jchuff.o : jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
150jcmainct.o : jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
151jcmarker.o : jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
152jcmaster.o : jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
153jcomapi.o : jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
154jcparam.o : jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
155jcprepct.o : jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
156jcsample.o : jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
157jdapi.o : jdapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
158jdatasrc.o : jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
159jdatadst.o : jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
160jdcoefct.o : jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
161jdcolor.o : jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
162jddctmgr.o : jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
163jdhuff.o : jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
164jdmainct.o : jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
165jdmarker.o : jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
166jdmaster.o : jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
167jdpostct.o : jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
168jdsample.o : jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
169jerror.o : jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
170jutils.o : jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
171jfdctfst.o : jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
172jfdctflt.o : jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
173jfdctint.o : jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
174jidctfst.o : jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
175jidctflt.o : jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
176jidctint.o : jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
177jidctred.o : jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
178jquant1.o : jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
179jquant2.o : jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
180jdmerge.o : jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
181jmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
182jmemansi.o : jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
183jmemname.o : jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
184jmemnobs.o : jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
185jmemdos.o : jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
186cjpeg.o : cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
187djpeg.o : djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
188rdcolmap.o : rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
189rdppm.o : rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
190wrppm.o : wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
191rdgif.o : rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
192wrgif.o : wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
193rdtarga.o : rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
194wrtarga.o : wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
195rdbmp.o : rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
196wrbmp.o : wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
197rdrle.o : rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
198wrrle.o : wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
199rdjpgcom.o : rdjpgcom.c jinclude.h jconfig.h
200wrjpgcom.o : wrjpgcom.c jinclude.h jconfig.h
201