# intermim Makefile for aprsmon and aprsdigi.  Hopefully this code will get
# folded back into ax25-utils.....
AXLIB=../ax25-utils-2.1.42a/lib
DISTFILES=aprsmon.8 aprsmon.c aprsshm.c aprsshm.h \
	aprsdigi.c aprsdigi.8 \
	mic_e.c mic_e.h Makefile COPYING README \
	ax25-utils*patch*

all: aprsmon aprsdigi 

install: all
	install -m 750 -o root -g bin aprsmon /usr/sbin/aprsmon
	install -m 750 -o root -g bin aprsdigi /usr/sbin/aprsdigi

html:	aprsmon.html aprsdigi.html

CC = gcc
LD = gcc
#DEBUG = -DDEBUG -g
DEBUG = -g
SHM=-DUSE_SHM
CFLAGS = $(SHM) $(DEBUG) -Wall -Wstrict-prototypes -O2 -I$(AXLIB)
LIBS = -L$(AXLIB)/lib -lax25

.c.o:
	$(CC) $(CFLAGS) -c -o $*.o $<

clean:
	rm -f aprsmon aprsdigi *.o *~ *.bak

dist: 
	rm -f aprsmon.zip
	zip aprsmon.zip $(DISTFILES)
	mcopy aprsmon.zip a:

backup:
	tar cfz aprsmon.bak $(DISTFILES) RCS
	mcopy aprsmon.bak a:

aprsmon.o: aprsmon.c

aprsshm.o: aprsshm.c

aprsdigi.o: aprsdigi.c

mic_e.o: mic_e.c mic_e.h

aprsmon: aprsmon.o aprsshm.o mic_e.o
	$(LD) $(LDFLAGS) -o aprsmon aprsmon.o aprsshm.o mic_e.o $(LIBS)

aprsdigi: aprsdigi.o mic_e.o
	$(LD) $(LDFLAGS) -o aprsdigi aprsdigi.o mic_e.o $(LIBS)

aprsdigi.html: aprsdigi.8
	nroff -man ./aprsdigi.8 | man2html | cat man-pre.html - man-post.html >aprsdigi.html

aprsmon.html: aprsmon.8
	nroff -man ./aprsmon.8 | man2html | cat man-pre.html - man-post.html >aprsmon.html

