Original carol
http://carol.blogbus.com
Developing a Palm program using Prc-Tool, makefile is essential, this is not a big difference with the universal makefile, let's introduce you, welcome everyone to supplement, make an opinion
If you don't write Makefile, you need to enter the following command in turn:
1. Compile the .c file to .o file
M68K-PALMOS-GCC -O1-C main.c -o main.o
M68k-Palmos-GCC -O1-C Other.c-Other.o
2. Link Into An Executable file
M68k-Palmos-gcc -o1 main.oo other.o -o gnusample.tmp
3. Split the Object Into Application Sections, Product a .grc file
M68K-PALMOS-OBJ-RES GNUSAMPLE.TMP
4. Compile the resource (Use the pilrc to convers "
Pilrc gnusample.rcp
5. Build the application
Build-prc gunsample.prc "gnu sample" eRic * .bin * .gnusample.grc
The most easily understood, low Makefile is honest to knock in the command to be compiled, only when it is a batch file. I still like this, but if you have expanded, if you have expanded, you need to modify multiple places, you can maintain a bit more maintenance.
all: helloworld.prc cleanhelloworld.prc: code0000.helloworld.grc tver0001.bin build-prc helloworld.prc "Hello world" HeWo * .helloworld.grc * .bin ls -l helloworld.prctver0001.bin: helloworld.rcp .. /resources/icon.bmp ../resources/icon_s.bmp pilrc helloworld.rcpcode0000.helloworld.grc: helloworld.c m68k-palmos-gcc -O2 helloworld.c -o helloworld m68k-palmos-obj-res helloworldclean: rm helloworld * .helloWorld.grc * .bin
From: http://www.ligfiets.net/toni/palm/tutorial/uk/
Makefile of complex points, beginners are not easy to understand, but the maintenance is relatively high, such as this, require some Makefile's basics, such as macro, dependencies, rules, etc.
Recommended "Linux program design" Chapter 8 system learning.
App = Table
IconText = "Table Example"
AppID = LFTB
RCP = $ (app) .rcp
PRC = $ (app) .prc
SRC = $ (app) .c
GRC = $ (app) .grcbin = $ (app) .bin
CC = M68K-PALMOS-GCC
Pilrc = Pilrc
Objres = m68k-punmos-obj-res
Buildprc = Build-PRC
# uncomment this if you want to build a gdb debuggable version
# -On: n = Optimization-level (0 = none), -g: needed for debugging
# Cflags = -o0 -g $ (deflish) $ (incrudes)
CFLAGS = -O2 $ (defines) $ (includees)
All: $ (PRC)
$ (PRC): Grc.stamp bin.stamp;
$ (BuildPRC) $ (ICONTEXT) $ (appid) * .grc * .bin $ (linkfiles)
Ls -l * .prc
Grc.stamp: $ (app);
$ (Objres) $ (app)
Touch $ @
$ (App): $ (src: .c = .o);
$ (Cc) $ (cflags) $ ^ -o $ @
Bin.stamp: $ (RCP);
$ (Pilrc) $ ^ $ (Bindir)
Touch $ @
% .O:% .c;
$ (Cc) $ (cflags) -c $ <-o $ @
# Touch $ <
# Enable this Line if you want to compile every time.
Depend dep:;
$ (Cc) -m $ (src)> .dependencies
Clean:
RM-RF * .O $ (app) * .bin * .grc * .stamp
Veryclean: Clean
Rm -rf * .prc * .bak * ~
From: http://www.palmosbible.com