# !/bin/sh
#  Numdiff makefile
#  Copyright (C)  2005,2006    Ivano Primi  <ivprimi@libero.it>    
#
#   Copying and distribution of this file, with or without modification,
#   are permitted in any medium without royalty provided the copyright
#   notice and this notice are preserved.
#
# Makefile.  Generated from Makefile.in by configure.

PACKAGE=numdiff

prefix          =/usr/local
exec_prefix     =${prefix}
bindir          =${exec_prefix}/bin
datadir         =${prefix}/share
infodir		=${prefix}/info
srcdir          =.


LOCALEDIR=$(prefix)/share/locale

CC=gcc

#MAKE=make

MKDIR=./shtool install -d
INSTALL_BIN=./shtool install -c -m 755
INSTALL=./shtool install -c -m 644
RM=/usr/bin/rm -f
RMDIR=/usr/bin/rmdir
FIND=/usr/bin/find
INSTINFO=/usr/bin/install-info

# flags for the preprocessor:
CPPFLAGS        =-DPACKAGE="\"$(PACKAGE)\"" -DLOCALEDIR="\"$(LOCALEDIR)\""  -I/usr/local/include -D_USE_MPA  -DENABLE_NLS 
# flags for the C compiler:
CFLAGS          =-O4

# flags for the linker:
LDFLAGS         = -L/usr/local/lib
# -L and -l options:
LIBS            =

# Do not change anything below this line !!

OBJECTS=./arith.o ./cmpfns.o ./getopt.o ./io.o ./main.o ./options.o
DOCS=./AUTHORS ./BUGS ./COPYING ./INSTALL ./README ./TODO ./docs/numdiff.html ./docs/numdiff.pdf ./docs/numdiff.txt
INFOFILE=numdiff.info
BINDIR=$(exec_prefix)/bin
DOCDIR=$(prefix)/doc/$(PACKAGE)
INFODIR=$(infodir)

all: $(PACKAGE)

$(PACKAGE): $(OBJECTS)
	$(CC) $(OBJECTS) -o $@ $(LDFLAGS) $(LIBS)

clean:
	$(RM) $(OBJECTS)
	$(RM) $(PACKAGE)

install: all
	$(MKDIR) $(BINDIR)
	$(INSTALL_BIN) $(PACKAGE) $(BINDIR)
	$(MKDIR) $(DOCDIR)
	$(INSTALL) $(DOCS) $(DOCDIR)
	$(MKDIR) $(INFODIR)
	$(INSTALL) ./docs/$(INFOFILE) $(INFODIR)
	$(INSTALL) ./docs/$(INFOFILE).gz $(INFODIR)
	$(INSTINFO) $(INFODIR)/$(INFOFILE) $(INFODIR)/dir

install-nls: install
	cd po && $(MAKE) PACKAGE=$(PACKAGE) LOCALEDIR=$(LOCALEDIR)

uninstall:
	$(RM) $(BINDIR)/$(PACKAGE)
	$(RM) $(DOCDIR)/*
	$(RMDIR) $(DOCDIR)
	$(INSTINFO) --delete $(INFODIR)/$(INFOFILE) $(INFODIR)/dir
	$(RM) $(INFODIR)/$(INFOFILE).gz
	$(RM) $(INFODIR)/$(INFOFILE)

uninstall-nls: uninstall
	$(FIND) $(LOCALEDIR) -name '$(PACKAGE).mo' -exec $(RM) \{\} \;

# Only for developer, in order to update the final documentation

manuals:
	cd docs && $(MAKE)
