blob: 0f11afa448765fb4f71604834e1405a5c72e1d50 [file] [log] [blame]
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +00001# Makefile for Independent JPEG Group's software
2
3# This makefile is suitable for Unix-like systems.
4
5# See README and edit jconfig.h before saying "make" !!
6
7# Comment out this line if you don't have gcc:
8CC=gcc
9
10# You may need to adjust these cc options:
11CFLAGS= -O -g -Wall -DHAVE_GETOPT -DMEM_STATS
12LDFLAGS= -g
13# In particular:
14# Remove -g and -Wall if not using gcc.
15# Add -DBSD if on a pure BSD system (see jinclude.h).
16# Remove -DHAVE_GETOPT if you don't have getopt(3) (see jcmain.c, jdmain.c).
17# -DMEM_STATS is optional -- it enables gathering of memory usage statistics.
18# You may also want to add -DTWO_FILE_COMMANDLINE or -D switches for other
19# symbols listed in jconfig.h, if you prefer not to change jconfig.h.
20# If your compiler is non-ANSI, also see the .c.o rule below.
21
22# On HP-UX (and probably other SysV systems) the alternate malloc(3X) is a lot
23# faster than the standard malloc; this makes a noticeable difference in the
24# startup time when handling big noninterleaved images. I say "-lmalloc" to
25# get the alternate allocator. On most non-SysV systems you can just
26# define LDLIBS as empty.
27LDLIBS= -lmalloc
28
29# miscellaneous OS-dependent stuff
30LN= $(CC) # linker
31RM= rm -f # file deletion command
32AR= ar rc # library (.a) file creation command
33AR2= ranlib # second step in .a creation (use "touch" if not needed)
34
35
36# source files
37INCLUDES= jinclude.h jconfig.h jpegdata.h
38SOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c \
39 jchuff.c jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c \
40 jdarith.c jdcolor.c jdhuff.c jdmain.c jdmaster.c jdmcu.c \
41 jdpipe.c jdsample.c jerror.c jfwddct.c jquant1.c jquant2.c \
42 jrdjfif.c jrdgif.c jrdppm.c jrevdct.c jutils.c jvirtmem.c \
43 jwrjfif.c jwrgif.c jwrppm.c egetopt.c
44DOCS= README architecture codingrules
45MAKEFILES= makefile.unix makefile.amiga \
46 makefile.mc5 makefile.mc6 makcjpeg.lnk makdjpeg.lnk \
47 makefile.pwc makcjpeg.cf makdjpeg.cf makljpeg.cf
48TESTFILES= testorig.jpg testimg.ppm testimg.jpg
49DISTFILES= $(DOCS) $(MAKEFILES) ansi2knr.c $(SOURCES) $(INCLUDES) $(TESTFILES)
50
51# compression objectfiles
52COBJECTS = jcmain.o jcmaster.o jcdeflts.o jcarith.o jccolor.o jcexpand.o \
53 jchuff.o jcmcu.o jcpipe.o jcsample.o jfwddct.o \
54 jrdgif.o jrdppm.o jwrjfif.o \
55 jutils.o jvirtmem.o jerror.o
56# decompression objectfiles
57DOBJECTS = jdmain.o jdmaster.o jbsmooth.o jdarith.o jdcolor.o jdhuff.o \
58 jdmcu.o jdpipe.o jdsample.o jquant1.o jquant2.o jrevdct.o \
59 jrdjfif.o jwrgif.o jwrppm.o \
60 jutils.o jvirtmem.o jerror.o
61# These objectfiles are included in libjpeg.a (all but jcmain.o, jdmain.o)
62LIBOBJECTS = jcmaster.o jcdeflts.o jcarith.o jccolor.o jcexpand.o \
63 jchuff.o jcmcu.o jcpipe.o jcsample.o jfwddct.o \
64 jrdgif.o jrdppm.o jwrjfif.o \
65 jdmaster.o jbsmooth.o jdarith.o jdcolor.o jdhuff.o \
66 jdmcu.o jdpipe.o jdsample.o jquant1.o jquant2.o jrevdct.o \
67 jrdjfif.o jwrgif.o jwrppm.o \
68 jutils.o jvirtmem.o jerror.o
69
70
71all: cjpeg djpeg
72# By default, libjpeg.a is not built unless you explicitly request it.
73
74
75# If you have a C compiler that doesn't understand function prototypes,
76# uncomment the 5 lines below and make sure PROTO is not defined by jconfig.h.
77# Then say "make ansi2knr" before "make".
78
79#.c.o:
80# ./ansi2knr $*.c tmpansi.c
81# $(CC) $(CFLAGS) -c tmpansi.c
82# mv tmpansi.o $*.o
83# $(RM) tmpansi.c
84
85ansi2knr: ansi2knr.c
86 $(CC) -o ansi2knr ansi2knr.c
87# You may need to add one of -DBSD, -DVMS, or -DMSDOS to the line above.
88
89
90cjpeg: $(COBJECTS)
91 $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) $(LDLIBS)
92
93djpeg: $(DOBJECTS)
94 $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) $(LDLIBS)
95
96# libjpeg.a is useful if you are including the JPEG software in a larger
97# program; you'd include it in your link, rather than the individual modules.
98libjpeg.a: $(LIBOBJECTS)
99 $(RM) libjpeg.a
100 $(AR) libjpeg.a $(LIBOBJECTS)
101 $(AR2) libjpeg.a
102
103clean:
104 $(RM) *.o cjpeg djpeg libjpeg.a ansi2knr core tmpansi.* testout.ppm testout.jpg
105
106distribute:
107 $(RM) jpegsrc.tar*
108 tar cvf jpegsrc.tar $(DISTFILES)
109 ls -l jpegsrc.tar
110 compress -v jpegsrc.tar
111 ls -l jpegsrc.tar*
112
113test: cjpeg djpeg
114 $(RM) testout.ppm testout.jpg
115 ./djpeg testorig.jpg >testout.ppm
116 ./cjpeg testimg.ppm >testout.jpg
117 cmp testimg.ppm testout.ppm
118 cmp testimg.jpg testout.jpg
119
120
121jbsmooth.o : jbsmooth.c jinclude.h jconfig.h jpegdata.h
122jcarith.o : jcarith.c jinclude.h jconfig.h jpegdata.h
123jccolor.o : jccolor.c jinclude.h jconfig.h jpegdata.h
124jcdeflts.o : jcdeflts.c jinclude.h jconfig.h jpegdata.h
125jcexpand.o : jcexpand.c jinclude.h jconfig.h jpegdata.h
126jchuff.o : jchuff.c jinclude.h jconfig.h jpegdata.h
127jcmain.o : jcmain.c jinclude.h jconfig.h jpegdata.h egetopt.c
128jcmaster.o : jcmaster.c jinclude.h jconfig.h jpegdata.h
129jcmcu.o : jcmcu.c jinclude.h jconfig.h jpegdata.h
130jcpipe.o : jcpipe.c jinclude.h jconfig.h jpegdata.h
131jcsample.o : jcsample.c jinclude.h jconfig.h jpegdata.h
132jdarith.o : jdarith.c jinclude.h jconfig.h jpegdata.h
133jdcolor.o : jdcolor.c jinclude.h jconfig.h jpegdata.h
134jdhuff.o : jdhuff.c jinclude.h jconfig.h jpegdata.h
135jdmain.o : jdmain.c jinclude.h jconfig.h jpegdata.h egetopt.c
136jdmaster.o : jdmaster.c jinclude.h jconfig.h jpegdata.h
137jdmcu.o : jdmcu.c jinclude.h jconfig.h jpegdata.h
138jdpipe.o : jdpipe.c jinclude.h jconfig.h jpegdata.h
139jdsample.o : jdsample.c jinclude.h jconfig.h jpegdata.h
140jerror.o : jerror.c jinclude.h jconfig.h jpegdata.h
141jfwddct.o : jfwddct.c jinclude.h jconfig.h jpegdata.h
142jquant1.o : jquant1.c jinclude.h jconfig.h jpegdata.h
143jquant2.o : jquant2.c jinclude.h jconfig.h jpegdata.h
144jrdjfif.o : jrdjfif.c jinclude.h jconfig.h jpegdata.h
145jrdgif.o : jrdgif.c jinclude.h jconfig.h jpegdata.h
146jrdppm.o : jrdppm.c jinclude.h jconfig.h jpegdata.h
147jrevdct.o : jrevdct.c jinclude.h jconfig.h jpegdata.h
148jutils.o : jutils.c jinclude.h jconfig.h jpegdata.h
149jvirtmem.o : jvirtmem.c jinclude.h jconfig.h jpegdata.h
150jwrjfif.o : jwrjfif.c jinclude.h jconfig.h jpegdata.h
151jwrgif.o : jwrgif.c jinclude.h jconfig.h jpegdata.h
152jwrppm.o : jwrppm.c jinclude.h jconfig.h jpegdata.h