home *** CD-ROM | disk | FTP | other *** search
Makefile | 1996-02-02 | 9.4 KB | 335 lines |
- # -- Which C compiler to use to compile the incoming mail interface?
- CC=cc
- # -- Compiler options?
- CFLAGS=-O
- # -- Where should the LISTSERV mail and command line interfaces be installed?
- BINDIR=/usr/local/bin
- # -- Where should the server code and data files LISTSERV needs be placed?
- # >> If upgrading from 1.8a to 1.8b, please note that the default value
- # >> for this variable has changed. You do not need to relocate your
- # >> production directories, the previous default was just changed because
- # >> it was too confusing ('lsv' directory vs 'lsv' executable)
- LSVROOT=/home/listserv
- # -- Where should incoming mail messages be stored?
- LSVSPOOL=$(LSVROOT)/spool
- # -- The username of the listserv server.
- LSVNAME=listserv
- # -- Where is the sendmail "aliases" file?
- ALIASES=/etc/aliases
- # -- Set LSVAMIN_TYPE depending on how target userids are to be
- # -- passed to lsv_amin. Use "links" to symbolic links to "lsv_amin"
- # -- for each LISTSERV e-mail address. ZMAILER users must choose this
- # -- option since programs run from ZMAILER "aliases" files can't have
- # -- arguments. Choose "flags" to have the target userid passed to
- # -- "lsv_amin" with the "-t user" flag.
- LSVAMIN_TYPE=flags
- #
- WHOAMI=whoami
- #WHOAMI=/usr/ucb/whoami # Uncomment for Solaris
- #
- # - - - - You probably don't want to change any of the other macros - - - -
- # -- Directories used by LISTSERV.
- LSVDIRS=$(LSVROOT) $(LSVROOT)/home $(LSVROOT)/tmp
- #
- SHELL=/bin/sh
- #
- WHICH=$(NAME)$(name)
- #
- CFLAGS_Solaris=-lsocket -lnsl
- CFLAGS_INTERACTIVE=-linet -lcposix
- CFLAGS_OSF1=-taso -lots
- CFLAGS_AIX=
- CFLAGS_SunOS=
- CFLAGS_SCO_SV=-lsocket
- #
- IS_SOLARIS=`uname` = 'SunOS' -a \
- `uname -r | awk '{ if(\$$1<5) printf("0"); else printf("1") }'` = 1
-
- help:
- @echo " ";\
- echo "Before you build either the LISTSERV server or the mail"\
- "interface";\
- echo "check the BINDIR, LSVROOT and LSVSPOOL macros in this"\
- "Makefile.";\
- echo " ";\
- echo "To make the LISTSERV server enter, make listserv";\
- echo "To make the LISTSERV mail interface enter, make mailer";\
- echo "To make the command line interface enter, make lcmd";\
- echo "To make the job viewer utility enter, make jobview";\
- echo "To install/update just the mailer enter, make install_mailer";\
- echo "To install/update just the server enter, make install_server";\
- echo "To install/update just 'lcmd' enter, make install_lcmd";\
- echo "To install/update just 'jobview' enter, make install_jobview";\
- echo "Once you're sure everything built successfully,"\
- " make install";\
- echo "To refresh programs/files on an existing system, make update";\
- echo "To add entries to the sendmail aliases file for LISTSERV,"\
- " make aliases";\
- echo "To add aliases file entries for a new mailing list,"\
- " make list name=XXX";\
- echo "(where XXX is the name of the list).";\
- echo " ";\
- echo "Please refer to the installation guide for more detailed"\
- "information."
-
- # -- creating the executables
- #
- # -- The ")" test is to catch systems with make's that can't handle
- # -- $(AA$(BB)) type macros.
- lsv_prog:
- if [ "$(CFLAGS_$(UNAME))" = ")" ]; then \
- $(CC) -o lsv lsv.o; \
- else \
- $(CC) -o lsv lsv.o `echo "$(CFLAGS_$(UNAME))"`; \
- fi
-
- lsv: lsv.o
- if [ $(IS_SOLARIS) ]; then \
- make lsv_prog UNAME=Solaris; \
- else \
- make lsv_prog UNAME=`uname`; \
- fi
-
- lsv_util:
- if [ "$(CFLAGS_$(UNAME))" = ")" ]; then \
- $(CC) -o $(PROG) $(PROG).c $(CFLAGS) $(XOPT); \
- else \
- $(CC) -o $(PROG) $(PROG).c `echo "$(CFLAGS_$(UNAME))"` $(CFLAGS) \
- $(XOPT); \
- fi
- if [ `$(WHOAMI)` != "$(LSVNAME)" ]; \
- then chown $(LSVNAME) $(PROG); \
- else true; \
- fi
- if [ ".$(UMOD)" != "." ]; then chmod 4755 $(PROG); fi
-
- lsv_amin: lsv_amin.c lsv_amin.h
- if [ $(IS_SOLARIS) ]; then \
- make lsv_util UNAME=Solaris PROG=$@ UMOD=4755 \
- XOPT='-DSPOOL_DIR=\"$(LSVSPOOL)\"'; \
- else \
- make lsv_util UNAME=`uname` PROG=$@ UMOD=4755 \
- XOPT='-DSPOOL_DIR=\"$(LSVSPOOL)\"'; \
- fi
-
- lcmd: lcmd.c
- if [ $(IS_SOLARIS) ]; then \
- make lsv_util UNAME=Solaris PROG=$@ UMOD=4755 \
- XOPT='-DSPOOL_DIR=\"$(LSVSPOOL)\"'; \
- else \
- make lsv_util UNAME=`uname` PROG=$@ UMOD=4755 \
- XOPT='-DSPOOL_DIR=\"$(LSVSPOOL)\"'; \
- fi
-
- jobview: jobview.c
- if [ $(IS_SOLARIS) ]; then \
- make lsv_util UNAME=Solaris PROG=$@; \
- else \
- make lsv_util UNAME=`uname` PROG=$@; \
- fi
-
- # -- installing the executables and data files needed to run LISTSERV
- $(LSVDIRS) $(LSVSPOOL):
- if [ `$(WHOAMI)` = $(LSVNAME) ]; \
- then umask 066;mkdir -p $@; \
- else su $(LSVNAME) -c "umask 066;mkdir -p $@"; \
- fi
-
- directories: $(LSVDIRS) $(LSVSPOOL)
-
- # -- Generic entries for files in the LSV-root and LSV-root/home directories
- $(LSVROOT)/$(RFILE): $(RFILE)
- cp $(RFILE) $@
- if [ ".$(RMOD)" != "." ]; then chmod $(RMOD) $@; else true; fi
-
- $(LSVROOT)/home/$(HFILE): home/$(HFILE)
- cp home/$(HFILE) $@
-
- # -- installed copies of programs
- $(BINDIR)/lcmd: lcmd
- cp lcmd $@
- if [ `$(WHOAMI)` != $(LSVNAME) ]; then chown $(LSVNAME) $@; else true; fi
- chmod 4755 $@
- if [ `pwd` != $(LSVROOT) ]; then \
- if [ -s $(LSVROOT)/lcmd.c ]; then \
- mv $(LSVROOT)/lcmd.c $(LSVROOT)/lcmd.c.OLD; \
- else true; \
- fi; \
- cp lcmd.c $(LSVROOT)/lcmd.c; \
- else true; \
- fi
-
- $(BINDIR)/lsv_amin: lsv_amin
- cp lsv_amin $@
- if [ `$(WHOAMI)` != $(LSVNAME) ]; then chown $(LSVNAME) $@; else true; fi
- chmod 4755 $@
- if [ `pwd` != $(LSVROOT) ]; then \
- if [ -s $(LSVROOT)/lsv_amin.c ]; then \
- mv $(LSVROOT)/lsv_amin.c $(LSVROOT)/lsv_amin.c.OLD; \
- else true; \
- fi; \
- cp lsv_amin.c $(LSVROOT)/lsv_amin.c; \
- if [ -s $(LSVROOT)/lsv_amin.h ]; then \
- mv $(LSVROOT)/lsv_amin.h $(LSVROOT)/lsv_amin.h.OLD; \
- else true; \
- fi; \
- cp lsv_amin.h $(LSVROOT)/lsv_amin.h; \
- else true; \
- fi
-
- $(LSVSPOOL)/jobview: jobview
- cp jobview $@
- if [ `$(WHOAMI)` != $(LSVNAME) ]; then chown $(LSVNAME) $@; else true; fi
- if [ `pwd` != $(LSVROOT) ]; then \
- if [ -s $(LSVROOT)/jobview.c ]; then \
- mv $(LSVROOT)/jobview.c $(LSVROOT)/jobview.c.OLD; \
- else true; \
- fi; \
- cp jobview.c $(LSVROOT)/jobview.c; \
- else true; \
- fi
-
- $(LSVROOT)/lsv: lsv
- cp lsv $@
- if [ `$(WHOAMI)` != $(LSVNAME) ]; then chown $(LSVNAME) $@; else true; fi
-
- $(LSVROOT)/go.user: $(LSVROOT)
- if [ ! -s $@ ]; then \
- cp go.user.sample $@; \
- chmod 750 $@; \
- if [ `$(WHOAMI)` != $(LSVNAME) ]; then chown $(LSVNAME) $@; \
- else true; \
- fi; \
- else true; \
- fi
-
- $(LSVROOT)/go.sys:
- echo "#!/bin/sh" >go.sys.temp
- echo "LSVROOT="$(LSVROOT) >>go.sys.temp
- echo "LSVSPOOL="$(LSVSPOOL) >>go.sys.temp
- cat go.sys >>go.sys.temp
- cp go.sys.temp $@
- chmod 750 $@
- if [ `$(WHOAMI)` != $(LSVNAME) ]; then chown $(LSVNAME) $@; else true; fi
- rm go.sys.temp
-
- # -- aliases used to install specific pieces
- install_lcmd: $(BINDIR)/lcmd
-
- install_jobview: $(LSVSPOOL)/jobview
-
- install_mailer: $(BINDIR)/lsv_amin
-
- install_server: $(LSVROOT)/lsv
-
- install: $(LSVROOT)/go.user $(LSVDIRS) $(LSVSPOOL)
- if [ -s lsv.o ]; then make install_server; else true; fi
- if [ -s lsv_amin.c ]; then make install_mailer; else true; fi
- if [ -s lcmd.c ]; then make install_lcmd; else true; fi
- if [ -s jobview.c ]; then make install_jobview; else true; fi
- if [ -s u-install.memo ]; then \
- make $(LSVROOT)/u-install.memo RFILE=u-install.memo; \
- else true; \
- fi
- if [ -s go.sys ]; then \
- if [ -s $(LSVROOT)/go.sys ]; then \
- mv $(LSVROOT)/go.sys $(LSVROOT)/go.sys.OLD; \
- else true; \
- fi; \
- make $(LSVROOT)/go.sys; \
- else true; \
- fi
- if [ -s go ]; then \
- if [ -s $(LSVROOT)/go ]; then \
- mv $(LSVROOT)/go $(LSVROOT)/go.OLD; \
- else true; \
- fi; \
- cp go $(LSVROOT)/go; \
- chmod 750 $(LSVROOT)/go; \
- else true; \
- fi
- if [ -s Makefile ]; then \
- if [ -s $(LSVROOT)/Makefile ]; then \
- mv $(LSVROOT)/Makefile $(LSVROOT)/Makefile.OLD; \
- else true; \
- fi; \
- cp Makefile $(LSVROOT)/Makefile; \
- else true; \
- fi
- if [ -s license.merge ]; then \
- cp license.merge $(LSVROOT)/home/license.merge; \
- else true; \
- fi
- if [ -d home ]; then \
- FLIST=`ls home`; \
- set -e; \
- for CHK in $$FLIST; do \
- make $(LSVROOT)/home/$$CHK HFILE=$$CHK; \
- done; \
- else true; \
- fi
- if [ `$(WHOAMI)` != $(LSVNAME) ]; then \
- cd $(LSVROOT); \
- chown -R $(LSVNAME) $(LSVDIRS); \
- else true; \
- fi
- @echo " "
- @echo "-- All files have been successfully installed. Next please" \
- "enter,"
- @echo "-- cd $(LSVROOT)"
- @echo "-- and edit 'go.user'. The environment variables defined in" \
- "that file"
- @echo "-- must be customized before you start LISTSERV."
-
- LSV_aliases:
- if [ ".$(LSVAMIN_TYPE)" = ".links" ]; then \
- echo "$(NEW_A): \"|$(BINDIR)/$(NEW_A)\"" >>$(ALIASES); \
- ln -s $(BINDIR)/lsv_amin $(BINDIR)/$(NEW_A); \
- else \
- echo "$(NEW_A): \"|$(BINDIR)/lsv_amin -t $(NEW_A)\"" >>$(ALIASES); \
- fi
-
- aliases:
- echo "# -- Aliases for LISTSERV server" >>$(ALIASES)
- make LSV_aliases NEW_A=listserv
- make LSV_aliases NEW_A=owner-listserv
- newaliases
- if [ -s '/etc/sendmail.pid' ]; then \
- kill -HUP `cat /etc/sendmail.pid`; \
- else true; \
- fi
-
- list:
- echo "# -- Aliases for '$(WHICH)' mailing list" >>$(ALIASES)
- make LSV_aliases NEW_A=$(WHICH)
- make LSV_aliases NEW_A=owner-$(WHICH)
- make LSV_aliases NEW_A=$(WHICH)-request
- make LSV_aliases NEW_A=$(WHICH)-search-request
- make LSV_aliases NEW_A=$(WHICH)-server
- newaliases
- if [ -s '/etc/sendmail.pid' ]; then \
- kill -HUP `cat /etc/sendmail.pid`; \
- else true; \
- fi
-
- # -- aliases for other things (which are defined above)
- both: lsv_amin lsv
-
- all world: lsv_amin lsv lcmd jobview
-
- LISTSERV listserv server: lsv
-
- mailer: lsv_amin
-
- update_utils install_utils: install_lcmd install_jobview
-
- update: install
-
- update_mailer: install_mailer
-
- update_lcmd: install_lcmd
-
- update_jobview: install_jobview
-
- update_server: install_server
-