#	$Id$
#
# Makefile.in for libpcc.a
#

VPATH = @srcdir@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@

CC = @CC@
TARGMACH = @targmach@
TARGOS = @targos@
TARGET = @target@
VERSION = @version@
PCCLIBDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/lib
PCCINCDIR = $(libdir)/pcc/$(TARGET)/$(VERSION)/include

CPPFLAGS = @CPPFLAGS@ -I$(srcdir) @ENDIAN_FLAG@ -Dos_$(TARGOS) \
	-Dmach_$(TARGMACH) -isystem $(top_srcdir)/libpcc/include

LIBS = @LIBS@
AR = @AR@
RANLIB = @RANLIB@
INSTALL = @INSTALL@

HEADERS =	float.h limits.h stdarg.h stdbool.h stddef.h \
		iso646.h \
		libpcc_float.h libpcc_limits.h libpcc_stdarg.h \
		libpcc_stdbool.h libpcc_stddef.h

OBJS =		cmpdi2.o divdi3.o fixdfdi.o fixsfdi.o fixunsdfdi.o \
		fixunssfdi.o floatdidf.o floatdisf.o floatunsdidf.o \
		moddi3.o muldi3.o negdi2.o qdivrem.o \
		ucmpdi2.o udivdi3.o umoddi3.o cxmuldiv.o \
		ashldi3.o ashrdi3.o lshrdi3.o \
		_alloca.o unwind.o \
		ssp.o signbit.o

DEST = libpcc.a

all: $(DEST)

$(DEST): $(OBJS)
	$(AR) r $@ $?
	$(RANLIB) $@

.c.o :
	$(CC) -O $(CPPFLAGS) $(CFLAGS) -c $<

install: install-headers install-lib

install-headers:
	test -z "${DESTDIR}$(PCCINCDIR)" || mkdir -p "${DESTDIR}$(PCCINCDIR)"
	headers='$(HEADERS)'; for i in $$headers; do \
		$(INSTALL) -m 644 $(srcdir)/include/$$i \
			${DESTDIR}$(PCCINCDIR)/$$i; \
	done

install-lib:
	test -z "${DESTDIR}$(PCCLIBDIR)" || mkdir -p "${DESTDIR}$(PCCLIBDIR)"
	$(INSTALL) -m 644 $(DEST) ${DESTDIR}$(PCCLIBDIR)

clean:
	/bin/rm -f $(OBJS) $(DEST)

distclean:
	/bin/rm -f Makefile
