diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-02-17 14:05:02 -0500 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-02-22 09:20:17 -0500 |
commit | 08eca96e71d96ad1f8e9b888875ab5570f208d19 (patch) | |
tree | 9cace520fa50d9ef5bb77c2d7ebdde40e6b40f7f /adventure | |
parent | 3f650c87c6ee6692ad6a558bb03ccf3364fe794a (diff) | |
download | bsdgames-darwin-08eca96e71d96ad1f8e9b888875ab5570f208d19.tar.gz bsdgames-darwin-08eca96e71d96ad1f8e9b888875ab5570f208d19.tar.zst bsdgames-darwin-08eca96e71d96ad1f8e9b888875ab5570f208d19.zip |
Get all the games compiling for iOS
Diffstat (limited to 'adventure')
-rw-r--r-- | adventure/.gitignore | 3 | ||||
-rw-r--r-- | adventure/Makefile | 27 | ||||
-rw-r--r-- | adventure/crc.c | 2 | ||||
-rw-r--r-- | adventure/init.c | 2 | ||||
-rw-r--r-- | adventure/save.c | 2 |
5 files changed, 26 insertions, 10 deletions
diff --git a/adventure/.gitignore b/adventure/.gitignore new file mode 100644 index 00000000..b3be1847 --- /dev/null +++ b/adventure/.gitignore @@ -0,0 +1,3 @@ +mkdata +data.c +adventure diff --git a/adventure/Makefile b/adventure/Makefile index 8f3467e0..83bc8dd7 100644 --- a/adventure/Makefile +++ b/adventure/Makefile @@ -4,16 +4,25 @@ PROG= adventure SRCS= main.c init.c done.c save.c subr.c vocab.c wizard.c io.c data.c crc.c MAN= adventure.6 -HIDEGAME=hidegame -CLEANFILES+=mkdata setup.lo data.c +CLEANFILES+=mkdata data.c + +all: $(PROG) + +$(PROG): $(SRCS) + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) + $(STRIP) $(PROG) data.c: glorkz mkdata - ${_MKTARGET_CREATE} - ./mkdata ${.CURDIR}/glorkz > data.c + ./mkdata glorkz > data.c + +mkdata: setup.c + clang -o mkdata setup.c + +install: $(PROG) $(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) -setup.lo: hdr.h -mkdata: setup.lo - ${_MKTARGET_LINK} - ${HOST_LINK.c} -o ${.TARGET} ${.ALLSRC} +clean: + rm -f $(CLEANFILES) $(PROG) -.include <bsd.prog.mk> +.PHONY: all clean install diff --git a/adventure/crc.c b/adventure/crc.c index dafd7626..7538b0d0 100644 --- a/adventure/crc.c +++ b/adventure/crc.c @@ -44,6 +44,8 @@ __RCSID("$NetBSD: crc.c,v 1.13 2012/01/08 18:16:00 dholland Exp $"); #include "extern.h" +#define __arraycount(a) (sizeof(a) / sizeof(*(a))) + static const uint32_t crctab[256] = { 0x7fffffff, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, diff --git a/adventure/init.c b/adventure/init.c index c39b34f4..d4b028e1 100644 --- a/adventure/init.c +++ b/adventure/init.c @@ -137,7 +137,7 @@ init(void) poof(); } -__noinline char * +char * decr(int a, int b, int c, int d, int e) { static char buf[6]; diff --git a/adventure/save.c b/adventure/save.c index 1aa2ee3b..c4054b46 100644 --- a/adventure/save.c +++ b/adventure/save.c @@ -54,6 +54,8 @@ __RCSID("$NetBSD: save.c,v 1.14 2014/03/22 22:04:40 dholland Exp $"); #include "hdr.h" #include "extern.h" +#define __arraycount(a) (sizeof(a) / sizeof(*(a))) + struct savefile { FILE *f; const char *name; |