#
# 
# Makefile for MCAST.
# CVS Version: $Id: Makefile.in,v 1.3 2006/02/27 15:29:51 olof Exp $ 
#
# Copyright (C) 2001 Olof Hagsand
#
# This software is a part of Mcast. A very simple traffic generator
# and analyzer especially tuned for IP multicast, although it is
# useful for unicast too.
# Mcast 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.
#  Mcast 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 Mcast; see the file COPYING.

srcdir  = .
prefix  = /usr/local
exec_prefix  = ${prefix}
bindir  = ${exec_prefix}/bin
CC	= gcc

CFLAGS  = -g -O2  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBNSL=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LINUX_SOCKIOS_H=1
LDFLAGS = 
LIBS    = -lnsl 
INCLUDES = -I. -I. 

SRC	= mcast.c mrcv.c mrouteadd.c
OBJS    = $(SRC:.c=.o) 
APPS	= $(SRC:.c=)

all:	$(APPS)
tags:	;etags *.[ch]
clean:  ;rm -f $(APPS) $(OBJS)
distclean:	clean  
	rm -f Makefile config.log config.status
	rm -rf autom4te.cache

# Default rule  .c.o:	
%.o : ./%.c
	$(CC) $(INCLUDES) $(CFLAGS) -c $<
# For linux?
.c.o:
	$(CC) $(INCLUDES) $(CFLAGS) -c $<

mrcv :	mrcv.c
	$(CC) $(CFLAGS) mrcv.c $(LDFLAGS) $(LIBS) -o $@ 

mcast :	mcast.c
	$(CC) $(CFLAGS) mcast.c $(LDFLAGS) $(LIBS) -o $@ 

mrouteadd :	mrcv.c
	$(CC) $(CFLAGS) mrcv.c $(LDFLAGS) $(LIBS) -o $@ 

install:	$(APPS)
	$(INSTALL) -d $(bindir)
	for i in $(APPS); do \
		$(INSTALL) $$i $(bindir)/$$i; \
	done

uninstall:
	for i in $(APPS); do \
		rm -f $(bindir)/$$i; \
	done


