# OpenVAS-Client
# $Id$
# Description: Makefile for OMP Command Line Interface
#
# Authors:
# Michael Wiegand <michael.intevation@intevation.de>
#
# Copyright:
# Copyright (C) 2009 Greenbone Networks 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 ../openvas.tmpl

INCLUDE = ${include} $(GLIB_CFLAGS)

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

OBJS=omp-cli.o

all : cflags $(OBJS) omp-cli

cflags : Makefile
	@echo "$(OPENVAS_CFLAGS) $(OPENVAS_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) omp-cli.o -o omp-cli $(LIBS) $(GLIB_LIBS) $(LIBOPENVAS_LIBS)

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