# This file was generated automatically by configure.  Do not edit.
VPATH = .
links = 
host_alias = i386-EMX-OS/2
host_cpu = i386
host_vendor = EMX
host_os = OS/2
host_canonical = i386-EMX-OS/2
target_alias = i386-EMX-OS/2
target_cpu = i386
target_vendor = EMX
target_os = OS/2
target_canonical = i386-EMX-OS/2
build_alias = i386-EMX-OS/2
build_cpu = i386
build_vendor = EMX
build_os = OS/2
build_canonical = i386-EMX-OS/2
# Top Makefile for GNU MP
# Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc.

# This file is part of the GNU MP Library.

# The GNU MP Library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.

# The GNU MP Library 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 Library General Public
# License for more details.

# You should have received a copy of the GNU Library General Public License
# along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA.

srcdir = .

prefix = /usr/local

exec_prefix = $(prefix)
libdir = $(exec_prefix)/lib
infodir = $(prefix)/info
includedir = $(prefix)/include

CC = gcc
LOCAL_CC = $(CC)
CFLAGS = -O2 -D__ST_MT_ERRNO__
XCFLAGS = 
AR = ar
AR_FLAGS = rc
RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
RANLIB = ar s
SHELL = /bin/sh
INSTALL = $(srcdir)/install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
MAKEINFO = makeinfo
MAKEINFOFLAGS =
TEXI2DVI = texi2dvi
LN = ln -s

#### host and target specific makefile fragments come in here.
###

SRCS = memory.c mp_set_fns.c mp_clz_tab.c version.c stack-alloc.c mp_bpl.c \
  extract-double.c insert-double.c
OBJS = memory.o mp_set_fns.o mp_clz_tab.o version.o stack-alloc.o mp_bpl.o \
  extract-double.o insert-double.o
FILES = gmp.h mp.h gmp-impl.h longlong.h urandom.h \
 INSTALL COPYING.LIB ChangeLog \
 NEWS README SPEED TODO \
 gmp.info* gmp.texi texinfo.tex $(SRCS)

INCLUDES = -I. -Impn -I$(srcdir)
FLAGS_TO_PASS = "CC=$(CC)" "CFLAGS=$(CFLAGS)" "XCFLAGS=$(XCFLAGS)"

all: gmp.a gmp.lib

.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(XCFLAGS) $<

gmp.a: mpn/mpn.a mpz/mpz.a mpf/mpf.a mpq/mpq.a $(OBJS)
	rm -rf tmpdir
	mkdir tmpdir
	for i in mpn mpz mpf mpq; \
	  do \
	    mkdir tmpdir/$$i; \
	    ( cd tmpdir/$$i; $(AR) x ../../$$i/$$i.a ); \
	  done
	cp $(OBJS) tmpdir
	cd tmpdir; $(AR) $(AR_FLAGS) $@ *.o */*.o
	if $(RANLIB_TEST) ; then $(RANLIB) tmpdir/$@; else true; fi
	mv tmpdir/$@ .
	rm -rf tmpdir

gmp.lib: gmp.a
	emxomf -l $<

mp.a: mpn/mpn.a mpbsd/mpbsd.a $(OBJS)
	rm -rf tmpdir
	mkdir tmpdir
	for i in mpn mpbsd; \
	  do \
	    mkdir tmpdir/$$i; \
	    ( cd tmpdir/$$i; $(AR) x ../../$$i/$$i.a ); \
	  done
	cp $(OBJS) tmpdir
	cd tmpdir; $(AR) $(AR_FLAGS) $@ *.o */*.o
	if $(RANLIB_TEST) ; then $(RANLIB) tmpdir/$@; else true; fi
	mv tmpdir/$@ .
	rm -rf tmpdir

mpn/mpn.a: force
	cd mpn; $(MAKE) $(FLAGS_TO_PASS) mpn.a
mpz/mpz.a: force
	cd mpz; $(MAKE) $(FLAGS_TO_PASS) mpz.a
mpf/mpf.a: force
	cd mpf; $(MAKE) $(FLAGS_TO_PASS) mpf.a
mpq/mpq.a: force
	cd mpq; $(MAKE) $(FLAGS_TO_PASS) mpq.a
mpbsd/mpbsd.a: force
	cd mpbsd; $(MAKE) $(FLAGS_TO_PASS) mpbsd.a

check: gmp.a
	cd mpz/tests; $(MAKE) $(FLAGS_TO_PASS) check
	cd mpq/tests; $(MAKE) $(FLAGS_TO_PASS) check
	cd mpf/tests; $(MAKE) $(FLAGS_TO_PASS) check

doc: gmp.dvi gmp.info

info: $(srcdir)/gmp.info
$(srcdir)/gmp.info: $(srcdir)/gmp.texi
	cd $(srcdir); $(MAKEINFO) gmp.texi

dvi: gmp.dvi
gmp.dvi: $(srcdir)/gmp.texi
	rm -f tmp.texi
	$(LN) $(srcdir)/gmp.texi tmp.texi
	TEXINPUTS=.:$(srcdir) $(TEXI2DVI) tmp.texi
	rm -f tmp.texi
	mv tmp.dvi gmp.dvi
	rm -f tmp.*

ps: gmp.ps
gmp.ps: gmp.dvi
	dvips gmp.dvi -o gmp.ps

html: gmp_toc.html
gmp_toc.html: $(srcdir)/gmp.texi
	texi2html -acc -split_chapter $(srcdir)/gmp.texi

# The semicolon is to prevent the install.sh -> install default rule
# from doing anything.  Having it run true helps avoid problems and
# noise from versions of make which don't like to have null commands.
install: install-normal ; @true

install-strip: install-normal
install-normal: installdirs gmp.a gmp.info install-info-files
	$(INSTALL_DATA) gmp.a $(libdir)/gmp.a
	-chmod a-x $(libdir)/gmp.a
	$(INSTALL_DATA) $(srcdir)/gmp.h $(includedir)/gmp.h
	-chmod a-x $(includedir)/gmp.h
install-bsdmp: installdirs mp.a gmp.info install-info-files
	$(INSTALL_DATA) mp.a $(libdir)/mp.a
	-chmod a-x $(libdir)/mp.a
	$(INSTALL_DATA) $(srcdir)/mp.h $(includedir)/mp.h
	-chmod a-x $(includedir)/mp.h
install-info-files: installdirs $(srcdir)/gmp.info
	cd $(srcdir); for f in gmp.info*; \
	do $(INSTALL_DATA) $$f $(infodir)/$$f; done
	-chmod a-x $(infodir)/gmp.info*
	# Attempt to edit the info directory node
	if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
	  install-info --dir-file=$(infodir)/dir $(infodir)/gmp.info; \
	  else true; fi

installdirs: $(srcdir)/mkinstalldirs
	$(srcdir)/mkinstalldirs $(includedir) $(libdir) $(infodir)

uninstall:
	rm -f $(libdir)/gmp.a
	rm -f $(includedir)/gmp.h
	rm -f $(libdir)/mp.a
	rm -f $(includedir)/mp.h
	rm -f $(infodir)/gmp.info*

clean mostlyclean:
	rm -f *.o gmp.a mp.a gmp.dvi gmp.ps tmp.* tmp-*
	rm -f gmp.?? gmp.??s gmp.log gmp.toc gmp.*aux gmp*.html
	-cd mpn; $(MAKE) $@
	-cd mpz; $(MAKE) $@
	-cd mpf; $(MAKE) $@
	-cd mpq; $(MAKE) $@
	-cd mpbsd; $(MAKE) $@
distclean: clean
	-cd mpn; $(MAKE) $@
	-cd mpz; $(MAKE) $@
	-cd mpf; $(MAKE) $@
	-cd mpq; $(MAKE) $@
	-cd mpbsd; $(MAKE) $@
maintainer-clean: distclean
	rm -f $(srcdir)/gmp.info*

TAGS: force
	cd $(srcdir); etags *.[ch] mp*/*.c mpn/generic/*.c >TAGS

dist:
	@echo "sorry, not supported target"
	@exit 1

H = $(srcdir)/gmp.h $(srcdir)/gmp-impl.h mpn/gmp-mparam.h

extract-double.o: $(srcdir)/extract-double.c $(H)
insert-double.o: $(srcdir)/insert-double.c $(H)
memory.o: $(srcdir)/memory.c $(H)
mp_bpl.o: $(srcdir)/mp_bpl.c
mp_clz_tab.o: $(srcdir)/mp_clz_tab.c
mp_set_fns.o: $(srcdir)/mp_set_fns.c $(H)
stack-alloc.o: $(srcdir)/stack-alloc.c $(srcdir)/stack-alloc.h
version.o: $(srcdir)/version.c

force:
.PNONY: check install install-bsdmp install-info-files install-strip uninstall
.PHONY: doc clean distclean maintainer-clean force info dvi
