Makefile.am 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #
  2. # ngIRCd -- The Next Generation IRC Daemon
  3. # Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # Please read the file COPYING, README and AUTHORS for more information.
  10. #
  11. # $Id: Makefile.am,v 1.49 2006/03/11 01:48:50 alex Exp $
  12. #
  13. AUTOMAKE_OPTIONS = ../portab/ansi2knr
  14. INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool
  15. LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN \
  16. -varuse -retvalother -emptyret -unrecog
  17. sbin_PROGRAMS = ngircd
  18. ngircd_SOURCES = ngircd.c array.c channel.c client.c conf.c conn.c conn-func.c \
  19. conn-zip.c hash.c io.c irc.c irc-channel.c irc-info.c irc-login.c \
  20. irc-mode.c irc-op.c irc-oper.c irc-server.c irc-write.c lists.c log.c \
  21. match.c parse.c rendezvous.c resolve.c
  22. ngircd_LDFLAGS = -L../portab -L../tool
  23. ngircd_LDADD = -lngportab -lngtool
  24. noinst_HEADERS = ngircd.h array.h channel.h client.h conf.h conn.h conn-func.h \
  25. conn-zip.h hash.h io.h irc.h irc-channel.h irc-info.h irc-login.h \
  26. irc-mode.h irc-op.h irc-oper.h irc-server.h irc-write.h lists.h log.h \
  27. match.h parse.h rendezvous.h resolve.h \
  28. defines.h messages.h
  29. clean-local:
  30. rm -f check-version check-help lint.out cvs-version.*
  31. maintainer-clean-local:
  32. rm -f Makefile Makefile.in
  33. check-version: Makefile
  34. echo "#!/bin/sh" > check-version
  35. echo "./ngircd --version | grep ngircd >/dev/null 2>&1" >>check-version
  36. chmod 755 check-version
  37. check-help: Makefile
  38. echo "#!/bin/sh" > check-help
  39. echo "./ngircd --help | grep help >/dev/null 2>&1" >>check-help
  40. chmod 755 check-help
  41. lint:
  42. @splint --version >/dev/null 2>&1 \
  43. || ( echo; echo "Error: \"splint\" not found!"; echo; exit 1 )
  44. @echo; warnings=0; files=0; \
  45. for f in *.c; do \
  46. echo "checking $$f ..."; \
  47. splint $$f $(LINTARGS) -I$(srcdir) -I$(srcdir)/.. \
  48. $(INCLUDES) $(AM_CFLAGS) >lint.out 2>&1; \
  49. grep "no warnings" lint.out > /dev/null 2>&1; \
  50. if [ $$? -ne 0 ]; then \
  51. waswarning=1; \
  52. echo; grep -v "^Command Line: " lint.out; echo; \
  53. w=$$( grep "code warning" lint.out | $(AWK) "{ print \$$4 }" ); \
  54. [ "$$w" -gt 0 ] && warnings=`expr $$warnings + $$w`; \
  55. files=`expr $$files + 1`; \
  56. else \
  57. waswarning=0; \
  58. fi; \
  59. rm -f lint.out; \
  60. done; \
  61. [ $$waswarning -eq 0 ] && echo; \
  62. [ $$warnings -gt 0 ] \
  63. && echo "Result: $$warnings warning(s) in $$files file(s)!" \
  64. || echo "Result: no warnings found."; \
  65. echo; [ $$warnings -gt 0 ] && exit 1
  66. ngircd.c: cvs-version.h
  67. irc-login.c: cvs-version.h
  68. irc-info.c: cvs-version.h
  69. cvs-version.h: cvs-date
  70. cvs-date:
  71. grep VERSION ../config.h | grep "CVS" \
  72. && echo "#define CVSDATE \"$$( grep "\$$Id" $(srcdir)/*.c \
  73. | $(AWK) "{ print \$$9 }" | sort | tail -1 \
  74. | sed -e "s/\//-/g" )\"" > cvs-version.new \
  75. || echo "" > cvs-version.new
  76. diff cvs-version.h cvs-version.new 2>/dev/null \
  77. || cp cvs-version.new cvs-version.h
  78. TESTS = check-version check-help
  79. # -eof-