## Makefile for Hot Date

TARGET = hotdate
APPNAME = "Hot Date"
APPID = "HOTT"

OBJS1 = address.o datebook.o
OBJS2 = $(TARGET).o timer.o todo.o
LIBS =
CRT0 = /usr/m68k-palmos-coff/lib/gcrt0.o

CC = m68k-palmos-coff-gcc

CFLAGS = -Wall -g -O2 -nostartfiles

PILRC = pilrc -q
OBJRES = m68k-palmos-coff-obj-res
NM = m68k-palmos-coff-nm
BUILDPRC = build-prc
PILOTXFER = pilot-xfer

all:	english german turkish polish

english: alwaysres $(TARGET).prc

french:	alwaysres $(TARGET)FR.prc

german:	alwaysres $(TARGET)DE.prc

turkish: alwaysres $(TARGET)TR.prc

polish:	alwaysres $(TARGET)PL.prc
    
.S.o:
	$(CC) $(TARGETFLAGS) -c $<

.c.s:
	$(CC) $(CSFLAGS) $<

$(TARGET).prc:		code0000.$(TARGET).grc\
			code0001.$(TARGET).grc\
			data0000.$(TARGET).grc\
			pref0000.$(TARGET).grc\
			rloc0000.$(TARGET).grc\
			bin.res
	$(BUILDPRC) $(TARGET).prc $(APPNAME) $(APPID) code0001.$(TARGET).grc\
	code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc\
	rloc0000.$(TARGET).grc

$(TARGET)FR.prc:	code0000.$(TARGET).grc\
			code0001.$(TARGET).grc\
			data0000.$(TARGET).grc\
			pref0000.$(TARGET).grc\
			rloc0000.$(TARGET).grc\
			binFR.res
	$(BUILDPRC) $(TARGET)FR.prc $(APPNAME) $(APPID) code0001.$(TARGET).grc\
	code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc\
	rloc0000.$(TARGET).grc

$(TARGET)DE.prc: 	code0000.$(TARGET).grc\
			code0001.$(TARGET).grc\
			data0000.$(TARGET).grc\
			pref0000.$(TARGET).grc\
			rloc0000.$(TARGET).grc\
			binDE.res
	$(BUILDPRC) $(TARGET)DE.prc $(APPNAME) $(APPID) code0001.$(TARGET).grc\
	code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc\
	rloc0000.$(TARGET).grc

$(TARGET)TR.prc: 	code0000.$(TARGET).grc\
			code0001.$(TARGET).grc\
			data0000.$(TARGET).grc\
			pref0000.$(TARGET).grc\
			rloc0000.$(TARGET).grc\
			binTR.res
	$(BUILDPRC) $(TARGET)TR.prc $(APPNAME) $(APPID) code0001.$(TARGET).grc\
	code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc\
	rloc0000.$(TARGET).grc

$(TARGET)PL.prc: 	code0000.$(TARGET).grc\
			code0001.$(TARGET).grc\
			data0000.$(TARGET).grc\
			pref0000.$(TARGET).grc\
			rloc0000.$(TARGET).grc\
			binPL.res
	$(BUILDPRC) $(TARGET)PL.prc $(APPNAME) $(APPID) code0001.$(TARGET).grc\
	code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc\
	rloc0000.$(TARGET).grc

code0000.$(TARGET).grc: $(TARGET)
	$(OBJRES) $(TARGET)

code0001.$(TARGET).grc: code0000.$(TARGET).grc

data0000.$(TARGET).grc: code0000.$(TARGET).grc

pref0000.$(TARGET).grc: code0000.$(TARGET).grc

rloc0000.$(TARGET).grc: code0000.$(TARGET).grc

bin.res: $(TARGET).rcp $(TARGET).pbm
	$(PILRC) -L ENGLISH $(TARGET).rcp .
	touch bin.res

binFR.res: $(TARGET).rcp $(TARGET).pbm
	$(PILRC) -L FRENCH $(TARGET).rcp .
	touch binFR.res

binDE.res: $(TARGET).rcp $(TARGET).pbm
	$(PILRC) -L GERMAN $(TARGET).rcp .
	touch binDE.res

binTR.res: $(TARGET).rcp $(TARGET).pbm
	$(PILRC) -L TURKISH $(TARGET).rcp .
	touch binTR.res

binPL.res: $(TARGET).rcp $(TARGET).pbm
	$(PILRC) -L POLISH $(TARGET).rcp .
	touch binPL.res

alwaysres:
	rm -f bin*.res

$(TARGET): $(OBJS1) $(OBJS2) start.o
	$(CC) $(CFLAGS) start.o $(OBJS1) $(CRT0) $(OBJS2) -o $(TARGET) $(LIBS)
	! $(NM) -u $(TARGET) | grep .

send: $(TARGET).prc
	$(PILOTXFER) -i $(TARGET).prc

depend:
	makedepend -Y -I. *.c

clean:
	-rm -f *.[oa] $(TARGET) *.bin bin*.res *.grc Makefile.bak

veryclean: clean
	-rm -f $(TARGET).prc pilot.ram pilot.scratch

save:
	zip $@	*.c	\
		Makefile\
		*.rcp	\
		README	\
		COPYING	\
		*.h	\
		*.pbm
