home *** CD-ROM | disk | FTP | other *** search
/ The UNIX CD Bookshelf / OREILLY_TUCB_UNIX_CD.iso / upt / examples / SOURCES / JOT / TOOLS.Z / TOOLS / tools / Makefile < prev    next >
Encoding:
Makefile  |  1991-11-07  |  1.1 KB  |  51 lines

  1. DESTDIR=
  2. BINDIR=/usr/contrib/bin
  3. CFLAGS=    -O
  4. STD=    jot lam rs
  5.  
  6. all:    ${STD}
  7.  
  8. ${STD}:
  9.     cc ${CFLAGS} -o $@ $@.c
  10.  
  11. install:
  12.     install -s jot ${DESTDIR}${BINDIR}/jot
  13.     install -s lam ${DESTDIR}${BINDIR}/lam
  14.     install -s rs ${DESTDIR}${BINDIR}/rs
  15.  
  16. clean:
  17.     rm -f a.out core *.s *.o
  18.     rm -f ${STD}
  19.  
  20. depend:
  21.     cat </dev/null >x.c
  22.     for i in ${STD}; do \
  23.         (echo $$i: $$i.c >>makedep; \
  24.         /bin/grep '^#[     ]*include' x.c $$i.c | sed \
  25.             -e 's,<\(.*\)>,"/usr/include/\1",' \
  26.             -e 's/:[^"]*"\([^"]*\)".*/: \1/' \
  27.             -e 's/\.c//' >>makedep); done
  28.     echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
  29.     echo '$$r makedep' >>eddep
  30.     echo 'w' >>eddep
  31.     cp Makefile Makefile.bak
  32.     ed - Makefile < eddep
  33.     rm eddep makedep x.c
  34.     echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
  35.     echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
  36.     echo '# see make depend above' >> Makefile
  37.  
  38. # DO NOT DELETE THIS LINE -- make depend uses it
  39.  
  40. jot: jot.c
  41. jot: /usr/include/stdio.h
  42. jot: /usr/include/ctype.h
  43. lam: lam.c
  44. lam: /usr/include/stdio.h
  45. rs: rs.c
  46. rs: /usr/include/stdio.h
  47. rs: /usr/include/ctype.h
  48. # DEPENDENCIES MUST END AT END OF FILE
  49. # IF YOU PUT STUFF HERE IT WILL GO AWAY
  50. # see make depend above
  51.