# Make file for rbootd directory
#
# Things you might want to change.  Pass them in on the command line:
# ROOT - should point to the root where the commands will be installed
#        (e.g. /deliver/INETSVCS/indnetwk)

ROOT=

PRODUCTS=/usr/sbin/rbootd \
	/usr/newconfig/etc/boottab

# Defaults file containing the shell, compiler options, etc
BUILDRULES=/source/INETSVCS/$(LOGNAME)/config/defaults

include ${BUILDRULES}

INCLUDES=-I/usr/include

#CCFLAGS=$(INCLUDES) -g -DDEBUG  $(CFLAGS)
#MYLDFLAGS=-g $(LDFLAGS)

CCFLAGS=$(INCLUDES)  $(CFLAGS)
MYLDFLAGS=$(LDFLAGS)

LIBS   = bootpfwd/libbootpfwd.a

OBJS=	hpux_rel.o DTC_boot.o rbootd.o setup.o session.o client.o \
		util.o  rmp_proto.o getpacket.o 
SRCS=   hpux_rel.c DTC_boot.c rbootd.c setup.c session.c client.c \
		util.c rmp_proto.c getpacket.c 
HDRS=	DTC_boot.h rbootd.h rmp_proto.h 


#Install database name
INSTALLDB=/source/INETSVCS/$(LOGNAME)/config/installdb

#Script called to parse the install deliverable
INSTALLSCPT=/source/INETSVCS/$(LOGNAME)/config/install_script

default: all

all: clean build install

clean:
	$(RM) -f *.o; \
	$(ECHO) "rbootd clean\n"; \
	$(RM) -f rbootd; \
	cd bootpfwd; \
	$(MAKE) clean; \
	$(ECHO) "bootpfwd clean\n"
	
.c.o:
	$(CC) -c $(CCFLAGS) $*.c

build: libbootpfwd.a rbootd

libbootpfwd.a:
	cd bootpfwd; \
	$(MAKE) build

rbootd: $(OBJS)
	$(ECHO) "Building rbootd..."
	$(CC) $(MYLDFLAGS) -o $@ $(OBJS) $(LIBS)

install:
	for file in $(PRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done
