# Generated automatically from Makefile.in by configure.
# Makefile for librx
# Copyright (C) 1994 Free Software Foundation, Inc.
# 
# This file is part of GNU Rx
# 
# GNU Rx 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 Rx 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 GNU SED; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

SHELL = /bin/sh

srcdir = ../../../librx
VPATH = ../../../librx

prefix = /usr/local
exec_prefix = ${prefix}

bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
infodir = ${prefix}/info

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

CC = gcc
INSTALL = ginstall -c
INSTALL_DATA = ${INSTALL} -m 644
DEFS =  -DHAVE_ALLOCA=1 -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 
CFLAGS = -g 
LIBCFLAGS = $(CFLAGS)
AR = ar
AR_FLAGS = rc
RANLIB = ranlib
PICFLAG =
enable_shared = no

# 

source=rx.c
headers=rx.h
ancillery=configure.in Makefile.in configure \
	  COPYING.LIB INSTALL INSTALL.rx ChangeLog DOC 
distfiles=$(source) $(headers) $(ancillery)
libobjs=rx.o

COMPILE.c = $(CC) -c $(LIBCFLAGS) $(DEFS) -I$(srcdir)
.c.o:
	if [ x"$(enable_shared)" = xyes ]; then \
	  $(COMPILE.c) $(PICFLAG) $< -o pic/$@; \
	else true; fi
	$(COMPILE.c) $<

all: librx.a

install: all
	$(INSTALL_DATA) librx.a $(libdir)/librx.a
	$(RANLIB) $(libdir)/librx.a
	$(INSTALL_DATA) $(srcdir)/rx.h $(includedir)/rx.h


uninstall:
	rm $(libdir)/librx.a
	rm $(includedir)/rx.h

clean:
	-rm -rf $(libobjs) librx.a pic stamp-picdir

distclean: clean
	-rm Makefile config.status config.cache config.log multilib.out

mostlyclean: clean

maintainer-clean realclean: distclean

TAGS:
	etags $(source)

info:

install-info:

clean-info:

dvi:

check:

dist:	$(distfiles)
	echo rx-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q rx.c` > .fname
	rm -rf `cat .fname`
	mkdir `cat .fname`
	ln $(distfiles) `cat .fname`
	tar chzf `cat .fname`.tar.gz `cat .fname`
	rm -rf `cat .fname` .fname


librx.a: $(libobjs)
	rm -f librx.a
	$(AR) $(AR_FLAGS) librx.a rx.o
	$(RANLIB) librx.a

rx.o: stamp-picdir rx.c rx.h

stamp-picdir:
	if [ x"$(enable_shared)" = xyes ] && [ ! -d pic ]; then \
	  mkdir pic; \
	else true; fi
	touch stamp-picdir

# FIXME: There should be an @-sign in front of the `if'.
# Leave out until this is tested a bit more.
multi-do:
	if [ -z "$(MULTIDIRS)" ]; then \
	  true; \
	else \
	  rootpre=`pwd`/; export rootpre; \
	  srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
	  lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
	  compiler="$(CC)"; \
	  for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
	    dir=`echo $$i | sed -e 's/;.*$$//'`; \
	    if [ "$${dir}" = "." ]; then \
	      true; \
	    else \
	      if [ -d ../$${dir}/$${lib} ]; then \
		flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
		if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
				CFLAGS="$(CFLAGS) $${flags}" \
				CXXFLAGS="$(CXXFLAGS) $${flags}" \
				LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
				LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
				$(DO)); then \
		  true; \
		else \
		  exit 1; \
		fi; \
	      else true; \
	      fi; \
	    fi; \
	  done; \
	fi

# FIXME: There should be an @-sign in front of the `if'.
# Leave out until this is tested a bit more.
multi-clean:
	if [ -z "$(MULTIDIRS)" ]; then \
	  true; \
	else \
	  lib=`pwd | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
	  for dir in Makefile $(MULTIDIRS); do \
	    if [ -f ../$${dir}/$${lib}/Makefile ]; then \
	      if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
	      then true; \
	      else exit 1; \
	      fi; \
	    else true; \
	    fi; \
	  done; \
	fi
