1# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Unix-like systems with non-ANSI compilers.
4# If you have an ANSI compiler, makefile.ansi is a better starting point.
5
6# Read installation instructions before saying "make" !!
7
8# The name of your C compiler:
9CC= cc
10
11# You may need to adjust these cc options:
12CFLAGS= -O
13# Generally, we recommend defining any configuration symbols in jconfig.h,
14# NOT via -D switches here.
15# However, any special defines for ansi2knr.c may be included here:
16ANSI2KNRFLAGS=
17
18# Link-time cc options:
19LDFLAGS=
20
21# To link any special libraries, add the necessary -l commands here.
22LDLIBS=
23
24# Put here the object file name for the correct system-dependent memory
25# manager file.  For Unix this is usually jmemnobs.o, but you may want
26# to use jmemansi.o or jmemname.o if you have limited swap space.
27SYSDEPMEM= jmemnobs.o
28
29# miscellaneous OS-dependent stuff
30# linker
31LN= $(CC)
32# file deletion command
33RM= rm -f
34# file rename command
35MV= mv
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.auto 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.auto 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: ansi2knr libjpeg.a cjpeg djpeg rdjpgcom wrjpgcom
91
92# This rule causes ansi2knr to be invoked.
93.c.o:
94	./ansi2knr $*.c T$*.c
95	$(CC) $(CFLAGS) -c T$*.c
96	$(RM) T$*.c $*.o
97	$(MV) T$*.o $*.o
98
99ansi2knr: ansi2knr.c
100	$(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c
101
102libjpeg.a: ansi2knr $(LIBOBJECTS)
103	$(RM) libjpeg.a
104	$(AR) libjpeg.a  $(LIBOBJECTS)
105	$(AR2) libjpeg.a
106
107cjpeg: ansi2knr $(COBJECTS) libjpeg.a
108	$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
109
110djpeg: ansi2knr $(DOBJECTS) libjpeg.a
111	$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
112
113rdjpgcom: rdjpgcom.o
114	$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
115
116wrjpgcom: wrjpgcom.o
117	$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
118
119jconfig.h: jconfig.doc
120	echo You must prepare a system-dependent jconfig.h file.
121	echo Please read the installation directions in install.doc.
122	exit 1
123
124clean:
125	$(RM) *.o cjpeg djpeg libjpeg.a rdjpgcom wrjpgcom ansi2knr core testout.*
126
127test: cjpeg djpeg
128	$(RM) testout.ppm testout.gif testout.jpg
129	./djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
130	./djpeg -dct int -gif -outfile testout.gif  testorig.jpg
131	./cjpeg -dct int -outfile testout.jpg  testimg.ppm
132	cmp testimg.ppm testout.ppm
133	cmp testimg.gif testout.gif
134	cmp testimg.jpg testout.jpg
135
136
137jcapi.o : jcapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
138jccoefct.o : jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
139jccolor.o : jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
140jcdctmgr.o : jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
141jchuff.o : jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
142jcmainct.o : jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
143jcmarker.o : jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
144jcmaster.o : jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
145jcomapi.o : jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
146jcparam.o : jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
147jcprepct.o : jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
148jcsample.o : jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
149jdapi.o : jdapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
150jdatasrc.o : jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
151jdatadst.o : jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
152jdcoefct.o : jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
153jdcolor.o : jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
154jddctmgr.o : jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
155jdhuff.o : jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
156jdmainct.o : jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
157jdmarker.o : jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
158jdmaster.o : jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
159jdpostct.o : jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
160jdsample.o : jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
161jerror.o : jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
162jutils.o : jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
163jfdctfst.o : jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
164jfdctflt.o : jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
165jfdctint.o : jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
166jidctfst.o : jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
167jidctflt.o : jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
168jidctint.o : jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
169jidctred.o : jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
170jquant1.o : jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
171jquant2.o : jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
172jdmerge.o : jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
173jmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
174jmemansi.o : jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
175jmemname.o : jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
176jmemnobs.o : jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
177jmemdos.o : jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
178cjpeg.o : cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
179djpeg.o : djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
180rdcolmap.o : rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
181rdppm.o : rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
182wrppm.o : wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
183rdgif.o : rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
184wrgif.o : wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
185rdtarga.o : rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
186wrtarga.o : wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
187rdbmp.o : rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
188wrbmp.o : wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
189rdrle.o : rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
190wrrle.o : wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
191rdjpgcom.o : rdjpgcom.c jinclude.h jconfig.h
192wrjpgcom.o : wrjpgcom.c jinclude.h jconfig.h
193