Skip site navigation (1)Skip section navigation (2)
Date:      18 Aug 1997 09:22:37 GMT
From:      nnd@itfs.nsk.su
To:        bugs@freebsd.org
Subject:   Re: bin/4314: games/boggle Makefile correction
Message-ID:  <5t948t$s97@news.itfs.nsk.su>
References:  <199708171410.HAA29629@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans <bde@zeta.org.au> wrote:
>  >	Makefile for src/games/boggle incorrectly lists
>  >data files ('dictionary' and 'dictindex') as a source for
>  >'all' target, whereas they obviously are the sources for
>  >'beforeinstall' target already used in this Makefile.
>  
>  No, 'dictionary' and 'dictindex' are certainly sources for
>  the 'all' target, and 'install' targets including 'beforeinstall'
>  should never have sources, since sources for them (and not for
>  'all') would result in things being built at install time.

	Then we must have 'afterall' target in *.*.mk files ;-)

>  You shouldn't expect 'make obj clean cleandepend depend' to work in general.
>  If the obj directory doesn't already exist, then ${.OBJDIR} is "." the
>  first time this is run, and .depend is created in ".".

	Yes, you are right - I only mean that 'make -j12 all' was
done AFTER all of "obj clean cleandepend depend" targets.

>  'make -j12' fails because ${MKDICT} is not a source for 'dictionary'.
>  '::' doesn't work right here (it is used just to keep ${MKDIR} out of
>  ${.ALLSRC} .  This use is completely wrong - '::' is good for accumulating
>  actions but bad for accumulating sources).
>  
>  >>Fix:
>
>  Not a fix.

	Here is another patch (relative to previous one
already committed by jkh). After it:

1) All work is done at 'make all' stage and not at 'make install';
2) All standard targets (obj clean cleandepend depend all install cleandir)
works with/without '-j12' flag (one at a time - their combinations
have little sense with '-j12');
3) 'cleandepend' target works (with unpatched Makefile it only
produced 'rm -f .depend' at top level).

	N.Dudorov

--- src/games/boggle/Makefile	Mon Aug 18 15:28:47 1997
+++ src/games/boggle-patched/Makefile	Mon Aug 18 16:20:56 1997
@@ -3,6 +3,8 @@
 FILES=	dictionary dictindex
 CLEANFILES+=	${FILES}
 
+DICTSOURCE= ${.CURDIR}/../../share/dict/web2
+
 .if exists(${.OBJDIR}/mkdict)
 MKDICT=	${.OBJDIR}/mkdict/mkdict
 .else
@@ -14,6 +16,7 @@
 MKINDX=	${.CURDIR}/mkindex/mkindex
 .endif
 
+all: ${FILES}
 
 ${MKDICT}:
 	cd ${.CURDIR}/mkdict; ${MAKE}
@@ -21,18 +24,20 @@
 ${MKINDX}:
 	cd ${.CURDIR}/mkindex; ${MAKE}
 
-dictionary:: ${MKDICT}
-dictionary:: ${.CURDIR}/../../share/dict/web2
-	${MKDICT} < ${.ALLSRC} > ${.TARGET}
-
-dictindex:: ${MKINDX}
-dictindex:: dictionary
-	${MKINDX} < ${.ALLSRC} > ${.TARGET}
+dictionary: ${MKDICT} ${DICTSOURCE}
+	${MKDICT} < ${DICTSOURCE} > ${.TARGET}
+
+dictindex: ${MKINDX} dictionary
+	${MKINDX} < dictionary > ${.TARGET}
 
-beforeinstall: ${FILES}
+beforeinstall:
 	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
 	    ${FILES} ${DESTDIR}${SHAREDIR}/games/boggle/
 
 SUBDIR=	boggle mkdict mkindex
 
+.if make(depend) || make(cleandepend)
+.include <bsd.subdir.mk>
+.else
 .include <bsd.prog.mk>
+.endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5t948t$s97>