]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - fortune/datfiles/Makefile
Fix simple typo. From bdc@world.std.com in PR misc/12150.
[bsdgames-darwin.git] / fortune / datfiles / Makefile
index c935ee1f4e36976d6d1d0271a7531f0b00bdf1cd..dae9b48409af41b31a4f54d70dbee6134a46fce9 100644 (file)
@@ -1,38 +1,75 @@
-#      from: @(#)Makefile      5.2 (Berkeley) 5/6/91
-#      $Id: Makefile,v 1.9 1994/01/24 18:46:59 cgd Exp $
+#      $NetBSD: Makefile,v 1.30 2000/12/30 17:51:26 sommerfeld Exp $
+#      @(#)Makefile    8.2 (Berkeley) 4/19/94
 
-#
-# set `OBSCENE' to "real" to have obscene fortunes installed,
-# fake to have a note stating that they're not installed
-# isntalled in their place
-#
-OBSCENE=real
+.include <bsd.own.mk>                  # for INSTALL_OFFENSIVE_FORTUNES
 
-NORMDAT= fortunes.dat startrek.dat zippy.dat
-OBSDAT=        fortunes-o.dat
-DATFILES= ${NORMDAT} ${OBSDAT}
+SRCFILES=      fortunes fortunes2 startrek zippy unamerican-o limerick \
+               netbsd
+DATFILES=      fortunes.dat fortunes2.dat startrek.dat zippy.dat \
+               fortunes-o fortunes-o.dat fortunes2-o fortunes2-o.dat \
+               limerick.dat limerick-o limerick-o.dat unamerican-o \
+               unamerican-o.dat netbsd.dat netbsd-o netbsd-o.dat
 
-CLEANFILES+=${DATFILES}
+# TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, RUN 'make' with
+# "INSTALL_OFFENSIVE_FORTUNES=NO", or set "INSTALL_OFFENSIVE_FORTUNES=NO"
+# IN bsd.own.mk OR /etc/mk.conf.
 
-STRFILE!=cd $(.CURDIR)/../strfile; \
-       printf "xxx:\n\techo \$${.OBJDIR}/strfile\n" | ${MAKE} -r -s -f - xxx
+INSTALL_OFFENSIVE_FORTUNES?=   YES
+.if (${INSTALL_OFFENSIVE_FORTUNES} == "YES")
+TYPE=          real
+.else
+TYPE=          fake
+.endif
 
-all: ${DATFILES}
+CLEANFILES+=${DATFILES} limerick-o
 
-install:
-       @install -d -o root -g wheel -m 755 ${DESTDIR}/usr/share/games/fortune
-       install ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${DATFILES} \
-           ${DESTDIR}/usr/share/games/fortune
-       (cd ${.CURDIR} && install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
-               ${NORMDAT:R} ${DESTDIR}/usr/share/games/fortune)
-       (cd ${.CURDIR} && install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
-               ${OBSDAT:R}.${OBSCENE}.rot13 \
-               ${DESTDIR}/usr/share/games/fortune/${OBSDAT:R})
+STRFILEDIR!=cd $(.CURDIR)/../strfile; ${PRINTOBJDIR}
+STRFILE=${STRFILEDIR}/strfile
 
-fortunes-o.dat: ${.TARGET:R}.${OBSCENE}.rot13
-       ${STRFILE} -rsx ${.CURDIR}/${.TARGET:R}.${OBSCENE}.rot13 ${.TARGET}
+.if ${MKSHARE} != "no"
+FILES=${SRCFILES} ${DATFILES}
+FILESDIR=/usr/share/games/fortune
+.endif
 
-fortunes.dat startrek.dat zippy.dat: ${.TARGET:R}
+realall: ${DATFILES}
+
+# Normal fortunes: build directly from data files.
+
+fortunes.dat fortunes2.dat startrek.dat zippy.dat limerick.dat netbsd.dat:
        ${STRFILE} -rs ${.CURDIR}/${.TARGET:R} ${.TARGET}
+fortunes.dat:  fortunes
+fortunes2.dat: fortunes2
+startrek.dat:  startrek
+zippy.dat:     zippy
+limerick.dat:  limerick
+netbsd.dat:    netbsd
+
+# Obscene fortunes: we have to build source and data files
+
+fortunes-o: fortunes-o.${TYPE}
+       tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET}
+fortunes-o.dat: fortunes-o
+       ${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
+
+fortunes2-o: fortunes2-o.${TYPE}
+       tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET}
+fortunes2-o.dat: fortunes2-o
+       ${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
+
+limerick-o: limerick-o.${TYPE}
+       tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET}
+limerick-o.dat: limerick-o
+       ${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
+
+unamerican-o: unamerican-o.${TYPE}
+       tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET}
+unamerican-o.dat: unamerican-o
+       ${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
+
+netbsd-o: netbsd-o.${TYPE}
+       tr [a-zA-Z] [n-za-mN-ZA-M] < ${.ALLSRC} > ${.TARGET}
+netbsd-o.dat: netbsd-o
+       ${STRFILE} -rsx ${.ALLSRC} ${.TARGET}
+
 
 .include <bsd.prog.mk>