games: Make benefits for the glorious curses lib.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 29 Nov 2017 15:58:14 +0000 (17:58 +0200)
committerzrj <zrj@dragonflybsd.org>
Wed, 29 Nov 2017 16:20:30 +0000 (18:20 +0200)
Consolidate all private ncurses handling in top level Makefile.inc in games/.
Will simplify upcoming base ncurses library update.

While there, perfom the same for private crypto lib even if it a single case.

26 files changed:
games/Makefile.inc
games/atc/Makefile
games/backgammon/backgammon/Makefile
games/backgammon/teachgammon/Makefile
games/battlestar/Makefile
games/boggle/boggle/Makefile
games/bs/Makefile
games/canfield/canfield/Makefile
games/colorbars/Makefile
games/cribbage/Makefile
games/factor/Makefile
games/grdc/Makefile
games/hack/Makefile
games/hangman/Makefile
games/hunt/hunt/Makefile
games/larn/Makefile
games/mille/Makefile
games/phantasia/Makefile
games/rain/Makefile
games/robots/Makefile
games/rogue/Makefile
games/sail/Makefile
games/snake/snake/Makefile
games/tetris/Makefile
games/worm/Makefile
games/worms/Makefile

index 54bca3c..29f259e 100644 (file)
@@ -10,3 +10,19 @@ WARNS?=              6
 BINGRP=                games
 BINMODE=       550
 .endif
+
+# Handle libcrypto dependency
+.if defined(GAMESCRYPTO)
+LDADD+=                -lprivate_crypto
+DPADD+=                ${LIBRECRYPTO}
+CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv
+LDFLAGS+=       ${PRIVATELIB_LDFLAGS}
+.endif
+
+# Handle libncurses dependency
+.if defined(GAMESCURSES)
+DPADD+=                ${LIBNCURSES}
+LDADD+=                -lprivate_ncurses
+CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
+LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+.endif
index ff983a3..29f2136 100644 (file)
@@ -6,18 +6,17 @@ CFLAGS+=-I${.CURDIR} -I.
 SRCS=  extern.c grammar.y graphics.c input.c lex.l list.c log.c \
        main.c tunable.c update.c y.tab.h
 MAN=   atc.6
-DPADD= ${LIBL} ${LIBM} ${LIBNCURSES}
-LDADD= -ll -lm -lprivate_ncurses
+VARGAMES=
+GAMESCURSES=
+
+DPADD= ${LIBL} ${LIBM}
+LDADD= -ll -lm
 
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 .if !defined(NO_SHARE)
 FILES=         Game_List Killer crossover default easy game_2
 FILESDIR=      ${SHAREDIR}/games/atc
 .endif
 
-VARGAMES=      yes
-
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/atc_score)
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
index 84b3827..4b25c20 100644 (file)
@@ -6,11 +6,7 @@ CFLAGS+=-I${.CURDIR}/../common_source
 SRCS=  allow.c board.c check.c extra.c fancy.c init.c main.c move.c \
        odds.c one.c save.c subs.c table.c text.c version.c
 MAN=   backgammon.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .PATH: ${.CURDIR}/../common_source
 
index 7e9d256..06582d1 100644 (file)
@@ -5,11 +5,7 @@ NOMAN= noman
 CFLAGS+=-DTEACHGAMMON_TEXT -I${.CURDIR}/../common_source
 SRCS=  allow.c board.c check.c data.c fancy.c init.c odds.c one.c save.c \
        subs.c table.c teach.c ttext1.c ttext2.c tutor.c
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .PATH: ${.CURDIR}/../common_source
 
index 8f38c00..b54c071 100644 (file)
@@ -7,13 +7,8 @@ SRCS=  battlestar.c command1.c command2.c command3.c command4.c \
        init.c cypher.c getcom.c parse.c room.c save.c fly.c misc.c \
        globals.c dayfile.c nightfile.c dayobjs.c nightobjs.c words.c
 MAN=   battlestar.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-VARGAMES=      yes
+VARGAMES=
+GAMESCURSES=
 
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/battlestar.log)
index a5903c5..ba43540 100644 (file)
@@ -5,11 +5,6 @@
 PROG=  boggle
 SRCS=  bog.c help.c mach.c prtable.c timer.c word.c
 MAN=   boggle.6
-
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index 27e4f02..d16a74b 100644 (file)
@@ -2,10 +2,6 @@
 
 PROG=  bs
 MAN=   bs.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index dd090bd..f1cb8b8 100644 (file)
@@ -4,13 +4,8 @@
 PROG=  canfield
 MAN=   canfield.6
 MLINKS=        canfield.6 cfscores.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-VARGAMES=      yes
+VARGAMES=
+GAMESCURSES=
 
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/cfscores)
index 5204fe9..348856c 100644 (file)
@@ -2,10 +2,6 @@
 
 PROG=  colorbars
 MAN=   colorbars.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index 30fb5bd..9bcdff1 100644 (file)
@@ -2,20 +2,15 @@
 # $FreeBSD: src/games/cribbage/Makefile,v 1.7.2.5 2002/08/07 16:31:41 ru Exp $
 
 PROG=  cribbage
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
 SRCS=  extern.c crib.c cards.c instr.c io.c score.c support.c
+MAN=   cribbage.6
+VARGAMES=
+GAMESCURSES=
+
 .if !defined(NO_SHARE)
 FILES= cribbage.n
 FILESNAME_cribbage.n=  cribbage.instr
 .endif
-MAN=   cribbage.6
-
-VARGAMES=      yes
 
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/criblog)
index b72bc38..4c67598 100644 (file)
@@ -3,15 +3,13 @@
 
 PROG=  factor
 SRCS=  factor.c pr_tbl.c
-CFLAGS+=-I${.CURDIR}/../primes
-
-CFLAGS+=       -DHAVE_OPENSSL -I${.CURDIR}/../../crypto/libressl/include
-LDADD=         -lprivate_crypto
-DPADD=         ${LIBRECRYPTO}
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
 MAN=   factor.6
 MLINKS+=factor.6 primes.6
+GAMESCRYPTO=
+
+CFLAGS=        -I${.CURDIR}/../primes
+CFLAGS+=       -DHAVE_OPENSSL
+
 .PATH: ${.CURDIR}/../primes
 
 .include <bsd.prog.mk>
index 1593f2a..9b0f8b3 100644 (file)
@@ -2,10 +2,6 @@
 
 PROG=  grdc
 MAN=   grdc.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index 6081293..162555c 100644 (file)
@@ -15,21 +15,17 @@ SRCS=       alloc.c hack.Decl.c hack.apply.c hack.bones.c hack.c hack.cmd.c \
        hack.wizard.c hack.worm.c hack.worn.c hack.zap.c rnd.c \
        hack.onames.h
 MAN=   hack.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
+VARGAMES=
+GAMESCURSES=
 
-CFLAGS+=       -I${.CURDIR} -I.
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+NO_STRICT_ALIASING=
+CFLAGS=        -I${.CURDIR} -I.
 
 FILES=         rumors help hh data
 FILESMODE_rumors=      440
 FILESGRP=      ${BINGRP}
 FILESDIR=      /var/games/hackdir
 CLEANFILES=    hack.onames.h makedefs.nx makedefs.no
-NO_STRICT_ALIASING=
-
-VARGAMES=      yes
 
 build-tools: makedefs.nx
 
index a27ea45..7529a04 100644 (file)
@@ -4,10 +4,6 @@ PROG=  hangman
 SRCS=  endgame.c extern.c getguess.c getsym.c getword.c main.c playgame.c \
        prdata.c prman.c prword.c setup.c
 MAN=   hangman.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index 8d7a23e..03ca715 100644 (file)
@@ -4,13 +4,9 @@
 PROG=  hunt
 SRCS=  connect.c hunt.c otto.c playit.c display.c list.c
 MAN=   hunt.6
-LDADD= -lprivate_ncurses
-DPADD= ${LIBNCURSES}
+GAMESCURSES=
 
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-CFLAGS+=-I${.CURDIR}/../huntd
+CFLAGS=        -I${.CURDIR}/../huntd
 
 .include "../../Makefile.inc"
 .include <bsd.prog.mk>
index 373163a..0b01130 100644 (file)
 
 PROG=  larn
 MAN=   larn.6
-CFLAGS+=-DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE
 SRCS=  main.c object.c create.c tok.c display.c global.c data.c io.c \
        monster.c store.c diag.c help.c config.c nap.c bill.c scores.c \
        signal.c moreobj.c movem.c regen.c fortune.c savelev.c
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
+VARGAMES=
+GAMESCURSES=
 
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+CFLAGS=        -DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE
 
 .if !defined(NO_SHARE)
 FILES=         larnmaze larnopts larn.help
 FILESDIR=      ${SHAREDIR}/games/larn
 .endif
 
-VARGAMES=      yes
-
 .PATH: ${.CURDIR}/datfiles
 
 beforeinstall:
index 62182f1..8af0c65 100644 (file)
@@ -5,10 +5,6 @@ PROG=  mille
 MAN=   mille.6
 SRCS=  comp.c end.c extern.c init.c mille.c misc.c move.c print.c \
        roll.c save.c types.c varpush.c
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index 19029d0..1f23ed3 100644 (file)
@@ -4,15 +4,13 @@
 PROG=  phantasia
 MAN=   phantasia.6
 SRCS=  main.c fight.c io.c interplayer.c gamesupport.c misc.c phantglobs.c
-DPADD= ${LIBM} ${LIBNCURSES}
-LDADD= -lm -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+DPADD= ${LIBM}
+LDADD= -lm
+VARGAMES=
+GAMESCURSES=
 
 NXLDLIBS=      -lm
 
-VARGAMES=      yes
 DATAFILES=     characs gold lastdead mess monsters motd scoreboard void
 CLEANFILES=    ${DATAFILES} cross-phantglobs.no map setup.nx setup.no \
                stamp.setuprun
index 00e5e33..e0b5b29 100644 (file)
@@ -3,10 +3,6 @@
 
 PROG=  rain
 MAN=   rain.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index bf0ad96..a6bd025 100644 (file)
@@ -6,13 +6,8 @@ CFLAGS+=-DMAX_PER_UID=5
 SRCS=  extern.c init_field.c main.c make_level.c move.c move_robs.c \
        play_level.c query.c rnd_pos.c score.c flush_in.c
 MAN=   robots.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-VARGAMES=      yes
+VARGAMES=
+GAMESCURSES=
 
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/robots_roll)
index 1c3d1d3..1439189 100644 (file)
@@ -6,14 +6,10 @@ MAN=  rogue.6
 SRCS=  hit.c init.c inventory.c level.c machdep.c main.c \
        message.c monster.c move.c object.c pack.c play.c random.c ring.c \
        room.c save.c score.c spec_hit.c throw.c trap.c use.c zap.c
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
+VARGAMES=
+GAMESCURSES=
 
-CFLAGS+=       -DUNIX
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-VARGAMES=      yes
+CFLAGS=        -DUNIX
 
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/rogue.scores)
index ee640a7..bd22669 100644 (file)
@@ -6,13 +6,8 @@ SRCS=  main.c pl_main.c pl_1.c pl_2.c pl_3.c pl_4.c pl_5.c pl_6.c pl_7.c \
        dr_main.c dr_1.c dr_2.c dr_3.c dr_4.c dr_5.c lo_main.c \
        assorted.c game.c globals.c misc.c parties.c sync.c version.c
 MAN=   sail.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-VARGAMES=      yes
+VARGAMES=
+GAMESCURSES=
 
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/saillog)
index f568f1b..4b33f75 100644 (file)
@@ -5,13 +5,10 @@ PROG= snake
 SRCS=  snake.c
 MAN=   snake.6
 MLINKS=        snake.6 snscore.6
-DPADD= ${LIBM} ${LIBNCURSES}
-LDADD= -lm -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
-
-VARGAMES=      yes
+DPADD= ${LIBM}
+LDADD= -lm
+VARGAMES=
+GAMESCURSES=
 
 beforeinstall:
 .if !exists(${DESTDIR}/var/games/snakerawscores)
index 6a81221..ba41c84 100644 (file)
@@ -3,10 +3,6 @@
 PROG=  tetris
 SRCS=  input.c screen.c shapes.c scores.c tetris.c
 MAN=   tetris.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index 4a95d7a..58a309f 100644 (file)
@@ -3,10 +3,6 @@
 
 PROG=  worm
 MAN=   worm.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>
index 3efbaec..c8c2047 100644 (file)
@@ -3,10 +3,6 @@
 
 PROG=  worms
 MAN=   worms.6
-DPADD= ${LIBNCURSES}
-LDADD= -lprivate_ncurses
-
-CFLAGS+=       -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
-LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
+GAMESCURSES=
 
 .include <bsd.prog.mk>