123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- #
- # Makefile -- build newsd
- #
- # Copyright 2003-2013 Michael Sweet
- # Copyright 2002 Greg Ercolano
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public Licensse as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #
- ALL_CXXFLAGS = -I. $(CXXFLAGS) @ARCHFLAGS@ @LARGEFILE@ $(OPTIM) \
- -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
- ALL_LDFLAGS = $(LDFLAGS) @ARCHFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
- CXX = @CXX@
- CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
- HTMLDOC = @HTMLDOC@
- INSTALL = @INSTALL@
- LDFLAGS = @LDFLAGS@
- MKDIR = @MKDIR@
- MV = @MV@
- NROFF = @NROFF@
- POD2MAN = pod2man --center "newsd Documentation"
- POD2HTML = pod2html
- OPTIM = @OPTIM@
- RM = @RM@ -f
- SHELL = /bin/sh
- VERSION = @VERSION@
- #
- # Installation programs...
- #
- INSTALL_BIN = $(INSTALL) -c -m 555
- INSTALL_DATA = $(INSTALL) -c -m 444
- INSTALL_DIR = $(INSTALL) -d -m 755
- INSTALL_MAN = $(INSTALL) -c -m 444
- INSTALL_SCRIPT = $(INSTALL) -c -m 555
- #
- # Manpage extensions...
- #
- MAN5EXT = @MAN5EXT@
- MAN8EXT = @MAN8EXT@
- #
- # Directories...
- #
- bindir = @bindir@
- datadir = @datadir@
- datarootdir = @datarootdir@
- docdir = @docdir@
- exec_prefix = @exec_prefix@
- mandir = @mandir@
- prefix = @prefix@
- libdir = @libdir@
- localstatedir = @localstatedir@
- sbindir = @sbindir@
- srcdir = @srcdir@
- spooldir = @spooldir@
- sysconfdir = @sysconfdir@
- init_dir = @init_dir@
- init_target = @init_target@
- DESTDIR =
- TARGETS = newsd $(MANPAGES)
- OBJS = newsd.o Article.o Configuration.o Group.o Server.o
- DOCFILES = CHANGES LICENSE README \
- doc/rfc1036.txt doc/rfc2980.txt doc/rfc3977.txt
- MANPAGES = newsd.$(MAN8EXT) newsd.conf.$(MAN5EXT)
- VPATH = $(srcdir)
- #
- # Rules...
- #
- .SILENT:
- .SUFFIXES: .C .5.gz .8.gz .h .pod .o
- .C.o:
- echo Compiling $<...
- $(CXX) $(ALL_CXXFLAGS) -I. -I$(srcdir) -c $<
- .pod.5.gz .pod.8.gz:
- echo Generating $@...
- $(RM) $@
- $(POD2MAN) $< | gzip -9 >$@
- #
- # Make everything...
- #
- all: Makefile config.h $(TARGETS)
- #
- # Clean everything...
- #
- clean:
- echo Cleaning all files...
- $(RM) *.bck
- $(RM) $(OBJS)
- $(RM) $(TARGETS)
- #
- # Update/make dependencies...
- #
- depend:
- echo Updating dependencies...
- $(CXX) -MM $(ALL_CXXFLAGS) $(OBJS:.o=.C) >Dependencies
- #
- # Install everything...
- #
- install: install-$(init_target)
- echo Installing newsd in $(DESTDIR)$(sbindir)...
- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
- $(INSTALL_BIN) newsd $(DESTDIR)$(sbindir)
- echo Installing newsd.conf in $(DESTDIR)$(sysconfdir)...
- $(INSTALL_DIR) $(DESTDIR)$(sysconfdir)
- if test -r $(DESTDIR)$(sysconfdir)/newsd.conf ; then \
- $(INSTALL_DATA) newsd.conf $(DESTDIR)$(sysconfdir)/newsd.conf.N ; \
- else \
- $(INSTALL_DATA) newsd.conf $(DESTDIR)$(sysconfdir) ; \
- fi
- echo Installing man pages in $(DESTDIR)$(mandir)...
- $(INSTALL_DIR) $(DESTDIR)$(mandir)/man5
- $(INSTALL_MAN) newsd.conf.$(MAN5EXT) $(DESTDIR)$(mandir)/man5
- $(INSTALL_DIR) $(DESTDIR)$(mandir)/man8
- $(INSTALL_MAN) newsd.$(MAN8EXT) $(DESTDIR)$(mandir)/man8
- echo Installing documentation in $(DESTDIR)$(docdir)...
- $(INSTALL_DIR) $(DESTDIR)$(docdir)
- for file in $(DOCFILES); do \
- $(INSTALL_MAN) $$file $(DESTDIR)$(docdir); \
- done
- $(INSTALL_SCRIPT) inn2newsd.sh $(DESTDIR)$(docdir)
- echo Creating news directory $(DESTDIR)$(spooldir)...
- $(INSTALL_DIR) $(DESTDIR)$(spooldir)
- echo Creating run directory $(DESTDIR)$(localstatedir)/run...
- $(INSTALL_DIR) $(DESTDIR)$(localstatedir)/run
- install-init:
- echo Installing startup script in $(DESTDIR)$(init_dir)...
- $(INSTALL_DIR) $(DESTDIR)$(init_dir)
- $(INSTALL_SCRIPT) newsd.sh $(DESTDIR)$(init_dir)/newsd
- install-launchd:
- echo Installing launchd plist file in $(DESTDIR)/Library/LaunchDaemons...
- $(INSTALL_DIR) $(DESTDIR)/Library/LaunchDaemons
- $(INSTALL_DATA) newsd.plist $(DESTDIR)/Library/LaunchDaemons/com.easysw.newsd.plist
- #
- # Uninstall everything...
- #
- uninstall: uninstall-$(init_target)
- echo Uninstalling newsd from $(DESTDIR)$(sbindir)...
- $(RM) $(DESTDIR)$(sbindir)/newsd
- echo Uninstalling newsd.conf from $(DESTDIR)$(sysconfdir)...
- -$(RM) $(DESTDIR)$(sysconfdir)/newsd.conf.N
- echo Uninstalling man pages from $(DESTDIR)$(mandir)...
- $(RM) $(DESTDIR)$(mandir)/man5/newsd.conf.$(MAN5EXT)
- $(RM) $(DESTDIR)$(mandir)/man8/newsd.$(MAN8EXT)
- echo Uninstalling documentation from $(DESTDIR)$(docdir)...
- for file in $(DOCFILES); do \
- $(RM) $(DESTDIR)$(docdir)/$$file; \
- done
- uninstall-init:
- echo Uninstallingg startup script from $(DESTDIR)$(init_dir)...
- $(RM) $(DESTDIR)$(init_dir)/newsd
- uninstall-launchd:
- echo Uninstallingg launchd plist from $(DESTDIR)/Library/LaunchDaemons...
- $(RM) $(DESTDIR)/Library/LaunchDaemons/com.easysw.newsd.plist
- #
- # Makefile
- #
- Makefile: Makefile.in configure
- echo Updating Makefile...
- if test -f config.status; then \
- ./config.status --recheck; \
- ./config.status; \
- else \
- ./configure; \
- fi
- touch config.h
- #
- # config.h
- #
- config.h: config.h.in configure
- echo Updating config.h...
- if test -f config.status; then \
- ./config.status --recheck; \
- ./config.status; \
- else \
- ./configure; \
- fi
- touch config.h
- #
- # newsd
- #
- newsd: $(OBJS)
- echo Linking $@...
- $(CXX) $(ALL_LDFLAGS) -o $@ $(OBJS) $(LIBS)
- include Dependencies
- #
- # Packages...
- #
- rpm:
- epm -v -nsm -f rpm --output-dir dist newsd
- osx:
- epm -v -nsm -f osx -s newsd.png --output-dir dist newsd
- #
- # End of "$Id: Makefile.in 171 2013-05-22 20:38:45Z msweet $".
- #
|