# OpenVAS-Client
# $Id$
# Description: Makefile for OMP Command Line Interface
#
# Authors:
# Michael Wiegand <michael.intevation@intevation.de>
#
# Copyright:
# Copyright (C) 2008, 2009 Intevation GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2,
# or, at your option, any later version as published by the Free
# Software Foundation
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#/

include ../nessus.tmpl

INCLUDE = ${include} $(GLIB_CFLAGS) -I../../openvas-manager/src/tests -I../../openvas-manager/src

OPENVAS_INCLUDE=`sh ./cflags`
CFLAGS+=-Wall

OBJS=common.o omp-cli.o

all : cflags $(OBJS) omp-cli

cflags : Makefile
	@echo "$(NESSUS_CFLAGS) $(NESSUS_DEFS) -DPACKAGE=\"OpenVAS-Client\" $(INCLUDE)"  | sed 's/\"/\\\"/g' > cflags.tmp
	@echo "echo \"`cat cflags.tmp`\"" > cflags
	@rm cflags.tmp
	@chmod +x cflags

omp-cli.o: omp-cli.c
	$(CC) $(CFLAGS) $(LIBOPENVAS_CFLAGS) $(OPENVAS_INCLUDE) -c omp-cli.c

omp-cli: cflags $(OBJS)
	$(CC) $(LDFLAGS) common.o omp-cli.o -o omp-cli $(LIBS) $(GLIB_LIBS) $(LIBOPENVAS_LIBS)

common.o: ../../openvas-manager/src/tests/common.c ../../openvas-manager/src/tests/common.h ../../openvas-manager/src/tracef.h
	$(CC) $(CFLAGS) $(OPENVAS_INCLUDE) -c ../../openvas-manager/src/tests/common.c

clean :
	rm -f *.o cflags omp-cli
