Category: Projects Related to Palm OS PDAs

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

Published on: 2019-06-13

/opt/palmdev/sdk/include/ /opt/palmdev/sdk/lib/ Next, you need 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 Ubuntu 18.04 at the moment, because the new version of the tool "bison" on Ubuntu 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 and install them as mentioned in the readme.md:

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. To make things a little bit easier, 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 like this:

#include 

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 into the 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 and 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. It runs with Wine on Ubuntu without any problems.