Makefile.in 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. #
  2. # Makefile -- build newsd
  3. #
  4. # Copyright 2003-2013 Michael Sweet
  5. # Copyright 2002 Greg Ercolano
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public Licensse as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. #
  21. ALL_CXXFLAGS = -I. $(CXXFLAGS) @ARCHFLAGS@ @LARGEFILE@ $(OPTIM) \
  22. -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
  23. ALL_LDFLAGS = $(LDFLAGS) @ARCHFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
  24. CXX = @CXX@
  25. CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
  26. HTMLDOC = @HTMLDOC@
  27. INSTALL = @INSTALL@
  28. LDFLAGS = @LDFLAGS@
  29. MKDIR = @MKDIR@
  30. MV = @MV@
  31. NROFF = @NROFF@
  32. POD2MAN = pod2man --center "newsd Documentation"
  33. POD2HTML = pod2html
  34. OPTIM = @OPTIM@
  35. RM = @RM@ -f
  36. SHELL = /bin/sh
  37. VERSION = @VERSION@
  38. #
  39. # Installation programs...
  40. #
  41. INSTALL_BIN = $(INSTALL) -c -m 555
  42. INSTALL_DATA = $(INSTALL) -c -m 444
  43. INSTALL_DIR = $(INSTALL) -d -m 755
  44. INSTALL_MAN = $(INSTALL) -c -m 444
  45. INSTALL_SCRIPT = $(INSTALL) -c -m 555
  46. #
  47. # Manpage extensions...
  48. #
  49. MAN5EXT = @MAN5EXT@
  50. MAN8EXT = @MAN8EXT@
  51. #
  52. # Directories...
  53. #
  54. bindir = @bindir@
  55. datadir = @datadir@
  56. datarootdir = @datarootdir@
  57. docdir = @docdir@
  58. exec_prefix = @exec_prefix@
  59. mandir = @mandir@
  60. prefix = @prefix@
  61. libdir = @libdir@
  62. localstatedir = @localstatedir@
  63. sbindir = @sbindir@
  64. srcdir = @srcdir@
  65. spooldir = @spooldir@
  66. sysconfdir = @sysconfdir@
  67. init_dir = @init_dir@
  68. init_target = @init_target@
  69. DESTDIR =
  70. TARGETS = newsd $(MANPAGES)
  71. OBJS = newsd.o Article.o Configuration.o Group.o Server.o
  72. DOCFILES = CHANGES LICENSE README \
  73. doc/rfc1036.txt doc/rfc2980.txt doc/rfc3977.txt
  74. MANPAGES = newsd.$(MAN8EXT) newsd.conf.$(MAN5EXT)
  75. VPATH = $(srcdir)
  76. #
  77. # Rules...
  78. #
  79. .SILENT:
  80. .SUFFIXES: .C .5.gz .8.gz .h .pod .o
  81. .C.o:
  82. echo Compiling $<...
  83. $(CXX) $(ALL_CXXFLAGS) -I. -I$(srcdir) -c $<
  84. .pod.5.gz .pod.8.gz:
  85. echo Generating $@...
  86. $(RM) $@
  87. $(POD2MAN) $< | gzip -9 >$@
  88. #
  89. # Make everything...
  90. #
  91. all: Makefile config.h $(TARGETS)
  92. #
  93. # Clean everything...
  94. #
  95. clean:
  96. echo Cleaning all files...
  97. $(RM) *.bck
  98. $(RM) $(OBJS)
  99. $(RM) $(TARGETS)
  100. #
  101. # Update/make dependencies...
  102. #
  103. depend:
  104. echo Updating dependencies...
  105. $(CXX) -MM $(ALL_CXXFLAGS) $(OBJS:.o=.C) >Dependencies
  106. #
  107. # Install everything...
  108. #
  109. install: install-$(init_target)
  110. echo Installing newsd in $(DESTDIR)$(sbindir)...
  111. $(INSTALL_DIR) $(DESTDIR)$(sbindir)
  112. $(INSTALL_BIN) newsd $(DESTDIR)$(sbindir)
  113. echo Installing newsd.conf in $(DESTDIR)$(sysconfdir)...
  114. $(INSTALL_DIR) $(DESTDIR)$(sysconfdir)
  115. if test -r $(DESTDIR)$(sysconfdir)/newsd.conf ; then \
  116. $(INSTALL_DATA) newsd.conf $(DESTDIR)$(sysconfdir)/newsd.conf.N ; \
  117. else \
  118. $(INSTALL_DATA) newsd.conf $(DESTDIR)$(sysconfdir) ; \
  119. fi
  120. echo Installing man pages in $(DESTDIR)$(mandir)...
  121. $(INSTALL_DIR) $(DESTDIR)$(mandir)/man5
  122. $(INSTALL_MAN) newsd.conf.$(MAN5EXT) $(DESTDIR)$(mandir)/man5
  123. $(INSTALL_DIR) $(DESTDIR)$(mandir)/man8
  124. $(INSTALL_MAN) newsd.$(MAN8EXT) $(DESTDIR)$(mandir)/man8
  125. echo Installing documentation in $(DESTDIR)$(docdir)...
  126. $(INSTALL_DIR) $(DESTDIR)$(docdir)
  127. for file in $(DOCFILES); do \
  128. $(INSTALL_MAN) $$file $(DESTDIR)$(docdir); \
  129. done
  130. $(INSTALL_SCRIPT) inn2newsd.sh $(DESTDIR)$(docdir)
  131. echo Creating news directory $(DESTDIR)$(spooldir)...
  132. $(INSTALL_DIR) $(DESTDIR)$(spooldir)
  133. echo Creating run directory $(DESTDIR)$(localstatedir)/run...
  134. $(INSTALL_DIR) $(DESTDIR)$(localstatedir)/run
  135. install-init:
  136. echo Installing startup script in $(DESTDIR)$(init_dir)...
  137. $(INSTALL_DIR) $(DESTDIR)$(init_dir)
  138. $(INSTALL_SCRIPT) newsd.sh $(DESTDIR)$(init_dir)/newsd
  139. install-launchd:
  140. echo Installing launchd plist file in $(DESTDIR)/Library/LaunchDaemons...
  141. $(INSTALL_DIR) $(DESTDIR)/Library/LaunchDaemons
  142. $(INSTALL_DATA) newsd.plist $(DESTDIR)/Library/LaunchDaemons/com.easysw.newsd.plist
  143. #
  144. # Uninstall everything...
  145. #
  146. uninstall: uninstall-$(init_target)
  147. echo Uninstalling newsd from $(DESTDIR)$(sbindir)...
  148. $(RM) $(DESTDIR)$(sbindir)/newsd
  149. echo Uninstalling newsd.conf from $(DESTDIR)$(sysconfdir)...
  150. -$(RM) $(DESTDIR)$(sysconfdir)/newsd.conf.N
  151. echo Uninstalling man pages from $(DESTDIR)$(mandir)...
  152. $(RM) $(DESTDIR)$(mandir)/man5/newsd.conf.$(MAN5EXT)
  153. $(RM) $(DESTDIR)$(mandir)/man8/newsd.$(MAN8EXT)
  154. echo Uninstalling documentation from $(DESTDIR)$(docdir)...
  155. for file in $(DOCFILES); do \
  156. $(RM) $(DESTDIR)$(docdir)/$$file; \
  157. done
  158. uninstall-init:
  159. echo Uninstallingg startup script from $(DESTDIR)$(init_dir)...
  160. $(RM) $(DESTDIR)$(init_dir)/newsd
  161. uninstall-launchd:
  162. echo Uninstallingg launchd plist from $(DESTDIR)/Library/LaunchDaemons...
  163. $(RM) $(DESTDIR)/Library/LaunchDaemons/com.easysw.newsd.plist
  164. #
  165. # Makefile
  166. #
  167. Makefile: Makefile.in configure
  168. echo Updating Makefile...
  169. if test -f config.status; then \
  170. ./config.status --recheck; \
  171. ./config.status; \
  172. else \
  173. ./configure; \
  174. fi
  175. touch config.h
  176. #
  177. # config.h
  178. #
  179. config.h: config.h.in configure
  180. echo Updating config.h...
  181. if test -f config.status; then \
  182. ./config.status --recheck; \
  183. ./config.status; \
  184. else \
  185. ./configure; \
  186. fi
  187. touch config.h
  188. #
  189. # newsd
  190. #
  191. newsd: $(OBJS)
  192. echo Linking $@...
  193. $(CXX) $(ALL_LDFLAGS) -o $@ $(OBJS) $(LIBS)
  194. include Dependencies
  195. #
  196. # Packages...
  197. #
  198. rpm:
  199. epm -v -nsm -f rpm --output-dir dist newsd
  200. osx:
  201. epm -v -nsm -f osx -s newsd.png --output-dir dist newsd
  202. #
  203. # End of "$Id: Makefile.in 171 2013-05-22 20:38:45Z msweet $".
  204. #