Path: utzoo!utgpu!attcan!uunet!mcvax!ukc!strath-cs!glasgow!Robert From: robert@vax1.computing-maths.cardiff.ac.uk (Robert Evans) Newsgroups: comp.mail.sendmail,mail.uk-sendmail-workers Subject: UkSendmail1.5 dom,chn Makefiles fall over on Ultrix Message-ID: <20752.8807291627@uk.ac.cardiff.computing-maths.vax1> Date: 29 Jul 88 16:27:50 GMT Sender: daemon@cs.glasgow.ac.uk Lines: 72 X-Mailer: Mail User's Shell (6.3 6/25/88) X-mailer: mail gatewayed to news (mail-news 1.5a) The Makefiles in ./dom and ./chn in the UK Sendmail-1.5 distribution fall over in certain circumstances under make on Ultrix. Rules of the form: -@if [ some test ]; then statement; fi emit error code 1 (which is ignored by make) if sometest is false. Without the "-", the error causes make to fail. The second test in the Makefiles (for host.{chn,dom} being non-empty) didn't have the "-" and so stopped the make. A solution is to put a "-" at the front of the command: -@if [ ! -s $@ ] ; \ Another improvement is to put a dummy "else" part into these if commands. This stops the "Error code 1 (ignored)" message if `some test' is false. I don't know if this applies to version of UN*X other than Ultrix. I've met this problem before when building software written for UNIX System V on Ultrix. Two replacement Makefiles follow: --------- ./dom/Makefile ---- cut here ######################################################################### # UK-1.5(glasgow) Sendmail Configuration Package # # Author: Jem Taylor # # File: ./dom/Makefile # # Role: generate dom/$site.dom from dom/$site.tab/*.dom files # ######################################################################### .SUFFIXES: .dom .tab .PRECIOUS: *.dom .tab.dom: $<.tab/*.dom Makefile -@if [ -s $@ ]; then rm -f $@.BCK && mv $@ $@.BCK; else :; fi ./MAKE $* $ /dev/null 2>&1 ;\ then rm -f $@.BCK ; \ echo "$@ not changed since last made." ; \ else echo "Saving old ../dom/$@ as ../dom/$@.OLD ..." ; \ rm -f $@.OLD && mv $@.BCK $@.OLD ; fi --------- ---- cut here --------- ./chn/Makefile ---- cut here #!/bin/make -f ######################################################################### # UK-1.5(glasgow) Sendmail Configuration Package # # Author: Jem Taylor # # File: ./chn/Makefile # # Role: generate chn/$host.chn from chn/$host.tab/*.chn files # ######################################################################### .SUFFIXES: .chn .tab .PRECIOUS: *.chn .tab.chn: $ /dev/null 2>&1 ;\ then rm -f $@.BCK ; \ echo "$@ not changed since last made." ; \ else echo "Saving old ../chn/$@ as ../chn/$@.OLD ..." ; \ rm -f $@.OLD && mv $@.BCK $@.OLD ; fi --------- ---- cut here -- -- Robert Evans, Dept of Computing Maths, University College Cardiff, PO Box 916, Cardiff, Wales, UK, CF2 4YN. Tel: +44 (0)222 874000 x 5518 E-mail: R.Evans@computing-maths.cardiff.ac.uk UUCP: R.Evans@cf-cm.UUCP