Another Ben NanoNote port: pMARS

Ben Nanonote
Screenshot compositing, made with free software

Since I bought the Nanonote, I have been finding new uses for it. Music player, note taker, voice recorder. I can also use it to start learning Python again, or Perl, which are (together with Lua) the languages currently installed by default.

After my first successful port (gnugo), I decided to try something else, and while idling at the train I thought that pMARS, the portable Memory Array Redcode Simulator was probably a good bet. If you don't know what I am talking about, you can check here. I had just started writing some test warriors, to see if I understood the code, but had too little time to test it working.

And as I thought, pMARS was not as hard as other programs have turned to., but without graphical output, just text based. Enough. What changes are needed?

Follow the steps in my previous tutorial, the changes needed fit in there.

The corresponding openwrt Makefile for pMARS should be
# Copyright (C) 2008 OpenWrt.org
# This is free software, licensed under the GNU General Public License v2.

include $(TOPDIR)/rules.mk
## Package name
## Package version we need (to match our download source)
## Release version (don't really needed, just for completeness)
## Name of the file we will download, with the previous package name definitions
## Url with the PKG_SOURCE file
## Program to uncompress the sources

include $(INCLUDE_DIR)/package.mk
# Definition of the package, for adding to menuconfig and creating the ipkg.
define Package/pmars
# Directory where the sources will be uncompiled and built BUILD_DIR
# is an env variable from the OpenWrt toolchain, you don't need to set
# it.
# Long description of the package
define Package/pmars/description
# If ./configure does not need any options, leave it as follows

define Build/Prepare
$(call Build/Prepare/Default)

define Package/pmars/Build/Configure
$(call Build/Configure/Default)

define Package/pmars/Build/Compile
$(call Build/Compile/Default)

# Where will be copied the binaries and libraries after installation.
define Package/pmars/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/pmars $(1)/usr/sbin/
# Final step for bulding the package
$(eval $(call BuildPackage,pmars))
And for it to work, you need to make some static patches to the Makefile in the src directory of the pmars package. Change the compiler for
CC = mipsel-openwrt-linux-uclibc-gcc
and the compiler and linker flags for
And remove (or comment) this line:
@strip $(MAINFILE)
I hope you enjoy your Linux portable freedom, and write nice warriors to compete in The Hill. I will look into making a graphical version, although it looks quite hard in such a small window. If you have any question, don't hesitate to post a comment or send me an e-mail.

Related posts:
Nanonote ports: Yacas, 4th (forth compiler and interpreter)
My first port to the Ben NanoNote: gnugo
Unpacking my Ben NanoNote
Gcal: the ultra-powerful command line GNU calendar
Written by Ruben Berenguel