home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / xloadimg.zip / xloadimage.4.1 / build-imake < prev    next >
Text File  |  1993-10-28  |  2KB  |  82 lines

  1. #! /bin/sh
  2. # this program is used for generating Imakefiles
  3.  
  4. OUT=Imakefile
  5.  
  6. cat > $OUT << END_OF_INPUT
  7. # Imakefile for building within the X11 source tree.
  8. # This Imakefile was automatically generated from Makefile.std.
  9. #
  10. # If you have problems building, you should read the README file and
  11. # consider using Makefile.std.
  12. #
  13. # If you use gcc, you should read the README file and consider using
  14. # Makefile.std.
  15.  
  16.     SYSPATHFILE = $(XAPPLOADDIR)/Xloadimage
  17.         DEFINES = -DSYSPATHFILE=\"$(SYSPATHFILE)\"
  18.         DEPLIBS = $(DEPXLIB)
  19. LOCAL_LIBRARIES = $(XLIB)
  20. SYS_LIBRARIES   = -lm
  21.  
  22. #ifdef HPArchitecture
  23.       CCOPTIONS = -Aa -D_HPUX_SOURCE
  24. #endif
  25.  
  26. # Comment out either of the next two lines if you don't have TIFF or JPEG libs
  27. #define HAS_TIFF
  28. #define HAS_JPEG
  29.  
  30. #ifdef HAS_TIFF
  31. TIFF_DEFS = -DHAS_TIFF -I/usr/local/include
  32.  TIFF_LIB = -L/usr/local/lib/tiff -ltiff
  33.  TIFF_SRC = tiff.c
  34.  TIFF_OBJ = tiff.o
  35. #endif
  36.  
  37. #ifdef HAS_JPEG
  38. JPEG_DEFS = -DHAS_JPEG -I/usr/local/include/jpeg
  39.  JPEG_LIB = -L/usr/local/lib/jpeg -ljpeg
  40.  JPEG_SRC = jpeg.c
  41.  JPEG_OBJ = jpeg.o
  42. #endif
  43.  
  44.   EXTRA_DEFINES = $(TIFF_DEFS) $(JPEG_DEFS)
  45. LOCAL_LIBRARIES = $(TIFF_LIB)  $(JPEG_LIB) $(XLIB)
  46.  
  47. END_OF_INPUT
  48.  
  49. echo "SRCS = $1"' $(TIFF_SRC) $(JPEG_SRC)' >> $OUT
  50. echo "OBJS = $2"' $(TIFF_OBJ) $(JPEG_OBJ)' >> $OUT
  51.  
  52. cat >> $OUT << END_OF_INPUT
  53.  
  54. AllTarget(xloadimage uufilter)
  55. ComplexProgramTarget(xloadimage)
  56. NormalProgramTarget(uufilter,uufilter.o,,,)
  57. InstallProgram(uufilter,$(BINDIR))
  58. InstallManPage(uufilter,$(MANDIR))
  59.  
  60. install:: $(SYSPATHFILE)
  61.     $(RM) $(BINDIR)/xview $(BINDIR)/xsetbg
  62.     cd $(BINDIR); $(LN) xloadimage xview; $(LN) xloadimage xsetbg
  63.  
  64. clean::
  65.     /bin/rm -f build.c
  66.  
  67. build.c:
  68.     ./build-info
  69.  
  70. $(SYSPATHFILE):
  71.     @echo "*** Creating default $(SYSPATHFILE) since you"
  72.     @echo "*** don't have one. This file is used to set up default places"
  73.     @echo "*** and names to look for images.  You probably want to edit"
  74.     @echo "*** it for your site.  See the xloadimage manual page for"
  75.     @echo "*** details on the contents of this file."
  76.     cp xloadimagerc $(SYSPATHFILE)
  77.     chmod a+r $(SYSPATHFILE)
  78.  
  79. END_OF_INPUT
  80.  
  81. chmod 444 $OUT
  82.