How to compile Slash’EM on Mac OS X (tty version)

These instructions are for the source tarball from the stable Slash’EM Page (0.0.7E7F3 at the time of this writing). I assume that you have unpacked it and moved your bash to the top of the extracted filesystem.

pushd sys/unix/ ; sh

You have to uncomment the BSD #define in line #22 of include/unixconf.h, then change line #963 of win/tty/termcap.c (this is a single line):

#if !defined(LINUX) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__MACH__)

Next comment out line #340 of the generated src/Makefile, and uncomment the line above (WINTTYLIB = -lncurses). Also make sure you set PREFIX, GAMEUID and GAMEGRP from Makefile to sensible values (example):

PREFIX = /Users/dirk/install
GAME = slashem
# GAME = slashem.prg
GAMEUID = dirk
GAMEGRP = staff

As suggested by Patric, instead of modifying GAMEUID and GAMEGRP, you can also edit the two lines that set CHOWN and CHGRP, and simply set them to true:

CHOWN = true
CHGRP = true

Then all there is left to do is to compile and install:

make install

If everything went fine, you will have your slashem binary in ~/install/games/local/bin. To start it cd there and invoke it in your bash: ./slashem.

To customize, I added the following line to .bash_profile:

export SLASHEMOPTIONS="@.slashem.rc"

And the file ~/.slashem.rc with the following contents:


Your config will probably vary.

Have fun playing!

6 thoughts on “How to compile Slash’EM on Mac OS X (tty version)

  1. Patric Mueller

    If you set CHOWN,CHGRP,CHMOD to true, the game gets automatically installed as the current user.

    I would be interested how to package this compiled version in a mac-like way.

  2. Dirk

    Oh yes, will change that (never saw that comment in the Makefile).

    As for packaging I think you have to patch it so it doesn’t rely on NETHACKDIR anymore, and probably mess with the dlb stuff, and also do some tricks with AppleScript to start it in a terminal.

  3. Anonymous

    Okay so I am familiar with computers but not at all with coding in terminal or any other program. I really enjoy NetHack and Slash’Em seems like it would enhance that but I can only run OSX so I have to do these adjustments(I’m guessing) to the files within the zipped out file but I really have no idea where to start. I know a bash file is the first item in terminal or something but apart from that I am clueless. I think that once I got started with it I could make the nescesary changes but the problem is I don’t know where to start.

    Please help 🙂

  4. Dirk

    What exactly do you want to achieve?

    If you just want to play Slash’EM I have a dist ready for download: (just unzip and double click the executable).

    There is also a native Mac OS X port of NetHack in the making based on my iHack code base (will soon blog about it). This will behave like any other app.

    If you need/want to compile Slash’EM yourself let me know and I can give you some more pointers.

  5. Anonymous

    Sweet thanks Dirk, so the slash’em you have posted will only run in terminal and not like regular nethack? What I mean by this is that it won’t load in graphical form but only in ASCI?

  6. Dirk

    Yes it’s ASCII terminal only, as are the instructions on this page. For gfx on Mac you need to build for X or Qt.


Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see