#
# Makefile
#
# Makefile for the Pidentd daemon
#
# Original Author: Peter Eriksson <pen@lysator.liu.se>
# Modifications: HP (bkelley@cup.hp.com)

PRODUCTS=/usr/lbin/identd \
        /usr/sbin/itest \
        /usr/sbin/owners

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

include ${BUILDRULES}

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

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

INCLUDES=-I.
CCFLAGS=$(INCLUDES) $(CFLAGS) -D_HPUX_SOURCE -DHPUX_10 -DINCLUDE_EXTENSIONS -D_INCLUDE_STRUCT_FILE

all: clean build install

CSRC= parse.c kernel.c kvm.c version.c proxy.c config.c identd.c 

OBJS= parse.o kernel.o kvm.o version.o proxy.o config.o identd.o

clean:
	-rm -f identd itest core *.o

build: identd itest 

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

.c.o: 
	$(CC) $(CCFLAGS) -c $<
	
identd: $(OBJS) 
	@echo "Building... identd" ;
	$(CC) $(LDFLAGS) -o identd $(OBJS) 

itest: itest.o kernel.o kvm.o
	@echo "Building... itest" ;
	$(CC) $(LDFLAGS) -o itest itest.o kernel.o kvm.o 

kernel.o:	 kernel.c identd.h error.h kvm.h Makefile
identd.o:	 identd.c identd.h error.h Makefile
parse.o:	 parse.c identd.h error.h Makefile
kvm.o:		 kvm.c kvm.h paths.h Makefile
config.o:	 config.c Makefile
proxy.o:	 proxy.c Makefile
version.o:	 version.c Makefile

