1# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Unix-like systems with ANSI-capable compilers.
4# If you have a non-ANSI compiler, makefile.unix 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
16# Link-time cc options:
17LDFLAGS=
18
19# To link any special libraries, add the necessary -l commands here.
20LDLIBS=
21
22# Put here the object file name for the correct system-dependent memory
23# manager file.  For Unix this is usually jmemnobs.o, but you may want
24# to use jmemansi.o or jmemname.o if you have limited swap space.
25SYSDEPMEM= jmemnobs.o
26
27# miscellaneous OS-dependent stuff
28# linker
29LN= $(CC)
30# file deletion command
31RM= rm -f
32# library (.a) file creation command
33AR= ar rc
34# second step in .a creation (use "touch" if not needed)
35AR2= ranlib
36
37# End of configurable options.
38
39
40# source files: JPEG library proper
41LIBSOURCES= jcapi.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcmainct.c \
42        jcmarker.c jcmaster.c jcomapi.c jcparam.c jcprepct.c jcsample.c \
43        jdapi.c jdatasrc.c jdatadst.c jdcoefct.c jdcolor.c jddctmgr.c \
44        jdhuff.c jdmainct.c jdmarker.c jdmaster.c jdpostct.c jdsample.c \
45        jerror.c jutils.c jfdctfst.c jfdctflt.c jfdctint.c jidctfst.c \
46        jidctflt.c jidctint.c jidctred.c jquant1.c jquant2.c jdmerge.c \
47        jmemmgr.c jmemansi.c jmemname.c jmemnobs.c jmemdos.c
48# source files: cjpeg/djpeg applications, also rdjpgcom/wrjpgcom
49APPSOURCES= cjpeg.c djpeg.c rdcolmap.c rdppm.c wrppm.c rdgif.c wrgif.c \
50        rdtarga.c wrtarga.c rdbmp.c wrbmp.c rdrle.c wrrle.c rdjpgcom.c \
51        wrjpgcom.c
52SOURCES= $(LIBSOURCES) $(APPSOURCES)
53# files included by source files
54INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
55        jpeglib.h jversion.h cdjpeg.h cderror.h
56# documentation, test, and support files
57DOCS= README install.doc usage.doc cjpeg.1 djpeg.1 rdjpgcom.1 wrjpgcom.1 \
58        example.c libjpeg.doc structure.doc coderules.doc filelist.doc \
59        change.log
60MKFILES= configure makefile.cfg makefile.ansi makefile.unix makefile.manx \
61        makefile.sas makcjpeg.st makdjpeg.st makljpeg.st makefile.bcc \
62        makefile.mc6 makefile.dj makefile.mms makefile.vms makvms.opt
63CONFIGFILES= jconfig.cfg jconfig.manx jconfig.sas jconfig.st jconfig.bcc \
64        jconfig.mc6 jconfig.dj jconfig.vms
65OTHERFILES= jconfig.doc ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm
66TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
67DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
68        $(OTHERFILES) $(TESTFILES)
69# library object files common to compression and decompression
70COMOBJECTS= jcomapi.o jutils.o jerror.o jmemmgr.o $(SYSDEPMEM)
71# compression library object files
72CLIBOBJECTS= jcapi.o jcparam.o jdatadst.o jcmaster.o jcmarker.o jcmainct.o \
73        jcprepct.o jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o \
74        jfdctfst.o jfdctflt.o jfdctint.o
75# decompression library object files
76DLIBOBJECTS= jdapi.o jdatasrc.o jdmaster.o jdmarker.o jdmainct.o jdcoefct.o \
77        jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o \
78        jdhuff.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o
79# These objectfiles are included in libjpeg.a
80LIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
81# object files for cjpeg and djpeg applications (excluding library files)
82COBJECTS= cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o
83DOBJECTS= djpeg.o wrppm.o wrgif.o wrtarga.o wrrle.o wrbmp.o rdcolmap.o
84
85
86all: libjpeg.a cjpeg djpeg rdjpgcom wrjpgcom
87
88libjpeg.a: $(LIBOBJECTS)
89	$(RM) libjpeg.a
90	$(AR) libjpeg.a  $(LIBOBJECTS)
91	$(AR2) libjpeg.a
92
93cjpeg: $(COBJECTS) libjpeg.a
94	$(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) libjpeg.a $(LDLIBS)
95
96djpeg: $(DOBJECTS) libjpeg.a
97	$(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) libjpeg.a $(LDLIBS)
98
99rdjpgcom: rdjpgcom.o
100	$(LN) $(LDFLAGS) -o rdjpgcom rdjpgcom.o $(LDLIBS)
101
102wrjpgcom: wrjpgcom.o
103	$(LN) $(LDFLAGS) -o wrjpgcom wrjpgcom.o $(LDLIBS)
104
105jconfig.h: jconfig.doc
106	echo You must prepare a system-dependent jconfig.h file.
107	echo Please read the installation directions in install.doc.
108	exit 1
109
110clean:
111	$(RM) *.o cjpeg djpeg libjpeg.a rdjpgcom wrjpgcom core testout.*
112
113test: cjpeg djpeg
114	$(RM) testout.ppm testout.gif testout.jpg
115	./djpeg -dct int -ppm -outfile testout.ppm  testorig.jpg
116	./djpeg -dct int -gif -outfile testout.gif  testorig.jpg
117	./cjpeg -dct int -outfile testout.jpg  testimg.ppm
118	cmp testimg.ppm testout.ppm
119	cmp testimg.gif testout.gif
120	cmp testimg.jpg testout.jpg
121
122
123jcapi.o : jcapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
124jccoefct.o : jccoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
125jccolor.o : jccolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
126jcdctmgr.o : jcdctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
127jchuff.o : jchuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
128jcmainct.o : jcmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
129jcmarker.o : jcmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
130jcmaster.o : jcmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
131jcomapi.o : jcomapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
132jcparam.o : jcparam.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
133jcprepct.o : jcprepct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
134jcsample.o : jcsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
135jdapi.o : jdapi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
136jdatasrc.o : jdatasrc.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
137jdatadst.o : jdatadst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h
138jdcoefct.o : jdcoefct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
139jdcolor.o : jdcolor.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
140jddctmgr.o : jddctmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
141jdhuff.o : jdhuff.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
142jdmainct.o : jdmainct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
143jdmarker.o : jdmarker.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
144jdmaster.o : jdmaster.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
145jdpostct.o : jdpostct.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
146jdsample.o : jdsample.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
147jerror.o : jerror.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jversion.h jerror.h
148jutils.o : jutils.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
149jfdctfst.o : jfdctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
150jfdctflt.o : jfdctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
151jfdctint.o : jfdctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
152jidctfst.o : jidctfst.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
153jidctflt.o : jidctflt.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
154jidctint.o : jidctint.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
155jidctred.o : jidctred.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jdct.h
156jquant1.o : jquant1.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
157jquant2.o : jquant2.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
158jdmerge.o : jdmerge.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h
159jmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
160jmemansi.o : jmemansi.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
161jmemname.o : jmemname.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
162jmemnobs.o : jmemnobs.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
163jmemdos.o : jmemdos.c jinclude.h jconfig.h jpeglib.h jmorecfg.h jpegint.h jerror.h jmemsys.h
164cjpeg.o : cjpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
165djpeg.o : djpeg.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h jversion.h
166rdcolmap.o : rdcolmap.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
167rdppm.o : rdppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
168wrppm.o : wrppm.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
169rdgif.o : rdgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
170wrgif.o : wrgif.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
171rdtarga.o : rdtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
172wrtarga.o : wrtarga.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
173rdbmp.o : rdbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
174wrbmp.o : wrbmp.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
175rdrle.o : rdrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
176wrrle.o : wrrle.c cdjpeg.h jinclude.h jconfig.h jpeglib.h jmorecfg.h jerror.h cderror.h
177rdjpgcom.o : rdjpgcom.c jinclude.h jconfig.h
178wrjpgcom.o : wrjpgcom.c jinclude.h jconfig.h
179