home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / Makefile.std < prev    next >
Makefile  |  1993-11-09  |  7KB  |  216 lines

  1. # Makefile for xloadimage.  this replaces the multiple makefiles used in
  2. # versions prior to xloadimage 2.00.
  3. #
  4. # WARNING: if you use gcc 1.37, there is an optimizer bug which causes GIF
  5. # images to come out black and colormap reduction to fail.  Use gcc-1-37 as
  6. # your make target if you have gcc 1.37.
  7.  
  8. # Include system configuration parameters
  9. include Make.conf
  10.  
  11. CFLAGS=$(OPT_FLAGS) $(CC_FLAGS) $(CC_CONFIG_FLAGS) $(X11_INC_DIR) \
  12.   -DSYSPATHFILE=\"$(SYSPATHFILE)\"
  13. LIBS=$(X11_LIB_DIR) $(X11_LIB_NAME) $(SYS_LIBS) -lm
  14.  
  15. # stuff that should eventually make the configuration file
  16. SYSPATHFILE=/usr/lib/X11/Xloadimage
  17.  
  18. default: configure$(CONFIG_STYLE)
  19.     $(MAKE) xloadimage
  20.     $(MAKE) uufilter
  21.  
  22. # this target gets hit automatically on the first run; it sets up
  23. # the Make.conf file and recursively calls make.
  24.  
  25. autoconfig: autoconfig.c
  26.     $(CC) -g -o autoconfig autoconfig.c
  27.  
  28. # manual configuration target
  29. configure:: autoconfig
  30.     ./autoconfig
  31.     $(MAKE) configure-libraries
  32.  
  33. # this is the default target for the initial compilation
  34. configure-auto:: autoconfig
  35.     ./autoconfig
  36.     $(MAKE) configure-libraries
  37.  
  38. # target that doesn't do anything    
  39. configure-skip::
  40.     @echo "Already configured, skipping configuration process."
  41.  
  42. configure-clean:: autoconfig
  43.     ./autoconfig -clean
  44.     echo "# this will contain information generated by libconfig" > jpeg.conf
  45.     echo "# this will contain information generated by libconfig" > tiff.conf
  46.     cd jpeg ; make clean
  47.     cd tiff ; make clean
  48.  
  49. # specific configurations
  50. configure-bsd:: autoconfig
  51.     ./autoconfig -bsd
  52.     $(MAKE) configure-libraries
  53.  
  54. configure-sysv:: autoconfig
  55.     ./autoconfig -sysv
  56.     $(MAKE) configure-libraries
  57.  
  58. # this program configures optional libraries
  59. configure-libraries::
  60.     $(CC) $(CC_FLAGS) -g -o libconfig libconfig.c
  61.     ./libconfig "$(CC)" "$(OPT_FLAGS)"
  62.  
  63. MISC= Imakefile Makefile Makefile.std VMS_BUILD.COM README build-imake \
  64.       build-vms build-info buildshar.c packtar.c xloadimage.man \
  65.       xloadimage.txt autoconfig.c Make.conf libconfig.c \
  66.       makefloppy jpeg.c tiff.c uufilter.man uufilter.txt uufilter.c \
  67.       xloadimagerc
  68.  
  69. # files for the loader library
  70. LOADER_HDRS= cmuwmraster.h fbm.h gif.h imagetypes.h img.h \
  71.              kljcpyrght.h mac.h mcidas.h mit.cpyrght mrmcpyrght.h \
  72.              niff.h pbm.h pcx.h pds.h rle.h sunraster.h xwd.h tgncpyrght.h 
  73. LOADER_SRCS= cmuwmraster.c faces.c fbm.c gif.c imagetypes.c img.c \
  74.              mac.c mcidas.c mc_tables.c pbm.c pcx.c pdsuncomp.c \
  75.              rle.c rlelib.c sunraster.c vff.c vicar.c xbitmap.c xpixmap.c \
  76.              xwd.c
  77. LOADER_OBJS= ${LOADER_SRCS:.c=.o}
  78.  
  79. # files for the image library
  80. IMAGE_HDRS= copyright.h image.h
  81. IMAGE_SRCS= new.c niff.c value.c zio.c
  82. IMAGE_OBJS= ${IMAGE_SRCS:.c=.o}
  83.  
  84. # files for the image processing library
  85. PROCESS_HDRS=
  86. PROCESS_SRCS= bright.c clip.c compress.c dither.c fill.c halftone.c \
  87.               merge.c reduce.c rotate.c smooth.c undither.c zoom.c
  88. PROCESS_OBJS= ${PROCESS_SRCS:.c=.o}
  89.  
  90. OPTIONAL_OBJS= ${OPTIONAL_SRCS:.c=.o}
  91.  
  92. # files for xloadimage (X display utility)
  93. X_HDRS= options.h patchlevel xloadimage.h
  94. X_SRCS= config.c misc.c options.c root.c send.c window.c \
  95.         xloadimage.c
  96. X_OBJS= ${X_SRCS:.c=.o}
  97.  
  98. INCS= $(IMAGE_HDRS) $(LOADER_HDRS) $(PROCESS_HDRS) $(X_HDRS)
  99. SRCS= $(IMAGE_SRCS) $(LOADER_SRCS) $(PROCESS_SRCS) $(X_SRCS) $(OPTIONAL_SRCS)
  100. OBJS= $(IMAGE_OBJS) $(LOADER_OBJS) $(PROCESS_OBJS) $(X_OBJS) $(OPTIONAL_OBJS)
  101.  
  102. ALL= $(MISC) $(INCS) $(SRCS)
  103.  
  104. .c.o: Make.conf xloadimage.h image.h $*.c
  105.     $(CC) -c $(CFLAGS) $*.c
  106.  
  107. jpeg.o: Make.conf image.h
  108.     $(CC) -c $(CFLAGS) -Ijpeg $*.c
  109.  
  110. uufilter: uufilter.c
  111.     $(CC) -o uufilter $(CFLAGS) uufilter.c
  112.  
  113. xloadimage: $(OBJS) $(OPTIONAL_LIBS)
  114.     ./build-info
  115.     $(CC) -c $(CFLAGS) build.c
  116.     $(CC) -o xloadimage $(CFLAGS) build.o $(OBJS) $(OPTIONAL_LIBS) $(LIBS)
  117.  
  118. install:: $(SYSPATHFILE) uufilter
  119.     $(RM) $(INSTALLDIR)/xloadimage
  120.     $(RM) $(INSTALLDIR)/xsetbg
  121.     $(RM) $(INSTALLDIR)/xview
  122.     $(RM) $(INSTALLDIR)/uufilter
  123.     $(CP) xloadimage $(INSTALLDIR)/xloadimage
  124.     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xsetbg
  125.     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xview
  126.     $(CP) uufilter $(INSTALLDIR)/uufilter
  127.  
  128. clean::
  129.     rm -f autoconfig
  130.     make configure-clean
  131.     rm -f *.o *~ xloadimage uufilter autoconfig libconfig packtar \
  132.       buildshar doshar shar.* *.tar *.tar.Z *.tc
  133.  
  134. $(SYSPATHFILE):
  135.     @echo "*** Creating default $(SYSPATHFILE) since you"
  136.     @echo "*** don't have one. This file is used to set up default places"
  137.     @echo "*** and names to look for images.  You probably want to edit"
  138.     @echo "*** it for your site.  See the xloadimage manual page for"
  139.     @echo "*** details on the contents of this file."
  140.     cp xloadimagerc $(SYSPATHFILE)
  141.  
  142. # this is for building Imakefiles and such for distributions
  143.  
  144. new-auxiliaries:: clean
  145.     rm -f Imakefile Makefile.std VMS_BUILD.COM xloadimage.txt
  146.     cp Makefile Makefile.std # backup in case they want it
  147.     ./build-imake "$(SRCS)" "$(OBJS)"
  148.     ./build-vms "$(SRCS)" "$(OBJS)"
  149.     ./default-info
  150.     nroff -Tcrt -man xloadimage.man > xloadimage.txt
  151.     nroff -Tcrt -man uufilter.man > uufilter.txt
  152.  
  153. # these targets are for building shar distributions
  154.  
  155. buildshar: buildshar.o
  156.     $(CC) -o buildshar buildshar.o
  157.  
  158. shar:: buildshar new-auxiliaries
  159.     rm -f shar.* doshar
  160.     ./buildshar $(ALL) > doshar
  161.     sh doshar
  162.     rm -f doshar Makefile.std
  163.  
  164. # targets for building tar distributions
  165.  
  166. packtar: packtar.c
  167.     $(CC) -o packtar packtar.c
  168.  
  169. tar:: new-auxiliaries packtar
  170.     ./packtar $(ALL) sample/* jpeg/* tiff/*
  171.     rm -f Imakefile Makefile.std
  172.  
  173. tar.Z: tar
  174.     compress xloadimage.tar
  175.  
  176. # create a floppy-disk distribution.
  177.  
  178. floppy: new-auxiliaries
  179.     ./makefloppy $(ALL) sample
  180.     ./makefloppy tiff
  181.     ./makefloppy jpeg
  182.     rm -f Imakefile Makefile.std
  183.  
  184. # these targets are for those of us who have CodeCenter/Saber-C
  185.  
  186. # load all objects in CodeCenter.
  187.  
  188. cl_obj: $(DEBUG_OBJS)
  189.     #setopt ccargs -g $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
  190.     #setopt load_flags $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
  191.     #load build.o $(OBJS) $(OPTIONAL_LIBS) $(LIBS)
  192.     #link
  193.  
  194. # load all sources in CodeCenter.
  195.  
  196. cl_src:
  197.     #setopt ccargs -g $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
  198.     #setopt load_flags $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
  199.     #load build.c $(SRCS) $(OPTIONAL_LIBS) $(LIBS)
  200.     #link
  201.  
  202. # proof xloadimage using TestCenter.
  203.  
  204. xloadimage.tc:
  205.     proof -errors $(CC) -o xloadimage.tc build.o $(CFLAGS) $(OBJS) $(OPTIONAL_LIBS) $(LIBS)
  206.  
  207. jpeg/libjpeg.a:
  208.     cd jpeg ; $(MAKE) libjpeg.a
  209.  
  210. tiff/libtiff.a:
  211.     cd tiff ; $(MAKE) libtiff.a
  212.  
  213. # a few dependencies
  214. imagetypes.o: imagetypes.h imagetypes.c
  215.  
  216.