#  Tilt sensor lib

LIBNAME = tilt_p3
CREATOR = Tilt

OBJECTS = $(LIBNAME).o tilt_asm.o

CC = m68k-palmos-coff-gcc -nostartfiles
XTRALIBS =
OBJRES = m68k-palmos-coff-obj-res
BUILDPRC = build-prc -L
CSFLAGS = -O2 -S

.S.o:
	$(CC) $(TARGETFLAGS) -c $<

$(LIBNAME).prc: libr0000.$(LIBNAME).grc
	$(BUILDPRC) $@ "P3/Pro Tilt Library" $(CREATOR) libr0000.$(LIBNAME).grc tver0001.bin
	m68k-palmos-coff-objdump --section-headers $(LIBNAME)

libr0000.$(LIBNAME).grc: $(LIBNAME)
	$(OBJRES) $(LIBNAME)
	rm -f {code,pref,data}0000.$(LIBNAME).grc
	mv code0001.$(LIBNAME).grc libr0000.$(LIBNAME).grc

$(LIBNAME): $(OBJECTS)
	$(CC) -shared -o $(LIBNAME) $(OBJECTS) $(XTRALIBS)

$(LIBNAME).o: $(LIBNAME).c
	$(CC) -O5 -c $(LIBNAME).c

clean:
	rm -f *.grc *.o $(LIBNAME) *~

