home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gd201.zip / gd-2.0.1 / Makefile < prev    next >
Makefile  |  2001-04-03  |  6KB  |  176 lines

  1. #Depending on your system and the libraries and features you have
  2. #and want, you WILL need to modify this Makefile!
  3.  
  4. #If you do not have gcc, change the setting for COMPILER, but you must
  5. #use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc
  6. #compiler; get gcc if you are still using that). 
  7. COMPILER=gcc
  8.  
  9. #If the ar command fails on your system, consult the ar manpage
  10. #for your system. 
  11. AR=ar
  12.  
  13. #Typical configuration: support for PNG images, JPEG images, and FreeType text.
  14. #Remove -DHAVE_LIBFREETYPE if you can live without FreeType text.
  15. #Add -DHAVE_XPM if you have X and xpm installed and you want that feature.
  16.  
  17. CFLAGS=-g -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE
  18.  
  19. #PLEASE NOTE: YOU MAY HAVE TO JUGGLE THE ORDER OF THE LIBRARIES.
  20. #Some systems are very picky about link order. They don't all agree
  21. #on the right order, either. 
  22. #
  23. #Best for most users. If you don't have FreeType, remove -lfreetype.
  24. #Add -lxpm if you need XPM support.
  25.  
  26. LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm
  27.  
  28. #Typical install locations for freetype 2.0, zlib, xpm, libjpeg 
  29. #and libpng header files. If yours are somewhere else, change this. 
  30. #-I. is important to ensure that the version of gd you are installing 
  31. #is used, and not an older release in your directory tree somewhere.
  32.  
  33. INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include 
  34.  
  35. #Typical install locations for freetype, zlib, xpm and libpng libraries.
  36. #If yours are somewhere else, other than a standard location
  37. #such as /lib or /usr/lib, then change this. This line shouldn't hurt 
  38. #if you don't actually have some of the optional libraries and directories.
  39. LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
  40.  
  41. #Location where libgd.so should be installed by "make install".
  42. #THIS MUST BE ONE OF YOUR STANDARD SHARED LIBRARY LOCATIONS, unless
  43. #you add a new directory to your LD_LIBRARY_PATH environment setting.
  44. #Otherwise applications will NOT find libgd.so and will produce an 
  45. #error.  
  46. INSTALL_LIB=/usr/lib
  47.  
  48. #Location where .h files should be installed by "make install".
  49. INSTALL_INCLUDE=/usr/include
  50.  
  51. #Location where useful non-test programs should be installed by "make install".
  52. INSTALL_BIN=/usr/local/bin
  53.  
  54. #
  55. #
  56. # Changes should not be required below here.
  57. #
  58. #
  59.  
  60. # Update these with each release!
  61.  
  62. MAJOR_VERSION=2
  63. VERSION=2.0.0
  64.  
  65. CC=$(COMPILER) $(INCLUDEDIRS)
  66. LINK=$(CC) $(LIBDIRS) $(LIBS)
  67.  
  68. PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)
  69.  
  70. BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng
  71. TEST_PROGRAMS=gdtest gddemo gd2time gdtestft testac
  72.  
  73. default: instructions
  74.  
  75. instructions:
  76.     @echo First, edit this Makefile. Read the comments at
  77.     @echo the beginning thoroughly.
  78.     @echo
  79.     @echo Second, type \'make install\' as root.
  80.     @echo
  81.     @echo This installs the GD ${VERSION} shared library,
  82.     @echo which is required in order to use the included
  83.     @echo utility programs, such as webpng, pngtogd, etc.
  84.     @echo 
  85.     @echo OPTIONAL third step: type \'make test\' to build 
  86.     @echo the optional test programs. Type \'make install\' FIRST.
  87.  
  88. test: $(TEST_PROGRAMS)
  89.  
  90. install: libgd.so.${VERSION} $(BIN_PROGRAMS)
  91.     sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
  92.     sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
  93.     sh ./install-item 755 gdtopng $(INSTALL_BIN)/gdtopng
  94.     sh ./install-item 755 gd2topng $(INSTALL_BIN)/gd2topng
  95.     sh ./install-item 755 gd2copypal $(INSTALL_BIN)/gd2copypal
  96.     sh ./install-item 755 gdparttopng $(INSTALL_BIN)/gdparttopng
  97.     sh ./install-item 755 webpng $(INSTALL_BIN)/webpng
  98.     sh ./install-item 755 bdftogd $(INSTALL_BIN)/bdftogd
  99.     sh ./install-item 644 gd.h $(INSTALL_INCLUDE)/gd.h
  100.     sh ./install-item 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h
  101.     sh ./install-item 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h
  102.     sh ./install-item 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
  103.     sh ./install-item 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
  104.     sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
  105.     sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
  106.     sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
  107.  
  108. gddemo: gddemo.o
  109.     $(CC) gddemo.o -o gddemo    $(LIBDIRS) $(LIBS)
  110.  
  111. testac: testac.o
  112.     $(CC) testac.o -o testac    $(LIBDIRS) $(LIBS)
  113.  
  114. pngtogd: pngtogd.o
  115.     $(CC) pngtogd.o -o pngtogd    $(LIBDIRS) $(LIBS) 
  116.  
  117. webpng: webpng.o
  118.     $(CC) webpng.o -o webpng    $(LIBDIRS) $(LIBS)
  119.  
  120. pngtogd2: pngtogd2.o
  121.     $(CC) pngtogd2.o -o pngtogd2    $(LIBDIRS) $(LIBS)
  122.  
  123. gdtopng: gdtopng.o
  124.     $(CC) gdtopng.o -o gdtopng    $(LIBDIRS) $(LIBS)
  125.  
  126. gd2topng: gd2topng.o
  127.     $(CC) gd2topng.o -o gd2topng    $(LIBDIRS) $(LIBS)
  128.  
  129. gd2copypal: gd2copypal.o
  130.     $(CC) gd2copypal.o -o gd2copypal    $(LIBDIRS) $(LIBS)
  131.  
  132. gdparttopng: gdparttopng.o
  133.     $(CC) gdparttopng.o -o gdparttopng    $(LIBDIRS) $(LIBS)
  134.  
  135. gdtest: gdtest.o
  136.     $(CC) gdtest.o -o gdtest    $(LIBDIRS) $(LIBS)
  137.  
  138. gd2time: gd2time.o
  139.     $(CC) gd2time.o -o gd2time    $(LIBDIRS) $(LIBS)
  140.  
  141. gdtestft: gdtestft.o
  142.     $(CC) --verbose gdtestft.o -o gdtestft $(LIBDIRS) $(LIBS)
  143.  
  144. LIBOBJS=gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
  145.         gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \
  146.         gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
  147.         gdtables.o gdft.o gdcache.o gdkanji.o wbmp.o \
  148.         gd_wbmp.o gdhelpers.o gd_topal.o 
  149.  
  150. #Shared library. This should work fine on any ELF platform (Linux, etc.) with
  151. #GNU ld or something similarly intelligent. To avoid the chicken-and-egg
  152. #problem, this target also installs the library so that applications can
  153. #actually find it.
  154.  
  155. libgd.so.${VERSION}: ${LIBOBJS}
  156.     -rm -f libgd.so.${VERSION} 2>/dev/null
  157.     ld -shared -o libgd.so.${VERSION} ${LIBOBJS}
  158.     sh ./install-item 644 libgd.so.${VERSION} \
  159.         $(INSTALL_LIB)/libgd.so.${VERSION}
  160.     -rm $(INSTALL_LIB)/libgd.so.${MAJOR_VERSION} 2>/dev/null
  161.     ln -s $(INSTALL_LIB)/libgd.so.${VERSION} \
  162.         $(INSTALL_LIB)/libgd.so.${MAJOR_VERSION}    
  163.     -rm $(INSTALL_LIB)/libgd.so 2>/dev/null
  164.     ln -s $(INSTALL_LIB)/libgd.so.${VERSION} \
  165.         $(INSTALL_LIB)/libgd.so    
  166.  
  167. #Static library, if you really need one for some reason.
  168. libgd.a: ${LIBOBJS}
  169.     rm -f libgd.a
  170.     $(AR) rc libgd.a ${LIBOBJS}
  171.     -ranlib libgd.a
  172.  
  173. clean:
  174.     rm -f *.o *.a *.so ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp
  175.  
  176.