include ../../nessus.tmpl
COMPILE = $(CC) $(DEFS) $(include) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(include) $(CFLAGS)
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@


OBJS = hg_utils.o hg_add_hosts.o hg_subnet.o hg_filter.o hosts_gatherer.o \
	hg_debug.o hg_dns_axfr.o

LO_OBJS = hg_utils.lo hg_add_hosts.lo hg_subnet.lo hg_filter.lo \
	hosts_gatherer.lo hg_debug.lo hg_dns_axfr.lo


all : libhosts_gatherer.la

install : libhosts_gatherer.la
	../../libtool --mode install $(INSTALL) \
	libhosts_gatherer.la ${exec_prefix}/lib 
	../../libtool --finish ${exec_prefix}/lib
	
libhosts_gatherer.la : $(OBJS)
	../../libtool $(CC) -o libhosts_gatherer.la $(LO_OBJS) -rpath $(rpath)
	@cp libhosts_gatherer.* ${rootdir}/libs
	@cp .libs/libhosts_gatherer.* ${rootdir}/libs
	        
hg_utils.o : hg_utils.h hosts_gatherer.h
	$(LIBTOOL) --mode=compile  $(COMPILE) -c hg_utils.c

hg_add_hosts.o : hg_add_hosts.h hosts_gatherer.h
	$(LIBTOOL) --mode=compile  $(COMPILE) -c hg_add_hosts.c

hg_subnet.o : hg_subnet.h hosts_gatherer.h
	$(LIBTOOL) --mode=compile  $(COMPILE) -c hg_subnet.c
	
hg_filter.o : hg_filter.h hosts_gatherer.h
	$(LIBTOOL) --mode=compile  $(COMPILE) -c hg_filter.c	

hosts_gatherer.o : hosts_gatherer.h
	$(LIBTOOL) --mode=compile  $(COMPILE) -c hosts_gatherer.c
		
hg_dns_axfr.o : hg_dns_axfr.c hosts_gatherer.h
	$(LIBTOOL) --mode=compile $(COMPILE) -c hg_dns_axfr.c
	
hg_debug.o : hg_debug.c hosts_gatherer.h
	$(LIBTOOL) --mode=compile  $(COMPILE) -c hg_debug.c
	
clean :
	@rm -f OBJ/* lib*.a *~ *core *.lo *.o
	
