# Makefile for GNU DIFF
# Copyright (C) 1988,1989,1991,1992,1993,1994,1997,1998 Free Software Foundation, Inc.
#
# This file is part of GNU DIFF.
#
# GNU DIFF 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, or (at your option)
# any later version.
#
# GNU DIFF 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.

#### Start of system configuration section. ####

srcdir     = @srcdir@
top_srcdir = @top_srcdir@
VPATH      = @srcdir@
subdir     = diff

CC = @CC@
AR = ar

CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
RANLIB = @RANLIB@
CFLAGS = @CFLAGS@

prefix = @prefix@
exec_prefix = @exec_prefix@

PR_PROGRAM = /usr/bin/pr

#### End of system configuration section. ####

SHELL = /bin/sh

# The source files for all of the programs.
SOURCES = diff.c diff3.c analyze.c cmpbuf.c cmpbuf.h io.c context.c ed.c \
	normal.c ifdef.c util.c dir.c version.c diff.h side.c system.h \
	diffrun.h
OBJECTS = diff.o diff3.o analyze.o cmpbuf.o dir.o io.o util.o \
	context.o ed.o ifdef.o normal.o side.o version.o
DISTFILES = $(SOURCES) ChangeLog build_diff.com Makefile.in diagmeet.note \
	libdiff.dsp .cvsignore

all: libdiff.a

# $(top_srcdir)/lib is so we don't get the system-supplied headers for
# functions that we supply ourselves in lib.  $(srcdir) is perhaps not
# necessary if we assume the unix compiler behavior whereby "" looks
# in the directory containing the .c file first.
# -I. is probably unnecessary (I don't think we generate any .h files).
# -I.. is for config.h.
COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) \
	-I. -I.. -I$(srcdir) -I$(top_srcdir)/lib $(CFLAGS)

.c.o:
	$(COMPILE) $<

libdiff libdiff.a: $(OBJECTS)
	$(AR) cr libdiff.a $(OBJECTS)
	-$(RANLIB) libdiff.a

$(OBJECTS): diff.h diffrun.h system.h
analyze.o cmpbuf.o: cmpbuf.h

util.o: util.c
	$(COMPILE) -DPR_PROGRAM=\"$(PR_PROGRAM)\" $<

install: all

installdirs:
	@: nothing to do for installdirs
.PHONY: installdirs

TAGS: $(SOURCES)
	etags $(SOURCES)

clean:
	rm -f *.o *.a core

mostlyclean: clean

distclean: clean
	rm -f TAGS tags Makefile

realclean: distclean

Makefile: Makefile.in ../config.status
	cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status 

dist-dir:
	mkdir ${DISTDIR}
	for i in ${DISTFILES}; do \
	  ln $(srcdir)/$${i} ${DISTDIR}; \
	done

# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
