Back


Compiling and bulding Palm-OS-Applications on Ubuntu 18.04 LTS (64 Bit)

13.06.2019

In order to be able to compile and build Palm-OS-Applictions on Linux you will need these .deb-Files:

pilrc_3.2-3build1_i386.deb from
http://old-releases.ubuntu.com/ubuntu/pool/universe/p/pilrc/

And also a Palm-OS-SDK from:

https://github.com/jichu4n/palm-os-sdk

(I used sdk-4.)

If the files above are not available you can also download them here:

The installation of the downloaded .deb-files should work without any problems. You also need to install "make:

sudo apt install make

You can copy the content of the SDK to any path on your machine or in the common path under "/opt/palmdev/sdk", so it should look like this:

/opt/palmdev/sdk/include/
/opt/palmdev/sdk/lib/

Next "package" you need is the "prc-tools-remix" from stevelittle:

https://github.com/stevelittle/prc-tools-remix

The original prc-tools-remix comes from jichu4n, but it is not working with Ubunut 18.04 at the moment, because the new version of the tool "bison" on Ubunut 18.04 is more strict in some cases:

https://github.com/jichu4n/prc-tools-remix

You also need to install some tools via apt-get:

	sudo apt-get install build-essential git make libncurses5-dev libncursesw5-dev

Check the repository from stevelittle out and install them like in the readme.md mentioned:

sudo apt-get install \
    texinfo \
    flex \
    bison \
    gperf

git clone https://github.com/jichu4n/prc-tools-remix.git
cd prc-tools-remix

mkdir build && cd build
../prc-tools-2.3/configure \
    --enable-targets=m68k-palmos,arm-palmos \
    --enable-languages=c,c++ \
    --disable-nls \
    --with-palmdev-prefix=/opt/palmdev \
    --host=i686-linux-gnu
# Use "env SHELL=/bin/sh make" if using a non-POSIX shell like fish:
env SHELL=/bin/sh 
make
sudo make install MAKEINFO=true

Note: I changed some lines from the original like the last line to "sudo make install MAKEINFO=true" in order to skip the makeinfo-doc, which caused some errors.

In order to make thinks a little bit easier, just use this Makefile:

# Makefile

FILENAME = HelloWorld

# PalmOS values
# SDK 3.1 and 4.0 have different sets of include files,
# so we use #define to specify:

SDK_VERSION = 4
PALMCC = m68k-palmos-gcc
PALMINC = /opt/palmdev/sdk/include
PALMCFLAGS = -O2 -g -DPALMOS -DSDK_$(SDK_VERSION)=1 \
	-I$(PALMINC) \
	-I$(PALMINC)/Dynamic \
	-I$(PALMINC)/Core \
	-I$(PALMINC)/Core/UI \
	-I$(PALMINC)/Core/Hardware \
	-I$(PALMINC)/Core/System \
	-I$(PALMINC)/Core/System/Unix \
	-I$(PALMINC)/Libraries \
	-I$(PALMINC)/Libraries/PalmOSGlue \
	-I$(PALMINC)/Libraries/Lz77 \
	-I$(PALMINC)/Libraries/ExgLocal \
	-I$(PALMINC)/Libraries/Sms \
	-I$(PALMINC)/Libraries/Pdi \
	-I$(PALMINC)/Libraries/Telephony \
	-I$(PALMINC)/Libraries/Telephony/UI \
	-I$(PALMINC)/Libraries/INet \
	-I$(PALMINC)/Extensions \
	-I$(PALMINC)/Extensions/ExpansionMgr \
	-Wall

all: compile gen_grc build cleanup
	

compile: 
	$(PALMCC) $(PALMCFLAGS) $(FILENAME).c

gen_grc:
	m68k-palmos-obj-res a.out

build:	
	build-prc $(FILENAME).prc "$(FILENAME)" $(FILENAME) *.a.out.grc

cleanup:
	rm *.grc *.out
	
cleanup_all:
	rm *.grc *.out *.prc

It is not the best Makefile but it does the job. If you placed your SDK into another path, just edit the PALMINC-Variable in this Makefile. Make sure you use the correct filename. If you have a helloWorld-Application liks this:

#include <PalmOS.h>

UInt32 PilotMain(UInt16 cmd, void *cmdPBP, UInt16 launchFlags) {
	EventType event;
	char *message = "Hello World";

	if (sysAppLaunchCmdNormalLaunch == cmd) {
		WinDrawChars(message, StrLen(message), 54, 74);

		do {
			EvtGetEvent(&event, evtWaitForever);

			SysHandleEvent(&event);

		} while (event.eType != appStopEvent);
	}

	return 0;
}

and the c-file is called "HelloWorld.c", you can use it as it is. Otherwise just change the filename.

Copy the Makefile in folder next to your .c-file and run in a terminal "make all". You should now have a working .prc-file, which you can install on a Palm-OS-Device or POSE:

Note: This is a very basic not the best way to compile and build Palm-OS-Applications. If you are lucky and own a copy of CodeWarrior for Palm Os, use this IDE. It comes with everything you need and generates much better code. And it runs with Wine on Ubuntu without any problems.


Misc