## Makefile for AN Address

OBJS = anproxy.o
LIBS =
PRCS = an_address.prc an_datebook-agenda.prc an_datebook-week.prc an_datebook-month.prc an_datebook-quarter.prc
TARGETS = an_address an_datebook-agenda an_datebook-week an_datebook-month an_datebook-quarter

CC = m68k-palmos-coff-gcc

CFLAGS = -Wall -O2

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

all: $(PRCS)
	make clean

an_address.prc: anproxy.c an_address.rcp
	make clean
	$(PILRC) an_address.rcp
	$(CC) anproxy.c -DVIEWCONTACT -o an_address
	$(OBJRES) an_address
	$(BUILDPRC) an_address.prc "AN Address" "ANad" *.grc *.bin

an_datebook-agenda.prc: anproxy.c an_datebook.rcp
	make clean
	$(PILRC) an_datebook.rcp
	$(CC) anproxy.c -DVIEWAGENDA -o an_datebook-agenda
	$(OBJRES) an_datebook-agenda
	$(BUILDPRC) an_datebook-agenda.prc "AN DateBk" "ANdb" *.grc *.bin

an_datebook-week.prc: anproxy.c an_datebook.rcp
	make clean
	$(PILRC) an_datebook.rcp
	$(CC) anproxy.c -DVIEWWEEK -o an_datebook-week
	$(OBJRES) an_datebook-week
	$(BUILDPRC) an_datebook-week.prc "AN DateBk" "ANdb" *.grc *.bin

an_datebook-month.prc: anproxy.c an_datebook.rcp
	make clean
	$(PILRC) an_datebook.rcp
	$(CC) anproxy.c -DVIEWMONTH -o an_datebook-month
	$(OBJRES) an_datebook-month
	$(BUILDPRC) an_datebook-month.prc "AN DateBk" "ANdb" *.grc *.bin

an_datebook-quarter.prc: anproxy.c an_datebook.rcp
	make clean
	$(PILRC) an_datebook.rcp
	$(CC) anproxy.c -DVIEWQUARTER -o an_datebook-quarter
	$(OBJRES) an_datebook-quarter
	$(BUILDPRC) an_datebook-quarter.prc "AN DateBk" "ANdb" *.grc *.bin


$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o $(TARGET) $(LIBS)
	! $(NM) -u $(TARGET) | grep .

send:
	$(PILOTXFER) -i an_address.prc an_datebook-agenda.prc

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

veryclean: clean
	-rm *.prc *.zip *.tar.gz

dist: all
	./html_stamp.pl 1.0
	zip anproxy-1.0.zip *.prc *.htm ChangeLog
	tar cvf anproxy-src-1.0.tar *.prc *.htm ChangeLog *.c *.rcp *.bmp Makefile *.pl
	gzip -9 anproxy-src-1.0.tar

