summaryrefslogtreecommitdiffstats
path: root/larn
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-02-17 14:05:02 -0500
committerCameron Katri <me@cameronkatri.com>2021-02-22 09:20:17 -0500
commit08eca96e71d96ad1f8e9b888875ab5570f208d19 (patch)
tree9cace520fa50d9ef5bb77c2d7ebdde40e6b40f7f /larn
parent3f650c87c6ee6692ad6a558bb03ccf3364fe794a (diff)
downloadbsdgames-darwin-08eca96e71d96ad1f8e9b888875ab5570f208d19.tar.gz
bsdgames-darwin-08eca96e71d96ad1f8e9b888875ab5570f208d19.tar.zst
bsdgames-darwin-08eca96e71d96ad1f8e9b888875ab5570f208d19.zip
Get all the games compiling for iOS
Diffstat (limited to 'larn')
-rw-r--r--larn/Makefile31
-rw-r--r--larn/diag.c1
-rw-r--r--larn/main.c2
-rw-r--r--larn/scores.c2
4 files changed, 21 insertions, 15 deletions
diff --git a/larn/Makefile b/larn/Makefile
index cca697bb..643e1913 100644
--- a/larn/Makefile
+++ b/larn/Makefile
@@ -55,26 +55,27 @@
# NOLOG
# Turn off logging.
-.include <bsd.own.mk>
-
PROG= larn
MAN= larn.6
-CPPFLAGS+=-DBSD -DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE -DTERMIOS
+CPPFLAGS+=-DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE -DTERMIOS
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 action.c moreobj.c movem.c regen.c fortune.c savelev.c
-DPADD= ${LIBTERMINFO}
-LDADD= -lterminfo
-HIDEGAME=hidegame
-SETGIDGAME=yes
+FILES= datfiles/larn.help datfiles/larnmaze datfiles/larnopts
+
+all: $(PROG)
+
+$(PROG): $(SRCS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw
+ $(STRIP) $(PROG)
-.if ${MKSHARE} != "no"
-DAT=larnmaze larnopts larn.help
-FILES=${DAT:S@^@${.CURDIR}/datfiles/@g}
-FILESDIR=/usr/share/games/larn
-.endif
+install: $(PROG) $(MAN)
+ $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG)
+ $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN)
+ $(GINSTALL) -d $(DESTDIR)/usr/share/games/larn
+ $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/usr/share/games/larn/
-COPTS.display.c += -Wno-format-nonliteral
-COPTS.monster.c += -Wno-format-nonliteral
+clean:
+ rm -f $(CLEANFILES) $(PROG)
-.include <bsd.prog.mk>
+.PHONY: all clean install
diff --git a/larn/diag.c b/larn/diag.c
index a3482c1d..0f00a6f1 100644
--- a/larn/diag.c
+++ b/larn/diag.c
@@ -20,6 +20,7 @@ static void fsorry(void);
static void fcheat(void);
static struct tms cputime;
+time_t time(time_t *t);
/*
***************************
diff --git a/larn/main.c b/larn/main.c
index 7b619f87..977c17d9 100644
--- a/larn/main.c
+++ b/larn/main.c
@@ -37,6 +37,8 @@ static void eatcookie(void);
static void quaff(void);
static int whatitem(const char *);
+#define __unreachable() __builtin_unreachable()
+
static char copyright[] = "\nLarn is copyrighted 1986 by Noah Morgan.\n";
int srcount = 0; /* line counter for showstr() */
int dropflag = 0; /* if 1 then don't lookforobject() next round */
diff --git a/larn/scores.c b/larn/scores.c
index 49a6f873..26ee7c42 100644
--- a/larn/scores.c
+++ b/larn/scores.c
@@ -38,6 +38,8 @@ __RCSID("$NetBSD: scores.c,v 1.21 2012/06/19 05:30:44 dholland Exp $");
#include "header.h"
#include "extern.h"
+#include <time.h>
+
struct scofmt { /* This is the structure for the scoreboard */
long score; /* the score of the player */
long suid; /* the user id number of the player */