#***********************************************************************
#
#	File:	Makefile
#	Rev:	a-1
#	Date:	02/20/93
#
#	Copyright (c) 1993, by The University of Virginia
#
#***********************************************************************
#
#	Makefile for the Rectilinear Steiner Tree program.
#
#***********************************************************************
#
#	Modification Log:
#
#	a-1:	02/20/93	dmw
#		: Created.
#
#***********************************************************************
#
#
# Macros for each include file.
#

CTYPE_H				= /usr/include/ctype.h
LIMITS_H			= /usr/include/limits.h
STDDEF_H			= /usr/include/stddef.h
STDIO_H				= /usr/include/stdio.h
STDLIB_H			= /usr/include/stdlib.h
STRING_H			= /usr/include/string.h
TIME_H				= /usr/include/time.h

# Default is to use the ANSI C interfaces for measuring CPU time usage.
# If the native UNIX interface (times) is available and has a resolution
# closer to hundredths of a second, then un-comment the following line:
CPU_TIME_FLAGS = -DUNIX_CPU_TIME

CC = gcc
CFLAGS = -O2 -g $(CPU_TIME_FLAGS)

TARGETS = main rand_points

OBJECTS = \
	art.o \
	coarse.o \
	compat.o \
	cputime.o \
	data.o \
	decomp.o \
	fine.o \
	gensets.o \
	main.o \
	mst.o \
	output.o \
	relief.o \
	search.o \
	utils.o

all:	$(TARGETS)

main : $(OBJECTS)
	$(CC) -o main $(OBJECTS)

steiner.h : \
		$(CTYPE_H) \
		$(LIMITS_H) \
		$(STDDEF_H) \
		$(STDIO_H) \
		$(STDLIB_H) \
		$(STRING_H)
	touch steiner.h

art.o : art.c steiner.h

coarse.o : coarse.c steiner.h

compat.o : compat.c steiner.h

cputime.o : cputime.c steiner.h

data.o : data.c steiner.h

decomp.o : decomp.c steiner.h

fine.o : fine.c steiner.h

gensets.o : gensets.c steiner.h

main.o : main.c steiner.h

mst.o : mst.c steiner.h

output.o : output.c steiner.h

relief.o : relief.c steiner.h

search.o : search.c steiner.h

utils.o : utils.c steiner.h

rand_points : rand_points.c steiner.h $(TIME_H)
	$(CC) $(CFLAGS) -o rand_points rand_points.c

clean :
	-rm -f $(TARGETS) $(OBJECTS)
