# Makefile for GNU `time' command.
# Copyright (C) 1989, 1990 Free Software Foundation, Inc.

# 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 1, 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

# Things that can go in DEFS:
# -DLIMITS_MISSING	If you lack <limits.h>.
# -DSIGTYPE=int		If your signal handlers return int, not void.
DEFS = -DLIMITS_MISSING -DSIGTYPE=int
CWARN = -W -Wunused -Wimplicit -Wreturn-type -Wcomment
CFLAGS = -g -I. $(DEFS) $(CWARN)

LDFLAGS = -g

LIBS = 

# Where to install time.
BINDIR = /usr/local/gnubin

HDRS = proto.h getopt.h
SRCS = time.c getopt.c getopt1.c
OBJS = time.o getopt.o getopt1.o
DISTFILES = COPYING ChangeLog Makefile time.texinfo $(HDRS) $(SRCS)
VERSION = 1.0

all: time

time: $(OBJS)
	$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)

time.o: proto.h getopt.h

getopt1.o: getopt.h

install:	time
	install -c time $(BINDIR)

TAGS:	$(HDRS) $(SRCS)
	etags $(HDRS) $(SRCS)

clean:
	rm -f $(OBJS) time core a.out tags TAGS

dist:	time-$(VERSION).tar.Z

time-$(VERSION).tar.Z:	$(DISTFILES)
	rm -rf time-$(VERSION)
	mkdir time-$(VERSION)
	ln $(DISTFILES) time-$(VERSION)
	tar czhf time-$(VERSION).tar.Z time-$(VERSION)
	rm -rf time-$(VERSION)
