head	1.1;
branch	1.1.1;
access;
symbols
	LIBC_4_5_19:1.1.1.3
	LIBC_4_5_18:1.1.1.3
	LIBC_4_5_17:1.1.1.3
	LIBC_4_5_16:1.1.1.3
	LIBC_4_5_15:1.1.1.3
	LIBC_4_5_14:1.1.1.3
	LIBC_4_5_13:1.1.1.3
	LIBC_4_5_12:1.1.1.3
	LIBC_4_5_11:1.1.1.3
	LIBC_4_5_10:1.1.1.2
	LIBC_4_5_9:1.1.1.1
	LIBC_4_5_8:1.1.1.1
	LIBC_4_5_7:1.1.1.1
	LIBC:1.1.1;
locks; strict;
comment	@# @;


1.1
date	93.12.14.16.58.46;	author steinber;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	93.12.14.16.58.47;	author steinber;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	94.01.13.12.15.00;	author steinber;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	94.01.19.16.23.17;	author steinber;	state Exp;
branches;
next	;


desc
@@



1.1
log
@Initial revision
@
text
@#
# This is Makefile for libgcc.a
#

include ../Makeconfig

srcdir=.

LIBGCC=../libgcc3.a

LIBGCC1=libgcc1.a
LIBGCC2=libgcc2.a

JUMP_DIR:=../jump/$(SHLIB)
JUMP_LIB=libgcc

ifndef OPTFLAGS
OPTFLAGS= -O6 -fomit-frame-pointer
endif

CFLAGS = $(WFLAGS) $(OPTFLAGS) $(INC) $(XCFLAGS)

INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
INC=$(INCLUDES)

CCLIBFLAGS= $(OPTFLAGS)
LIBGCC2_CFLAGS=$(OPTFLAGS) $(DEBUGFLAGS)


.SUFFIXES:
.SUFFIXES: .S .o .c .s .i

.s.o :
	$(CC) $(CFLAGS) -c $<

.S.o :
	$(CC) $(CFLAGS) -c $<

.c.o :
	$(CC) $(CFLAGS) -c $<
#	$(LD) $(LDFLAGS) $*.o
#	$(MV) a.out $*.o

.c.s :
	$(CC) $(CFLAGS) -S $<

.c.i :
	$(CC) $(CFLAGS) -E $< -o $*.i


ifdef STATIC

all:
	echo dummy

else 	# STATIC

LIB2FUNCS = _eprintf __main _exit _ctors _op_new _op_delete \
	 _new_handler
# _muldi3 _udivdi3 _umoddi3 _udivmoddi4

all: sharedlibrary

endif	# STATIC

libgcc1.a: libgcc1.c
	-$(RM) -fr tmplibgcc1.a tmpcopy
# Actually build it in tmplibgcc1.a, then rename at end,
# so that libgcc1.a itself remains nonexistent if compilation is aborted.
# -e causes any failing command to make this rule fail.
# -e doesn't work in certain shells, so we test $$? as well.
	-set -e; \
	mkdir tmpcopy; \
	for name in .. $(LIB1FUNCS); \
	do \
	  if [ x$${name} != x.. ]; then \
	    echo $${name}; \
	    $(CC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} \
	    	$(srcdir)/libgcc1.c -o ./tmpcopy/$${name}.o; \
	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
	  else true; fi; \
	done
	(cd ./tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc1.a *.o)
	$(RM) -rf ./tmpcopy
# Some shells crash when a loop has no items.
# So make sure there is always at least one--`..'.
# Then ignore it.
# We don't use -e here because there are if statements
# that should not make the command give up when the if condition is false.
# Instead, we test for failure after each command where it matters.
	-for file in .. $(LIB1FUNCS_EXTRA); \
	do \
	  if [ x$${file} != x.. ]; then \
	    name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
	    echo $${name}; \
	    if [ $${name}.asm = $${file} ]; then \
	      cp $${file} $${name}.s || exit 1; file=$${name}.s; \
	    else true; fi; \
	    $(CC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
	    $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}.o; \
	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
	    rm -f $${name}.[so]; \
	  else true; \
	  fi; \
	done
	if [ -f tmplibgcc1.a ]; then \
	  mv tmplibgcc1.a libgcc1.a; \
	else true; fi

# Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
# But recompiling cc1 should not force recompilation of libgcc2.a.
# If you want to force recompilation, delete libgcc2.a.
# Depend on install-cross-tools to make sure we set up properly 
# to run the assembler before we try compiling anything.
# install-cross-tools does nothing if not cross compiling.
libgcc2.ready: $(GCC_PASSES) $(CROSS_TOOLS)
	-if [ -f libgcc2.ready ] ; then \
		true; \
	else \
		touch libgcc2.ready; \
	fi

libgcc2.a: libgcc2.c 
#libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
#   machmode.h longlong.h gbl-ctors.h config.status
# Actually build it in tmplibgcc2.a, then rename at end,
# so that libgcc2.a itself remains nonexistent if compilation is aborted.
	-$(RM) -fr tmplibgcc2.a tmpcopy
# -e causes any failing command to make this rule fail.
# -e doesn't work in certain shells, so we test $$? as well.
	set -e; \
	mkdir tmpcopy; \
	for name in $(LIB2FUNCS); \
	do \
	  echo $${name}; \
	  $(CC) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
	      $(srcdir)/libgcc2.c -o ./tmpcopy/$${name}.o; \
	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
	done
	(cd ./tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc2.a *.o)
	$(RM) -rf ./tmpcopy
# Some shells crash when a loop has no items.
# So make sure there is always at least one--`..'.
# Then ignore it.
# We don't use -e here because there are if statements
# that should not make the command give up when the if condition is false.
# Instead, we test for failure after each command where it matters.
	-for file in .. $(LIB2FUNCS_EXTRA); \
	do \
	  if [ x$${file} != x.. ]; then \
	    name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
	    echo $${name}; \
	    if [ $${name}.asm = $${file} ]; then \
	      cp $${file} $${name}.s || exit 1; file=$${name}.s; \
	    else true; fi; \
	    $(CC) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
	    $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
	    rm -f $${name}.[so]; \
	  else true; \
	  fi; \
	done
	mv tmplibgcc2.a libgcc2.a
# These lines were deleted from above the mv command
# because ranlibing libgcc.a itself should suffice.
#	-if [ x${HPUX_GAS} = x ] ; then \
#	  if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \
#	else true; fi

# Combine the various libraries into a single library, libgcc.a.
library: $(LIBGCC1) $(LIBGCC2)
	-$(RM) -rf tmplibgcc.a $(LIBGCC) tmpcopy
	mkdir tmpcopy
	-if [ x$(LIBGCC1) != x ];			\
	then (cd tmpcopy; $(AR) x ../$(LIBGCC1));	\
	else true;					\
	fi
	(cd tmpcopy; $(AR) x ../$(LIBGCC2))
	(cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
	$(RM) -rf tmpcopy
# Actually build it in tmplibgcc.a, then rename at end,
# so that libgcc.a itself remains nonexistent if compilation is aborted.
	mv tmplibgcc.a $(LIBGCC)

# Combine the various libraries into a single library, libgcc.a, for
# building shared library.
sharedlibrary: $(LIBGCC2)
	-$(RM) -rf tmplibgcc.a $(LIBGCC) tmpcopy
	mv $(LIBGCC2) $(LIBGCC)

clean:
	$(RM) -fr core *.o *.a tmp_make foo libgcc2.ready tmpcopy
	-for i in *.c;do \
	  if [ -f $$i ]; then \
	    $(RM) -f `basename $$i .c`.s; \
	  fi; \
	done

dep:
	$(CC) $(LIBGCC2_CFLAGS) $(INCLUDES) -M *.c > .depend

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
@


1.1.1.1
log
@LIBC_4_5_7
@
text
@@


1.1.1.2
log
@LIBC_4_5_10
@
text
@a4 7
override STATIC=false
override DEBUG=false
override PROFILE=false
override CHECKER=false

JUMP_LIB=libgcc

a5 1
include ../Makerules
d9 1
a9 1
LIBGCC=../shared/gcc/libgcc3.a
d11 1
a11 1
LIBGCC1=#libgcc1.a
d14 8
a21 1
CFLAGS = $(WFLAGS) $(OPT_CFLAGS) $(INC_CFLAGS) $(XCFLAGS)
d24 14
a37 1
INC_CFLAGS=$(INCLUDES)
d39 4
a42 2
CCLIBFLAGS= $(OPT_CFLAGS)
LIBGCC2_CFLAGS=$(OPT_CFLAGS) $(DEBUGFLAGS)
d44 2
a45 1
DIRS=
d47 8
a54 3
ifeq ($(SHARED_STATIC),true)
SHARED=true
endif
d56 1
a56 1
ifeq ($(SHARED),true)
d59 1
a59 1
         _new_handler
d62 1
a62 5
LIBGCCALIASES=$(SHARED_DIR)/$(SUBDIR)/aliases.o

LIBGCC2_CFLAGS=$(BASE_OPTFLAGS) $(DEBUGFLAGS) -B$(JUMPASDIR)/

all: check libgcc
d64 1
a64 1
lib:: check libgcc
d124 1
a124 1
libgcc2.a: libgcc2.c
d172 1
a172 1
libgcc: $(LIBGCC1) $(LIBGCC2) $(LIBGCCALIASES)
d181 1
a181 1
	$(RM) -rf tmpcopy $(LIBGCC2)
a183 2
	$(AR) $(AR_FLAGS) tmplibgcc.a $(LIBGCCALIASES)
	$(REALRANLIB) tmplibgcc.a
d186 13
a198 1
else
d200 2
a201 2
lib all:
	@@true
d203 5
a208 2

include ../Maketargets
@


1.1.1.3
log
@LIBC_4_5_11
@
text
@d12 2
a13 1
TOPDIR=..
a14 3
include $(TOPDIR)/Makeconfig
include $(TOPDIR)/Makerules

d17 1
a17 1
LIBGCC=$(TOPDIR)/shared/libgcc/libgcc3.a
a37 4
SHARED=false

include $(TOPDIR)/Maketargets

d46 1
a46 6
lib::
	@@if [ -d $(SHARED_DIR)/$(SUBDIR) ]; then \
	  true; else \
	  $(RM) -f $(SHARED_DIR)/$(SUBDIR); \
	  $(MKDIR) $(SHARED_DIR)/$(SUBDIR); \
	fi
d48 1
a48 1
lib all:: libgcc
d178 2
@
