2004-09-19 05:19:41 +02:00
|
|
|
# -*- mode: Makefile; -*-
|
|
|
|
|
|
|
|
PLATFORM = PALM_PNO
|
|
|
|
PALMDIR = /usr/local/share/palmdev/sdk-5r3/include
|
|
|
|
|
|
|
|
WHICH = elf
|
|
|
|
#WHICH = palmos
|
|
|
|
|
|
|
|
CC_ARM = arm-$(WHICH)-gcc
|
|
|
|
OC_ARM= arm-$(WHICH)-objcopy
|
|
|
|
OD_ARM = arm-$(WHICH)-objdump
|
|
|
|
|
|
|
|
INCLUDE += \
|
|
|
|
-I$(PALMDIR) \
|
|
|
|
-I$(PALMDIR)/Libraries \
|
|
|
|
-I$(PALMDIR)/Dynamic \
|
|
|
|
-I$(PALMDIR)/Core \
|
|
|
|
-I$(PALMDIR)/Extensions/ExpansionMgr \
|
|
|
|
-I$(PALMDIR)/Core/UI \
|
|
|
|
-I$(PALMDIR)/Core/System \
|
|
|
|
-I$(PALMDIR)/Core/System/Unix \
|
|
|
|
-I$(PALMDIR)/Core/Hardware \
|
|
|
|
-I. -I../common
|
|
|
|
|
2004-09-24 03:16:08 +02:00
|
|
|
# NOTE!!!! Added the -w flag to supress all warnings since arm-elf-gcc
|
|
|
|
# does so much bitching about the Palm headers. Need to fix that, or
|
|
|
|
# use the arm-palmos-gcc, or something. But for now, -w....
|
|
|
|
CCFLAGS = -O2 -g -Wall -D__PALMOS__ -w
|
2004-09-19 05:19:41 +02:00
|
|
|
ARMCCFS = $(CCFLAGS) -DNATIVE \
|
|
|
|
-nostartfiles -mshort-load-bytes -nodefaultlibs -ffixed-r9 -ffixed-r8 \
|
|
|
|
-mpic-register=r10 -msingle-pic-base -fPIC \
|
|
|
|
$(INCLUDE)
|
|
|
|
|
|
|
|
ARMLDFS = -Xlinker --script=./ldscript.arm -lgcc
|
|
|
|
|
|
|
|
# ARM-specific
|
2004-09-24 03:16:08 +02:00
|
|
|
ARM_DEFINES = $(MYDEFS) -DXW_TARGET_PNO -D__LITTLE_ENDIAN
|
|
|
|
# turn show progress off for now
|
|
|
|
ARM_DEFINES += -USHOW_PROGRESS
|
2004-09-19 05:19:41 +02:00
|
|
|
|
|
|
|
include ../common/config.mk
|
|
|
|
|
|
|
|
OBJS = $(PLATFORM)/pnolet.o \
|
|
|
|
$(PLATFORM)/palmmain.o \
|
|
|
|
$(PLATFORM)/palmsavg.o \
|
|
|
|
$(PLATFORM)/gameutil.o \
|
|
|
|
$(PLATFORM)/newgame.o \
|
|
|
|
$(PLATFORM)/palmdict.o \
|
|
|
|
$(PLATFORM)/palmdraw.o \
|
|
|
|
$(PLATFORM)/palmutil.o \
|
|
|
|
$(PLATFORM)/dictui.o \
|
|
|
|
$(PLATFORM)/dictlist.o \
|
|
|
|
$(PLATFORM)/palmir.o \
|
|
|
|
$(PLATFORM)/prefsdlg.o \
|
|
|
|
$(PLATFORM)/connsdlg.o \
|
|
|
|
$(PLATFORM)/pace_gen.o \
|
2004-09-21 06:31:49 +02:00
|
|
|
$(PLATFORM)/pace_man.o \
|
2004-09-19 05:19:41 +02:00
|
|
|
$(COMMONOBJ)
|
|
|
|
|
|
|
|
# The target of this makefile is the .bin files that comprise the
|
|
|
|
# pnolet. There will be more than just PNOC0000.bin, but the others
|
|
|
|
# get made as a matter of course and as long as they all get included
|
|
|
|
# in the .prc we're fine.
|
|
|
|
|
|
|
|
all: PNOC0000.bin PNOG0000.bin
|
|
|
|
|
|
|
|
$(PLATFORM)/%.o : %.c $(MAKEFILE)
|
|
|
|
mkdir -p $(PLATFORM)
|
2004-09-23 03:59:53 +02:00
|
|
|
$(CC_ARM) -o $@ -c $(ARM_DEFINES) -DHERE $(ARMCCFS) $<
|
2004-09-19 05:19:41 +02:00
|
|
|
|
|
|
|
$(COMMONOBJDIR)/%.o : $(COMMONDIR)/%.c $(MAKEFILE)
|
|
|
|
mkdir -p $(COMMONOBJDIR)
|
2004-09-23 03:59:53 +02:00
|
|
|
$(CC_ARM) -o $@ -c $(ARM_DEFINES) -DHERE $(ARMCCFS) $<
|
2004-09-19 05:19:41 +02:00
|
|
|
|
|
|
|
PNOC_bin.pre PNOG0000.bin: pace_gen.h $(OBJS)
|
2004-09-19 17:50:28 +02:00
|
|
|
$(CC_ARM) $(OBJS) $(ARMCCFS) $(ARMLDFS) -Wl,-Map,PNOC_bin.map -o tmp.out
|
2004-09-19 05:19:41 +02:00
|
|
|
# @$(OD_ARM) --disassemble-all tmp.out
|
|
|
|
$(OC_ARM) -j .text -O binary tmp.out PNOC_bin.pre
|
|
|
|
$(OC_ARM) -j .got -O binary tmp.out PNOG0000.bin
|
|
|
|
# @rm -f tmp.out
|
|
|
|
|
|
|
|
# create not only PNOC0000.bin but any others required to fit the
|
|
|
|
# pnolet into 50K chunks (for hotsyncing...)
|
|
|
|
PNOC0000.bin: PNOC_bin.pre
|
|
|
|
rm -f PNOC????.bin
|
|
|
|
split -a 4 -b 50k -d $< PNOC
|
|
|
|
for f in $$(ls PNOC????); do mv $$f $$f.bin; done
|
|
|
|
|
|
|
|
pace_gen.c pace_gen.h: ./gen_pace.pl funcfile.txt
|
|
|
|
rm -f $@ _dirList
|
2004-09-23 03:59:53 +02:00
|
|
|
./gen_pace.pl -func funcfile.txt \
|
|
|
|
-file $(PALMDIR)/Core/UI \
|
|
|
|
-file $(PALMDIR)/Core/System \
|
|
|
|
-file $(PALMDIR)/Extensions/ExpansionMgr \
|
|
|
|
-oc pace_gen.c -oh pace_gen.h
|
2004-09-19 05:19:41 +02:00
|
|
|
rm -f _dirList
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(OBJS) pace_gen.c pace_gen.h *.bin PNOC_bin.pre
|