home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / wincam.zip / winc_src.zip / makefile.org < prev    next >
Makefile  |  1997-02-28  |  5KB  |  173 lines

  1. #
  2. # winc makefile -- requires GNU make
  3. #
  4. # Copyright (C) 1996, Paul G. Fox
  5. # This software may not be, in whole or in part, licensed or sold for
  6. # profit as a software product itself, nor may it be included in or
  7. # distributed with commercial products without prior written permission. 
  8. # This restriction does not apply to the inclusion of this source code in
  9. # collections of published source code, even where those collections are
  10. # sold as commercial products in their own right.  This copyright notice
  11. # must not be removed, altered, or obscured.  pgf@foxharp.boston.ma.us
  12. #
  13. # $Header: E:/winc/RCS/makefile.org 1.1 1997/03/01 03:44:56 Derek Exp Derek $
  14. #
  15.  
  16. # most of this package is a library of camera access routines.  
  17. # the program winc itself is a simple command line interface to that
  18. # library.
  19. # of the headers, only wincam.h is "public" -- the rest should be
  20. # considered library-internal.
  21.  
  22. # what get's built -- a library/header file combo, and a couple of
  23. #  programs that use it.
  24. LIB = libwinc.a
  25. INCLFILE = wincam.h
  26. PROGRAMS = winc.exe wincd.exe 
  27. MANPAGES = winc.1 wincd.1 xwinc.1
  28. MANFORMATTED = winc.man wincd.man xwinc.man
  29.  
  30. # where they all go on "make install", respectively
  31. INST_BINDIR = /usr/local/bin
  32. INST_INCDIR = /usr/local/include
  33. INST_LIBDIR = /usr/local/lib
  34. INST_MANDIR = /usr/local/man/man1
  35.  
  36. # build-tool setup
  37. CC = gcc
  38. # i had trouble with "winc -D" on freebsd without this.  odd.
  39. # CC  = gcc --static
  40.  
  41. # PROF=-pg
  42. CFLAGS = -MD    # auto-dependency (file.d) generation, requires GNU make below
  43. CFLAGS += -g -O -Wall -Wstrict-prototypes -Wshadow $(PROF)
  44. #CFLAGS += -I/usr/X11R6/include -I/usr/openwin/include
  45. MORELIBS = -lm
  46. XLIBS = -L/usr/X11R6/lib -L/usr/openwin/lib -lX11 -lXext
  47. RANLIB = ranlib
  48. INSTALL        = /usr/bin/install -c
  49. INSTALL_PROGRAM    = ${INSTALL}
  50. INSTALL_DATA    = ${INSTALL} -m 644
  51.  
  52. PRIVATE_HEADERS = private.h trace.h pnm.h color.h
  53. LIBSRC = find.c view.c image.c trace.c comms.c \
  54.     protocol.c diags.c convert.c config.c mergeenv.c pnm.c vignette.c \
  55.     color.c locks.c starfield.c
  56. SRC = winc.c wincd.c xwinc.c
  57.  
  58. OTHERSTUFF =  README Makefile ChangeLog $(INCLFILE) $(MANPAGES) \
  59.         grabber.sh wincd_script xv-winc.patch COPYING 
  60.  
  61. DISTFILES = $(OTHERSTUFF) \
  62.     $(SRC) $(LIBSRC) \
  63.     $(PRIVATE_HEADERS) $(PUBLIC_HEADERS)
  64.  
  65.  
  66. OBJ = $(SRC:%.c=%.o)
  67. LIBOBJ = $(LIBSRC:%.c=%.o)
  68.  
  69. all: $(PROGRAMS)
  70.  
  71. winc.exe: winc.o $(LIB)
  72.     $(CC) $(PROF) -o winc.exe winc.o $(LIB) $(MORELIBS)
  73.  
  74. wincd.exe: wincd.o $(LIB)
  75.     $(CC) $(PROF) -o wincd.exe wincd.o $(LIB) $(MORELIBS)
  76.  
  77. #xwinc: xwinc.o $(LIB)
  78. #    $(CC) $(PROF) -o xwinc xwinc.o $(LIB) $(MORELIBS) $(XLIBS)
  79.  
  80. clean:
  81.     rm -f $(OBJ) $(LIBOBJ) *.d
  82.  
  83. $(LIB): $(LIBOBJ)
  84.     -rm -f $@
  85.     $(AR) cq $@ $^
  86.     $(AR) s $@ $^
  87.  
  88. # distribute a compiled man page, as well as the source
  89. winc.man: winc.1
  90.     nroff -man winc.1 | col -b >winc.man
  91.  
  92. wincd.man: wincd.1
  93.     nroff -man wincd.1 | col -b >wincd.man
  94.  
  95. xwinc.man: xwinc.1
  96.     nroff -man xwinc.1 | col -b >xwinc.man
  97.  
  98. install: installdirs $(PROGRAMS) $(LIB) $(MANPAGES)
  99.     $(INSTALL_PROGRAM) winc  $(INST_BINDIR)/winc
  100.     $(INSTALL_PROGRAM) wincd  $(INST_BINDIR)/wincd
  101.     $(INSTALL_PROGRAM) xwinc  $(INST_BINDIR)/xwinc
  102.     $(INSTALL_DATA)    $(INCLFILE) $(INST_INCDIR)/$(INCLFILE)
  103.     $(INSTALL_DATA)    $(LIB)      $(INST_LIBDIR)/$(LIB)
  104.     $(INSTALL_DATA)    winc.1  $(INST_MANDIR)/winc.1
  105.     $(INSTALL_DATA)    wincd.1  $(INST_MANDIR)/wincd.1
  106.     $(INSTALL_DATA)    xwinc.1  $(INST_MANDIR)/xwinc.1
  107.  
  108. installdirs:
  109.     -mkdir -p $(INST_BINDIR) $(INST_INCDIR) $(INST_LIBDIR) $(INST_MANDIR)
  110.  
  111. # list the files
  112. list:
  113.     @ls $(DISTFILES)
  114.  
  115. # list the writable files
  116. rw:
  117.     @ls -l $(DISTFILES) |\
  118.         egrep '^[^l].w' | \
  119.         sed 's;.* ;;'   # strip to last space
  120.  
  121. /tmp/wincvers: ALWAYS
  122.     @expr "`egrep 'VERSION' private.h`" : \
  123.         '.* \([0-9][0-9].*\)".*' >/tmp/wincvers
  124.     @echo Current version is `cat /tmp/wincvers`
  125.  
  126. tarball:    $(DISTFILES) release_warnings /tmp/wincvers $(MANFORMATTED)
  127.     echo winc-`cat /tmp/wincvers` > .fname
  128.     rm -rf `cat .fname`
  129.     mkdir `cat .fname`
  130.     SRCDIR=. ;\
  131.     test "$(srcdir)" = "\@srcdir\@" && SRCDIR=$(srcdir) ;\
  132.     for file in $(DISTFILES) $(MANFORMATTED) ; do \
  133.       ln $$SRCDIR/$$file `cat .fname` \
  134.         || { echo copying $$file instead; cp -p $$file `cat .fname`; }; \
  135.     done
  136.     tar -czf `cat .fname`.tar.gz `cat .fname`
  137.     @echo Created `cat .fname`.tar.gz 
  138.     rm -rf `cat .fname` .fname
  139.  
  140. sharball:    $(DISTFILES) release_warnings /tmp/wincvers $(MANFORMATTED)
  141.     echo winc-`cat /tmp/wincvers` > .fname
  142.     rm -rf `cat .fname`
  143.     mkdir `cat .fname`
  144.     SRCDIR=. ;\
  145.     test "$(srcdir)" = "\@srcdir\@" && SRCDIR=$(srcdir) ;\
  146.     for file in $(DISTFILES) $(MANFORMATTED) ; do \
  147.       ln $$SRCDIR/$$file `cat .fname` \
  148.         || { echo copying $$file instead; cp -p $$file `cat .fname`; }; \
  149.     done
  150.     shar -spgf@foxharp.boston.ma.us -n`cat .fname` \
  151.         -o vileshar README $(MANFORMATTED) `ls $(DISTFILES) | \
  152.         sed '/^README$$/d'` ; \
  153.     mv vileshar.01 `cat .fname`.shar ; \
  154.     echo Created `cat .fname`.shar
  155.     rm -rf `cat .fname` .fname
  156.  
  157. release_warnings:
  158.     @echo
  159.     @echo 'Do you need to update the version info in private.h?  it says:'
  160.     @egrep 'VERSION|DATE' private.h
  161.     @echo -n "Hit return to continue..."
  162.     @read a
  163.  
  164. # include the auto-generated dependencies
  165. files := $(foreach file, $(wildcard ./*.d), $(file))
  166. ifneq ($(strip $(files)),)
  167.     include $(files)
  168. endif
  169.  
  170.  
  171.  
  172. ALWAYS:
  173.