#       Makefile for the virtual services.

#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#
#       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., 675 Mass Ave, Cambridge, MA 02139, USA.
#

CC      = gcc
CFLAGS  = -Wall -Wunused -g -O
DIR    = /usr/local/bin
CONF_DIR = /etc
INSTALL = install
all:	virtuald tcp_virtuald

virtuald:	
	$(CC) $(CFLAGS) virtuald.c -o virtuald

tcp_virtuald:
	$(CC) $(CFLAGS) tcp_virtuald.c -o tcp_virtuald
install:	
	$(INSTALL) -m 0755 -o root -g root virtuald $(DIR)/
	$(INSTALL) -m 0755 -o root -g root tcp_virtuald $(DIR)/
	$(INSTALL) -m 0755 -o root -g root virt_template.pl $(DIR)/
	$(INSTALL) -m 0700 -o root -g root virt.conf $(CONF_DIR)/
	$(INSTALL) -m 0700 -o root -g root virt_template.conf $(CONF_DIR)/
	$(INSTALL) -m 0700 -o root -g root virtfs $(DIR)/
	$(INSTALL) -m 0700 -o root -g root virtrun $(DIR)/
	$(INSTALL) -m 0755 -o root -g root sendmail.init $(DIR)/

uninstall:
	rm -f $(DIR)/virtuald
	rm -f $(DIR)/tcp_virtuald
	rm -f $(DIR)/virtfs
	rm -f $(CONF)/virt.conf
	rm -f $(CONF)/virt_template.conf
	rm -f $(DIR)/virtrun
	rm -f $(DIR)/sendmail.init

clean: 
	rm -f virtuald tcp_virtuald *.o core


