# Makefile for the GNU linker ld (version 2)
-# Copyright (C) 1989-1992 Free Software Foundation, Inc.
+# Copyright (C) 1989-1993 Free Software Foundation, Inc.
# This file is part of GNU ld..
srcdir = .
+objdir = .
prefix = /usr/local
HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
HOSTING_EMU=-m $(EMUL)
-C++ = g++ -fgnu-linker
+CXX = `if [ -f ../gcc/xgcc ] ; then \
+ echo ../gcc/xgcc -B../gcc/; \
+ else echo gcc; \
+ fi`
+CXXFLAGS = -fgnu-linker
+
+# Setup the testing framework, if you have one
+RUNTEST = runtest
+RUNTEST_FLAGS =
+RUNTEST_CC = `if [ -f ../gcc/xgcc ] ; then \
+ echo ../gcc/xgcc -B../gcc/; \
+ else echo gcc; \
+ fi`
+RUNTEST_CFLAGS = $(CFLAGS)
+RUNTEST_CXX = `if [ -f ../gcc/xgcc ] ; then \
+ echo ../gcc/xgcc -B../gcc/; \
+ else echo gcc; \
+ fi`
+RUNTEST_CXXFLAGS = $(CXXFLAGS)
all:
.y.c:
.cc.o:
- $(C++) -c -I$(srcdir) $(CFLAGS) $<
+ $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
.c.o:
$(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $<
$(INCDIR)/fopen-same.h $(BFDDIR)/seclet.h ld.h \
ldmisc.h
-# START OF CHECK TARGETS
+# CYGNUS LOCAL targets.
+# These targets are for the dejagnu testsuites. The file site.exp
+# contains global variables that all the testsuites will use.
+# There is a current debate as to how and where to generate test
+# outputs. Rob feels each test should be built in $(objdir) with
+# a unique name. Cassidy feels that we should create a directory
+# called $(objdir)/tmpdir and do the work there. This way, there
+# is no potential conflict with existing objects, ie: as there
+# was in the past with loop.o and flow.o, and, there is no chance
+# of filling /tmp, which would cause other problems. Lastly, this
+# allow retention of the testcase name making debugging easier.
+#
+testdir = $(objdir)/tmpdir
+
site.exp: ./config.status Makefile
+ @if [ -d $(testdir) ]; then true; else mkdir $(testdir); fi
@echo "Making a new config file..."
- -@rm -f ./tmp?
+ @rm -f ./tmp?
@touch site.exp
-
- -@mv site.exp site.bak
+ @mv site.exp site.bak
@echo "## variables are automatically generated by make ##" > ./tmp0
@echo "# Do not edit here. If you wish to override these" >> ./tmp0
@echo "# values, add them to the last section" >> ./tmp0
- @echo "set host_os ${host_os}" >> ./tmp0
- @echo "set host_alias ${host_alias}" >> ./tmp0
- @echo "set host_cpu ${host_cpu}" >> ./tmp0
- @echo "set host_vendor ${host_vendor}" >> ./tmp0
- @echo "set target_os ${target_os}" >> ./tmp0
- @echo "set target_alias ${target_alias}" >> ./tmp0
- @echo "set target_cpu ${target_cpu}" >> ./tmp0
- @echo "set target_vendor ${target_vendor}" >> ./tmp0
- @echo "set host_triplet ${host_canonical}" >> ./tmp0
- @echo "set target_triplet ${target_canonical}" >> ./tmp0
- @echo "set srcdir ${srcdir}/testsuite" >> ./tmp0
+ @echo "# HOST AND TARGET INFO" >> ./tmp0
+ @echo "set host_os $(host_os)" >> ./tmp0
+ @echo "set host_alias $(host_alias)" >> ./tmp0
+ @echo "set host_cpu $(host_cpu)" >> ./tmp0
+ @echo "set host_vendor $(host_vendor)" >> ./tmp0
+ @echo "set target_os $(target_os)" >> ./tmp0
+ @echo "set target_alias $(target_alias)" >> ./tmp0
+ @echo "set target_cpu $(target_cpu)" >> ./tmp0
+ @echo "set target_vendor $(target_vendor)" >> ./tmp0
+ @echo "set host_triplet $(host_canonical)" >> ./tmp0
+ @echo "set target_triplet $(target_canonical)" >> ./tmp0
+ @echo "# DIRECTORY INFO" >> ./tmp0
@echo "set objdir `pwd`" >> ./tmp0
- @echo "set tool ld" >> ./tmp0
+ @echo "set tmpdir `cd $(testdir); pwd`" >> ./tmp0
@echo "" >> ./tmp0
- @echo "# GCC DEPENDANCIES" >> ./tmp0
- @echo "set CC \"${CC}\"" >> ./tmp0
- @echo "set CXX \"${C++}\"" >> ./tmp0
- @echo "set CFLAGS \"${CFLAGS}\"" >> ./tmp0
@echo "# LD DEPENDANCIES" >> ./tmp0
- @echo "set OFILES \"${OFILES}\"" >> ./tmp0
- @echo "set BFDLIB \"${BFDLIB}\"" >> ./tmp0
- @echo "set LIBIBERTY \"${LIBIBERTY}\"" >> ./tmp0
- @echo "set HOSTING_EMU \"${HOSTING_EMU}\"" >> ./tmp0
- @echo "set HOSTING_CRT0 \"${HOSTING_CRT0}\"" >> ./tmp0
- @echo "set HOSTING_LIBS \"${HOSTING_LIBS}\"" >> ./tmp0
+ @echo "set OFILES \"$(OFILES)\"" >> ./tmp0
+ @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0
+ @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0
+ @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0
+ @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0
+ @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0
@echo "" >> ./tmp0
@echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
@cat ./tmp0 > site.exp
-@rm -f ./tmp?
check: ld.new site.exp
- $(RUNTEST) $(RUNTESTFLAGS)
+ $(RUNTEST) --tool ld \
+ --srcdir $(srcdir)/testsuite $(RUNTEST_FLAGS) \
+ CC="$(RUNTEST_CC)" CFLAGS="$(RUNTEST_CFLAGS)" \
+ CXX="$(RUNTEST_CXX)" CXXFLAGS="$(RUNTEST_CXXFLAGS)"
installcheck: