@SET_MAKE@
AUTOMAKE_OPTIONS = 1.10 no-dependencies

# CFLAGS = @MYCFLAGS@
CFLAGS = @SITAR_CFLAGS@

noinst_LIBRARIES = libsitar_com.a libsitar_base.a libsitar_ssl.a 

libsitar_base_a_CFLAGS = -I@SNMP_INC_PATH@

libsitar_base_a_SOURCES =  \
		conf_set.c \
		set_data.c \
		opt.c \
		swap_char.c \
		malloc_set.c \
		malloc_set2.c \
		scan_malloc_set.c \
		private_malloc_set.c \
		scan_port.c \
		scan_comand.c \
		hloop.c \
		floop.c \
		time_format.c \
		stat_check.c \
		setup_check.c \
		print_conf.c \
		path_check.c \
		safe_exit.c \
		signal_exit.c \
		signal_errout.c \
		check_alget.c \
		life_put.c \
		start_neg.c \
		setup_conf.c \
		get_statfile.c \
		get_configfile.c \
		get_alget.c \
		my_chmem.c \
		check_strtol.c \
		m_exit.c \
		sacalloc.c \
		swap_malloc_set.c \
		satmpcalloc.c \
		life_pthread.c  \
		scan_block.c \
		sitar_scan.c \
		miname_dump.c \
		mid_chserver.c \
		mid_setserver.c \
		mid_remserver.c \
		miname_install.c \
		th_miname_dump.c \
		midump_remove.c \
		self_check_recvdata.c \
		check_recvdata.c \
		urldompass_port.c \
		set_request.c \
		self_set_request.c \
		resolvename_th.c \
		resolvename_sk.c \
		resolve_name.c \
		out_resolvename.c \
		scan_tcpport.c \
		scan_snmp.c \
		snmp_test.c \
		cal_oid.c \
		ch_en.c \
		cal4.c \
		scan_host.c \
		scan_url_connect.c \
		scan_smtpport.c \
		scan_statport.c \
		scan_udpport.c \
		scan_icmp.c \
		scan_dhwport.c \
		scan_ssl_command.c \
		scan_mysql_command.c \
		scan_psql_command.c \
		scan_sntp.c \
		scan_dns_connect.c \
                db_data_delim.c \
		count_memcpy3.c \
		cert_time_get.c \
		th_resolv.c

libsitar_com_a_SOURCES = \
		execom.c \
		out_execom.c \
		p_open.c

libsitar_ssl_a_SOURCES = \
		verify_ssl.c


if USE_SNMP
  SNMP_COMMAND = snmp_command
else
  SNMP_COMMAND = 
endif

if USE_HTTPS
  SCAN_HTTPS = scanssl
else
  SCAN_HTTPS = 
endif

if USE_MYSQL
  SCAN_MYSQL = scanmysql
else
  SCAN_MYSQL =
endif

if USE_PGSQL
  SCAN_PGSQL = scanpgsql
else
  SCAN_PGSQL =
endif


bin_PROGRAMS = sitar sitarctl resolv scan_block_test $(SNMP_COMMAND) $(SCAN_HTTPS) $(SCAN_MYSQL) $(SCAN_PGSQL)

sitar_CFLAGS = -I. -I..
sitar_SOURCES= sitar.c sitar.h sitar_com.h sitar_scan.h prototype.h jpreturn.h almemsys.h file_comp.h
sitar_LDADD= -lsitar_base -lsitar_com -lalmemsys -lfile_comp 
sitar_LDFLAGS= -L. -L../almemsys -L../file_comp -pthread -D_THREAD_SAFE

if USE_MYSQL
  scanmysql_CFLAGS = -I@MYSQL_INC_PATH@ -I. -I..
  scanmysql_SOURCES= almemsys.h sitar_com.h scanmysql.c sitar.h sitar_scan.h prototype.h jpreturn.h
  scanmysql_LDADD= -lmysqlclient -lsitar_base -lsitar_com -lalmemsys
  scanmysql_LDFLAGS= -L. -L.. -L../almemsys -L@MYSQL_LIB_PATH@ 
endif

if USE_PGSQL
  scanpgsql_CFLAGS = -I@PSQL_INC_PATH@ -I. -I..
  scanpgsql_SOURCES= almemsys.h sitar_com.h scanpgsql.c sitar.h sitar_scan.h prototype.h jpreturn.h
  scanpgsql_LDADD= -lpq -lsitar_base -lsitar_com -lalmemsys
  scanpgsql_LDFLAGS= -L. -L.. -L../almemsys -L@PSQL_LIB_PATH@ 
endif

if USE_HTTPS
  scanssl_CFLAGS = -I@SSL_INC_PATH@ -I. -I..
  scanssl_SOURCES= almemsys.h sitar_com.h scanssl.c sitar.h sitar_scan.h sitar_ssl.h prototype.h jpreturn.h
  scanssl_LDADD= -lssl -lcrypto -lsitar_base -lsitar_com -lsitar_ssl -lalmemsys
  scanssl_LDFLAGS= -L. -L.. -L../almemsys -L@SSL_LIB_PATH@ -D_THREAD_SAFE
endif

if USE_SNMP
  snmp_command_CFLAGS = -I@SNMP_INC_PATH@  -I. -I..
  snmp_command_SOURCES= almemsys.h snmp_command.c sitar.h 
  snmp_command_LDADD= -lalmemsys -lnetsnmp 
  snmp_command_LDFLAGS= -L. -L.. -L../almemsys -L@SNMP_LIB_PATH@
endif

scan_block_test_CFLAGS = -I. -I.. 
scan_block_test_SOURCES= scan_block_test.c sitar.h sitar_com.h sitar_scan.h prototype.h jpreturn.h almemsys.h file_comp.h sitar_snmp.h
scan_block_test_LDADD= -lsitar_base -lsitar_com -lalmemsys -lfile_comp
scan_block_test_LDFLAGS= -L. -L../almemsys -L../file_comp -pthread -D_THREAD_SAFE

sitarctl_SOURCES = sitarctl.c initdaemon.c sitar.h prototype.h jpreturn.h almemsys.h
sitarctl_LDADD= -lsitar_base -lalmemsys 
sitarctl_LDFLAGS = -L. -L../almemsys 

resolv_SOURCES = resolv.c sitar.h sitar_scan.h prototype.h jpreturn.h almemsys.h
resolv_LDADD= -lsitar_base -lalmemsys 
resolv_LDFLAGS = -L. -L../almemsys




