Thomas G. Lane | 2cbeb8a | 1991-10-07 00:00:00 +0000 | [diff] [blame^] | 1 | # 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: |
| 8 | CC=gcc |
| 9 | |
| 10 | # You may need to adjust these cc options: |
| 11 | CFLAGS= -O -g -Wall -DHAVE_GETOPT -DMEM_STATS |
| 12 | LDFLAGS= -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. |
| 27 | LDLIBS= -lmalloc |
| 28 | |
| 29 | # miscellaneous OS-dependent stuff |
| 30 | LN= $(CC) # linker |
| 31 | RM= rm -f # file deletion command |
| 32 | AR= ar rc # library (.a) file creation command |
| 33 | AR2= ranlib # second step in .a creation (use "touch" if not needed) |
| 34 | |
| 35 | |
| 36 | # source files |
| 37 | INCLUDES= jinclude.h jconfig.h jpegdata.h |
| 38 | SOURCES= 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 |
| 44 | DOCS= README architecture codingrules |
| 45 | MAKEFILES= makefile.unix makefile.amiga \ |
| 46 | makefile.mc5 makefile.mc6 makcjpeg.lnk makdjpeg.lnk \ |
| 47 | makefile.pwc makcjpeg.cf makdjpeg.cf makljpeg.cf |
| 48 | TESTFILES= testorig.jpg testimg.ppm testimg.jpg |
| 49 | DISTFILES= $(DOCS) $(MAKEFILES) ansi2knr.c $(SOURCES) $(INCLUDES) $(TESTFILES) |
| 50 | |
| 51 | # compression objectfiles |
| 52 | COBJECTS = 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 |
| 57 | DOBJECTS = 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) |
| 62 | LIBOBJECTS = 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 | |
| 71 | all: 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 | |
| 85 | ansi2knr: 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 | |
| 90 | cjpeg: $(COBJECTS) |
| 91 | $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) $(LDLIBS) |
| 92 | |
| 93 | djpeg: $(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. |
| 98 | libjpeg.a: $(LIBOBJECTS) |
| 99 | $(RM) libjpeg.a |
| 100 | $(AR) libjpeg.a $(LIBOBJECTS) |
| 101 | $(AR2) libjpeg.a |
| 102 | |
| 103 | clean: |
| 104 | $(RM) *.o cjpeg djpeg libjpeg.a ansi2knr core tmpansi.* testout.ppm testout.jpg |
| 105 | |
| 106 | distribute: |
| 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 | |
| 113 | test: 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 | |
| 121 | jbsmooth.o : jbsmooth.c jinclude.h jconfig.h jpegdata.h |
| 122 | jcarith.o : jcarith.c jinclude.h jconfig.h jpegdata.h |
| 123 | jccolor.o : jccolor.c jinclude.h jconfig.h jpegdata.h |
| 124 | jcdeflts.o : jcdeflts.c jinclude.h jconfig.h jpegdata.h |
| 125 | jcexpand.o : jcexpand.c jinclude.h jconfig.h jpegdata.h |
| 126 | jchuff.o : jchuff.c jinclude.h jconfig.h jpegdata.h |
| 127 | jcmain.o : jcmain.c jinclude.h jconfig.h jpegdata.h egetopt.c |
| 128 | jcmaster.o : jcmaster.c jinclude.h jconfig.h jpegdata.h |
| 129 | jcmcu.o : jcmcu.c jinclude.h jconfig.h jpegdata.h |
| 130 | jcpipe.o : jcpipe.c jinclude.h jconfig.h jpegdata.h |
| 131 | jcsample.o : jcsample.c jinclude.h jconfig.h jpegdata.h |
| 132 | jdarith.o : jdarith.c jinclude.h jconfig.h jpegdata.h |
| 133 | jdcolor.o : jdcolor.c jinclude.h jconfig.h jpegdata.h |
| 134 | jdhuff.o : jdhuff.c jinclude.h jconfig.h jpegdata.h |
| 135 | jdmain.o : jdmain.c jinclude.h jconfig.h jpegdata.h egetopt.c |
| 136 | jdmaster.o : jdmaster.c jinclude.h jconfig.h jpegdata.h |
| 137 | jdmcu.o : jdmcu.c jinclude.h jconfig.h jpegdata.h |
| 138 | jdpipe.o : jdpipe.c jinclude.h jconfig.h jpegdata.h |
| 139 | jdsample.o : jdsample.c jinclude.h jconfig.h jpegdata.h |
| 140 | jerror.o : jerror.c jinclude.h jconfig.h jpegdata.h |
| 141 | jfwddct.o : jfwddct.c jinclude.h jconfig.h jpegdata.h |
| 142 | jquant1.o : jquant1.c jinclude.h jconfig.h jpegdata.h |
| 143 | jquant2.o : jquant2.c jinclude.h jconfig.h jpegdata.h |
| 144 | jrdjfif.o : jrdjfif.c jinclude.h jconfig.h jpegdata.h |
| 145 | jrdgif.o : jrdgif.c jinclude.h jconfig.h jpegdata.h |
| 146 | jrdppm.o : jrdppm.c jinclude.h jconfig.h jpegdata.h |
| 147 | jrevdct.o : jrevdct.c jinclude.h jconfig.h jpegdata.h |
| 148 | jutils.o : jutils.c jinclude.h jconfig.h jpegdata.h |
| 149 | jvirtmem.o : jvirtmem.c jinclude.h jconfig.h jpegdata.h |
| 150 | jwrjfif.o : jwrjfif.c jinclude.h jconfig.h jpegdata.h |
| 151 | jwrgif.o : jwrgif.c jinclude.h jconfig.h jpegdata.h |
| 152 | jwrppm.o : jwrppm.c jinclude.h jconfig.h jpegdata.h |