Hi!

I'm writing a hack that is going to patch two different system traps. Both
of these patches need to call a common subroutine, which is pretty large, so
I don't want to have 2 copies in my code.

With the way hacks are compiled (using GCC), is there a way to have some
shared code? If so, what would I have to change in the following makefile so
that it would work correctly?:

----------------------------------------------------------------
# Add .bin to the list of suffixes that make recognizes
.SUFFIXES:  .bin

HACK        = MyHack
HACKNAME    = "MyHack"
HACKID      = MYHK
HACKSRC     = code03e8.c code03e9.c code07d0.c
HACKRES     = $(HACK).rcp

DEBUGCFLAGS     = -O2 -palmos3.5 -g
RELEASECFLAGS   = -O2 -palmos3.5 -Wunused

# You shouldn't have to change anything below this line

CC      = m68k-palmos-gcc
OBJRES  = obj-res

debug:
        make CFLAGS="$(DEBUGCFLAGS)" all

release:
        make CFLAGS="$(RELEASECFLAGS)" all

all:    $(HACK).prc

HACKBIN = $(HACKSRC:.c=.bin)

# This rule builds a standalone code resource (.bin) from a C source file
.c.bin:
        $(CC) $(CFLAGS) -nostartfiles -o $(*F) $<
        $(OBJRES) $(*F)
        cp code0001.$(*F).grc $@
        rm $(*F)

$(HACK).prc: hackresbin $(HACKBIN)
        build-prc -t HACK $@ $(HACKNAME) $(HACKID) *.bin

hackresbin: $(HACKRES) $(HACK).h
        pilrc -q $(HACK).rcp
        touch $@

$(HACKBIN): $(HACK).h

clean:
        rm -f *.grc *.bin $(HACK).prc hackresbin
----------------------------------------------------------------

TIA,

Tom


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to