SHELL = /bin/sh

prefix=@prefix@
exec_prefix=@exec_prefix@
datadir=@datadir@
confdir=@confdir@
sbindir=@sbindir@

includedir=$(prefix)/include
mandir=$(prefix)/man
libdir=$(exec_prefix)/lib
bindir=$(exec_prefix)/bin

srcdir=@srcdir@
top_srcdir=@top_srcdir@
BUILDTOP=../..
VPATH=@srcdir@
CC=@CC@
INSTALL=@INSTALL@

DEBUG=-O -g
CFLAGS=$(DEBUG) -I$(top_srcdir)/h -I$(BUILDTOP)/h @CPPFLAGS@
LDFLAGS=$(DEBUG) -L$(BUILDTOP)/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
LIBS=-lzephyr @LIBS@ -lcom_err

zcomsat_OBJS=	zcomsat.o
zLPRng_OBJS=	zLPRng.o

all: zcomsat

zcomsat: $(zcomsat_OBJS) $(BUILDTOP)/lib/zephyr/libzephyr.a @ETDEP@
	$(CC) $(LDFLAGS) -o $@ $(zcomsat_OBJS) $(LIBS)

zLPRng: $(zLPRng_OBJS) $(BUILDTOP)/lib/zephyr/libzephyr.a @ETDEP@
	$(CC) $(LDFLAGS) -o $@ $(zLPRng_OBJS) $(LIBS)

check:

install: zLPRng zcomsat
	$(INSTALL) -m 755 -s zLPRng $(sbindir)
	$(INSTALL) -m 755 -s zcomsat $(sbindir)

clean:
	rm -f $(OBJS) zLPRng zcomsat

$(OBJS): $(top_srcdir)/h/sysdep.h $(BUILDTOP)/h/config.h
$(OBJS): $(BUILDTOP)/h/zephyr/zephyr.h $(BUILDTOP)/h/zephyr/zephyr_err.h

.PHONY: all check install clean

