Mail Archives: djgpp/1997/11/18/11:15:37
Nate, Eli:
Thanks for your detailed responses. I apologize for confusing DJGPP and
its GCC. I made several changes to my procedure and, while it is now an
easier procedure to follow the result is the same: I can compile C and
objective-c but not C++. In the interest of reducing turnaround time I
have attached both my BAT file for the complete rebuild and the Makefile
*after* my small edits as described in the BAT file.
It looks a bit like the c++ language is not being built. I see from the
output of gcc that it is trying to use the .cc file as linker input
rather than compiling it. I haven't changed the specs file from the
binary distribution.
It may be that <make "LANGUAGES=c c++"> isn't working, but I also tried
overriding LANGUAGES in the makefile and that didn't help either.
It may also be a problem of setting the install targets. I took Eli's
suggestion and set $prefix and $local_prefix to $(DJDIR). However some
of the other targets, in particular libsubdir, are probably funky. The
libsubdir = $(libdir)/gcc-lib/$(target)/$(version) setting gives a
directory that does not exist. I'm not sure if it should point to a
directory in the standard DJGPP distribution.
The following is program test.cc
#include <stdio.h>
int main() {
printf("Hello, World!\n");
}
Here are some trace results of my attempts to get it built with C++.
E:\djgpp\mddtest>gcc -v -o test.exe test.cc
Reading specs from e:/djgpp/lib\specs
gcc version 2.7.2.1
e:/djgpp/bin\ld.exe -o test.exe e:/djgpp/lib\crt0.o -Le:/djgpp/lib
test.cc -Tdj
gpp.djl -lgcc -lc -lgcc
test.cc: file not recognized: File format not recognized
E:\djgpp\mddtest>gcc -v -x c++ -o test.exe test.cc
Reading specs from e:/djgpp/lib\specs
gcc version 2.7.2.1
gcc.exe: language c++ not recognized
e:/djgpp/bin\ld.exe -o test.exe e:/djgpp/lib\crt0.o -Le:/djgpp/lib
test.cc -Tdj
gpp.djl -lgcc -lc -lgcc
test.cc: file not recognized: File format not recognized
========= DJGPP GCC REBUILD BATCH FILE =================
SET LFN=N
SET MAKESHELL=c:/windows/command.com
cd \djgpp\source
deltree gnu
\pk\pkunzip -d gcc2721s.zip
cd gnu\gcc-2721
rename config\msdos\configur.bat configure.bat
command /c configur go32
REM Changes to Makefile
REM change "$(srcdir)\bytecode.def" "$(srcdir)/bytecode.def" in 3
places: ln 1273, 1279, 1285
REM change prefix = $(DJDIR)
REM change local_prefix = $(DJDIR)
REM change gxx_include_dir= $(prefix)/lang/cxx
PAUSE EDIT makefile
REM We make with CFLAGS=-O2 because -g crashes the linker
PAUSE ready to make?
make "CFLAGS=-O2" "LANGUAGES=c c++"
REM Changes to cp/Makefile
REM remove `echo from `echo $(PARSE_C) line 195
PAUSE EDIT cp/makefile
PAUSE ready to cp/make?
cd cp
make "CFLAGS=-O2"
cd ..
PAUSE Ready to copy binaries?
cp cc1.exe /djgpp/bin
cp cc1plus.exe /djgpp/bin
cp cc1obj /djgpp/bin
cp cccp.exe /djgpp/bin/cpp.exe
REM ln -s /djgpp/bin/cpp.exe /djgpp/bin/cccp.exe
cp xgcc.exe /djgpp/bin/gcc.exe
cp libgcc.a /djgpp/lib
cd \djgpp\mddtest
gcc -o test.exe test.cc -lgpp
===================== MAKEFILE after edits ==============
# Makefile generated by "configure.bat"
all.dos: cccp cc1 cc1obj xgcc libgcc.a s-objlist
# Makefile for GNU C compiler.
# Copyright (C) 1987, 88, 90-94, 1995 Free Software Foundation, Inc.
#This file is part of GNU CC.
#GNU CC 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 CC 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 CC; see the file COPYING. If not, write to
#the Free Software Foundation, 59 Temple Place - Suite 330,
#Boston MA 02111-1307, USA.
# The targets for external use include:
# all, doc, proto, install, install-cross, install-cross-rest,
# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean,
# stage1, stage2, stage3, stage4.
# Suppress smart makes who think they know how to automake Yacc files
.y.c:
# Variables that exist for you to override.
# See below for how to change them for certain systems.
# List of language subdirectories.
# This is overridden by configure.
SUBDIRS =
# Selection of languages to be made.
# This is overridden by configure.
LANGUAGES = c c++ objective-c proto
ALLOCA =
ALLOCA_FLAGS =
ALLOCA_FINISH = true
# Various ways of specifying flags for compilations:
# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
# BOOT_CFLAGS is the value of CFLAGS to pass
# to the stage2 and stage3 compilations
# XCFLAGS is used for most compilations but not when using the GCC just
built.
XCFLAGS =
CFLAGS = -g
BOOT_CFLAGS = -O $(CFLAGS)
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =
X_CPPFLAGS =
T_CPPFLAGS =
CC = gcc
BISON = bison
BISONFLAGS =
LEX = flex
LEXFLAGS =
AR = ar
OLDAR_FLAGS = qc
AR_FLAGS = rc
SHELL = /bin/sh
# on sysV, define this as cp.
INSTALL = install -c
# These permit overriding just for certain files.
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
# For GNUmake: let us decide what gets passed to recursive makes.
MAKEOVERRIDES =
# Define this as & to perform parallel make on a Sequent.
# Note that this has some bugs, and it seems currently necessary
# to compile all the gen* files first by hand to avoid erroneous
results.
P =
# How to invoke ranlib.
RANLIB = ranlib
# Test to use to see whether ranlib exists on the system.
RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
# Compiler to use for compiling libgcc1.a.
# OLDCC should not be the GNU C compiler,
# since that would compile typical libgcc1.a functions such as mulsi3
# into infinite recursions.
OLDCC = gcc
# CFLAGS for use with OLDCC, for compiling libgcc1.a.
# NOTE: -O does not work on some Unix systems!
CCLIBFLAGS = -O
# Version of ar to use when compiling libgcc1.a.
OLDAR = ar
# Target to use when installing include directory. Either
# install-headers-tar or install-headers-cpio.
INSTALL_HEADERS_DIR = install-headers-tar
# Header files that are made available under the same name
# to programs compiled with GCC.
USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
$(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/va-alpha.h \
$(srcdir)/ginclude/va-h8300.h $(srcdir)/ginclude/va-i860.h \
$(srcdir)/ginclude/va-i960.h $(srcdir)/ginclude/va-mips.h \
$(srcdir)/ginclude/va-m88k.h $(srcdir)/ginclude/va-pa.h \
$(srcdir)/ginclude/va-pyr.h $(srcdir)/ginclude/va-sparc.h \
$(srcdir)/ginclude/va-clipper.h $(srcdir)/ginclude/va-spur.h \
$(srcdir)/ginclude/iso646.h $(srcdir)/ginclude/va-ppc.h \
$(srcdir)/ginclude/proto.h $(EXTRA_HEADERS)
# Target to use whe installing assert.h. Some systems may
# want to set this empty.
INSTALL_ASSERT_H = install-assert-h
# The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
# Usually the one we just built.
# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
GCC_FOR_TARGET = gcc
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
# It also specifies -I./include to find, e.g., stddef.h.
GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
-I./include
# Special flags for compiling enquire.
# We disable optimization to make floating point more reliable.
ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
ENQUIRE_LDFLAGS = $(LDFLAGS)
# Sed command to transform gcc to installed name. Overwritten by
configure.
program_transform_name = -e s,x,x,
program_transform_cross_name = -e s,^,$(target)-,
# Tools to use when building a cross-compiler.
# These are used because `configure' appends `cross-make'
# to the makefile when making a cross-compiler.
TARGET_TOOLPREFIX = $(tooldir)/bin/
AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
AR_FOR_TARGET_FLAGS = rc
RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
# Dir to search for system headers. Overridden by cross-make.
SYSTEM_HEADER_DIR = /usr/include
# Control whether to run fixproto.
STMP_FIXPROTO = st-fixproto
# Test to see whether <limits.h> exists in the system header files.
LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
# There may be a premade insn-attrtab.c for this machine.
# (You could rebuild it with genattrtab as usual, but it takes a long
time.)
# PREMADE_ATTRTAB is the file name of the file to use.
# PREMADE_ATTRTAB_MD is the md file it corresponds to.
PREMADE_ATTRTAB_MD = Makefile # Guaranteed not to cmp equal to md.
PREMADE_ATTRTAB =
target=go32
out_file=config/i386/i386.c
out_object_file=i386.o
md_file=config/i386/i386.md
tm_file=config/i386/go32.h
build_xm_file=config/i386/xm-dos.h
host_xm_file=config/i386/xm-dos.h
version=2.7.2.1
mainversion=2.7.2.1
# Directory where sources are, from where we are.
srcdir = .
# Common prefix for installation directories.
# NOTE: This directory must exist when you start installation.
prefix = ($DJDIR)
# Directory in which to put localized header files. On the systems with
# gcc as the native cc, `local_prefix' may not be `prefix' which is
# `/usr'.
# NOTE: local_prefix *should not* default from prefix.
local_prefix = $(DJDIR)
# Directory in which to put host dependent programs and libraries
exec_prefix = $(prefix)
# Directory in which to put the executable for the command `gcc'
bindir = $(exec_prefix)/bin
# Directory in which to put the directories used by the compiler.
libdir = $(exec_prefix)/lib
# Directory in which the compiler finds executables, libraries, etc.
libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
# Directory in which the compiler finds g++ includes.
gxx_include_dir= $(DJDIR)/LANG/CXX
# Directory to search for site-specific includes.
includedir = $(local_prefix)/include
# assertdir is overridden in cross-make.
# (But this currently agrees with what is in cross-make.)
assertdir = $(tooldir)/include
# where the info files go
infodir = $(prefix)/info
# Extension (if any) to put in installed man-page filename.
manext = .1
objext = .o
exeext =
# Directory in which to put man pages.
mandir = $(prefix)/man/man1
# Directory in which to find other cross-compilation tools and headers.
# Used in install-cross.
tooldir = $(exec_prefix)/$(target)
# Dir for temp files.
tmpdir = /tmp
# Additional system libraries to link with.
CLIB=
# Change this to a null string if obstacks are installed in the
# system library.
OBSTACK=obstack.o
# Specify the rule for actually making libgcc.a,
LIBGCC = libgcc.a
# and the rule for installing it.
INSTALL_LIBGCC = install-libgcc
# Specify the rule for actually making libgcc1.a.
# The value may be empty; that means to do absolutely nothing
# with or for libgcc1.a.
LIBGCC1 = libgcc1.a
# Specify the rule for making libgcc1.a for a cross-compiler.
# The default rule assumes that libgcc1.a is supplied by the user.
CROSS_LIBGCC1 = libgcc1.cross
# Specify the rule for actually making libgcc2.a.
LIBGCC2 = libgcc2.a
# Options to use when compiling libgcc2.a.
# -g1 causes output of debug info only for file-scope entities.
# we use this here because that should be enough, and also
# so that -g1 will be tested.
LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS)
$(TARGET_LIBGCC2_CFLAGS) -g1
# Additional options to use when compiling libgcc2.a.
# Some targets override this to -Iinclude
LIBGCC2_INCLUDES =
# Additional target-dependent options for compiling libgcc2.a.
TARGET_LIBGCC2_CFLAGS =
# Things which must be built before building libgcc2.a.
# Some targets override this to st-int-hdrs
LIBGCC2_DEPS =
# Enquire target (This is a variable so that a target can choose not to
# build it.)
ENQUIRE = enquire
# libgcc1-test target (must also be overridable for a target)
LIBGCC1_TEST = libgcc1-test
# List of extra executables that should be compiled for this target
machine
# that are used for compiling from source code to object code.
# The rules for compiling them should be in the t-* file for the
machine.
EXTRA_PASSES =
# Like EXTRA_PASSES, but these are used when linking.
EXTRA_PROGRAMS =
# List of extra object files that should be compiled for this target
machine.
# The rules for compiling them should be in the t-* file for the
machine.
EXTRA_PARTS =
# List of extra object files that should be compiled and linked with
# compiler proper (cc1, cc1obj, cc1plus).
EXTRA_OBJS =
# List of extra object files that should be compiled and linked with
# the gcc driver.
EXTRA_GCC_OBJS =
# List of additional header files to install.
# Often this is edited directly by `configure'.
EXTRA_HEADERS =
# Set this to `ld' to enable use of collect2.
# USE_COLLECT2 =
# It is convenient for configure to add the assignment at the beginning,
# so don't override it here.
# List of extra C and assembler files to add to libgcc1.a.
# Assembler files should have names ending in `.asm'.
LIB1FUNCS_EXTRA =
# List of extra C and assembler files to add to libgcc2.a.
# Assembler files should have names ending in `.asm'.
LIB2FUNCS_EXTRA =
# Default float.h source to use for cross-compiler.
CROSS_FLOAT_H=float.h-cross
# Program to convert libraries.
LIBCONVERT =
# Control whether header files are installed.
INSTALL_HEADERS=install-headers
# Options for tar when copying trees. So HPUX can override it.
TAROUTOPTS = xpBf
# Select which version of fixincludes to use (I.E. regular versus SVR4)
# This value is overridden directly by configure.
FIXINCLUDES=fixincludes
# Additional directories of header files to run fixincludes on.
# These should be directories searched automatically by default
# just as /usr/include is.
# *Do not* use this for directories that happen to contain
# header files, but are not searched automatically by default.
# On most systems, this is empty.
OTHER_FIXINCLUDES_DIRS=
# List of things which should already be built whenever we try to use
xgcc
# to compile anything (without linking).
GCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES)
# List of things which should already be built whenever we try to use
xgcc
# to link anything.
GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
$(EXTRA_PARTS)
# Directory to link to, when using the target `maketest'.
DIR = ../gcc
# Guaranteed to not exist when not passing md through cpp.
# This value is overridden directly by configure.
MD_FILE = md-cpp-not-used
# Flags to use when cross-building GCC.
# Prefix to apply to names of object files when using them
# to run on the machine we are compiling on.
HOST_PREFIX=
# Prefix to apply to names of object files when compiling them
# to run on the machine we are compiling on.
# The default for this variable is chosen to keep these rules
# out of the way of the other rules for compiling the same source files.
HOST_PREFIX_1=loser-
HOST_CC=$(CC)
HOST_CFLAGS=$(ALL_CFLAGS)
HOST_CLIB=$(CLIB)
HOST_LDFLAGS=$(LDFLAGS)
HOST_CPPFLAGS=$(ALL_CPPFLAGS)
HOST_ALLOCA=$(ALLOCA)
HOST_MALLOC=$(MALLOC)
HOST_OBSTACK=$(OBSTACK)
# Actual name to use when installing a native compiler.
GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed $$t`
# Actual name to use when installing a cross-compiler.
GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed
$$t`
# Choose the real default target.
ALL=all.internal
# Choose the real install target.
INSTALL_TARGET=install-normal
# Source for float.h. Overridden by cross-make.
FLOAT_H=float.h-nat
# Extra symbols for fixproto to define when parsing headers.
FIXPROTO_DEFINES =
# Extra flags to use when compiling crt{begin,end}.o.
CRTSTUFF_T_CFLAGS =
# End of variables for you to override.
# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
# The real definition is under `all.internal' (for native compilers)
# or `all.cross' (for cross compilers).
all: all.indirect
# This tells GNU Make version 3 not to put all variables in the
environment.
.NOEXPORT:
# sed inserts variable overrides after the following line.
####target overrides
####host overrides
####cross overrides
####build overrides
# Now figure out from those variables how to compile and link.
all.indirect: $(ALL)
# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
# ??? IN_GCC should be obsolete now.
INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
$(XCFLAGS)
# Likewise.
ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
# Even if ALLOCA is set, don't use it if compiling with GCC.
# USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo "${ALLOCA}" ;; esac `
# USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in
"${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
# USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo
${HOST_PREFIX}${HOST_MALLOC} ;; esac `
USE_HOST_OBSTACK=obstack.o
# USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo
${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
# Dependency on obstack, alloca, malloc or whatever library facilities
# are not installed in the system libraries.
# We don't use USE_ALLOCA because backquote expansion doesn't work in
deps.
LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
# We don't use USE_ALLOCA because backquote expansion doesn't work in
deps.
HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA)
$(HOST_PREFIX)$(HOST_MALLOC)
# How to link with both our special library facilities
# and the system's installed libraries.
LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
$(HOST_CLIB)
HOST_RTL = $(HOST_PREFIX)rtl.o
HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
HOST_PRINT = $(HOST_PREFIX)print-rtl.o
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
# Always use -I$(srcdir)/config when compiling.
.c.o:
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
# This tells GNU make version 3 not to export all the variables
# defined in this file into the environment.
.NOEXPORT:
# Support for additional languages (other than c and objc).
# ??? objc can be supported this way too (leave for later).
# These next lines are overridden by configure.
LANG_MAKEFILES =
LANG_STAGESTUFF =
LANG_DIFF_EXCLUDES =
# Flags to pass to recursive makes.
# CC is set by configure. Hosts without symlinks need special handling
# because we need CC="stage1/xgcc -Bstage1/" to work in the language
# subdirectories.
# ??? The choices here will need some experimenting with.
FLAGS_TO_PASS = \
"AR_FLAGS=$(AR_FLAGS)" \
"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
"BISON=$(BISON)" \
"BISONFLAGS=$(BISONFLAGS)" \
"CC=set-by-configure" \
"CFLAGS=$(CFLAGS)" \
"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
"LDFLAGS=$(LDFLAGS)" \
"LEX=$(LEX)" \
"LEXFLAGS=$(LEXFLAGS)" \
"MAKEINFO=$(MAKEINFO)" \
"MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
"RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"exeext=$(exeext)" \
"objext=$(objext)" \
"exec_prefix=$(exec_prefix)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"bindir=$(bindir)" \
"libsubdir=$(libsubdir)"
# Lists of files for various purposes.
# A list of all the language-specific executables.
# This is overridden by configure.
COMPILERS = cc1$(exeext) cc1obj$(exeext)
# Language-specific object files for C.
C_OBJS = c-parse.o c-lang.o c-lex.o c-pragma.o \
c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
# Language-specific object files for Objective C.
OBJC_OBJS = objc-parse.o objc-act.o c-lex.o c-pragma.o \
c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
# Files specific to the C interpreter bytecode compiler(s).
BC_OBJS = bc-emit.o bc-optab.o
# Bytecode header files constructed at build time; vmsconfig.com wants
this.
BC_ALL = bc-arity.h bc-opcode.h bc-opname.h
# Language-independent object files.
OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o
\
function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o \
dbxout.o sdbout.o dwarfout.o xcoffout.o \
integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \
insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
insn-attrtab.o $(out_object_file) getpwd.o convert.o $(EXTRA_OBJS)
# GEN files are listed separately, so they can be built before doing
parallel
# makes for cc1 or cc1plus. Otherwise sequent parallel make attempts
to load
# them before rtl.o is compiled.
GEN= genemit genoutput genrecog genextract genflags gencodes genconfig
genpeep
CCCP=cccp
# Uncomment this line if you want to use cppmain (w/cpplib) as cpp.
#CCCP=cppmain
# Files to be copied away after each stage in building.
STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
insn-attr.h insn-attrtab.c insn-opinit.c \
s-flags s-config s-codes \
s-output s-recog s-emit s-extract s-peep \
s-attr s-attrtab s-opinit s-proto s-crt s-crtS \
genemit$(exeext) genoutput$(exeext) genrecog$(exeext)
genextract$(exeext) \
genflags$(exeext) gencodes$(exeext) genconfig$(exeext) genpeep$(exeext)
\
genattrtab$(exeext) genattr$(exeext) genopinit$(exeext) \
$(BC_ALL) \
s-bcarity s-bcopcode s-bcopname \
bi-arity$(exeext) bi-opcode$(exeext) bi-opname$(exeext) \
$(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
$(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
protoize$(exeext) unprotoize$(exeext) \
specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
*.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \
*.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack \
*.[si] \
$(LANG_STAGESTUFF)
# Members of libgcc1.a.
LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
_lshrsi3 _ashrsi3 _ashlsi3 \
_divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
_fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
_addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
_eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
_eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
# Library members defined in libgcc2.c.
LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
_lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
_udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
_fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
_fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
_fixtfdi _fixunstfdi _floatditf \
__gcc_bcmp _varargs _eprintf _op_new _op_vnew _new_handler
_op_delete \
_op_vdel _bb _shtab _clear_cache _trampoline __main _exit _ctors _eh
\
_pure
# The files that "belong" in CONFIG_H are deliberately omitted
# because having them there would not be useful in actual practice.
# All they would do is cause complete recompilation every time
# one of the machine description files is edited.
# That may or may not be what one wants to do.
# If it is, rm *.o is an easy way to do it.
# CONFIG_H = $(host_xm_file) $(tm_file)
CONFIG_H =
RTL_H = rtl.h rtl.def machmode.h machmode.def
TREE_H = tree.h real.h tree.def machmode.h machmode.def
BYTECODE_H = bytecode.h bc-emit.h bc-optab.h
# Language makefile fragments.
# The following targets define the interface between us and the
languages.
#
# all.build, all.cross, start.encap, rest.encap,
# info, dvi,
# install-normal, install-common, install-info, install-man,
# uninstall, distdir,
# mostlyclean, clean, distclean, extraclean, maintainer-clean,
# stage1, stage2, stage3, stage4
#
# Each language is linked in with a series of hooks (since we can't use
`::'
# targets). The name of each hooked is "lang.${target_name}" (eg:
lang.info).
# Configure computes and adds these here.
####language hooks
# sed inserts language fragments after the following line.
####language fragments
# End of language makefile fragments.
# Avoid a lot of time thinking about remaking Makefile.in and *.def.
.SUFFIXES: .in .def
Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c
\
$(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file) \
$(LANG_MAKEFILES)
cp config.status config.run
$(SHELL) config.run
rm -f config.run
all.internal: start.encap rest.encap
# This is what to compile if making a cross-compiler.
# Note that we can compile enquire using the cross-compiler just built,
# although we can't run it on this machine.
all.cross: native gcc-cross specs st-headers $(LIBGCC) $(STMP_FIXPROTO)
\
$(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross
# This is what to compile if making gcc with a cross-compiler.
all.build: native xgcc $(EXTRA_PARTS) lang.all.build
# This is what must be made before installing GCC and converting
libraries.
start.encap: native xgcc specs $(LIBGCC1) xlimits.h lang.start.encap
# These can't be made until after GCC can run.
rest.encap: st-headers $(LIBGCC) $(STMP_FIXPROTO) $(EXTRA_PARTS)
lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS)
$(USE_COLLECT2)
# Define the names for selecting languages in LANGUAGES.
C c: cc1
OBJC objc: cc1obj objc-runtime
OBJECTIVE-C objective-c: cc1obj objc-runtime
PROTO: proto
# Tell GNU make these are phony targets.
.PHONY: C c OBJC objc OBJECTIVE-C objective-c PROTO proto
# Really, really stupid make features, such as SUN's KEEP_STATE, may
force
# a target to build even if it is up-to-date. So we must verify that
# config.status does not exist before failing.
config.status:
@if [ ! -f config.status ] ; then \
echo You must configure gcc. Look at the INSTALL file for details.;
\
false; \
else \
true; \
fi
# On the target machine, finish building a cross compiler.
# This does the things that can't be done on the host machine.
rest.cross: $(LIBGCC) gfloat.h specs
# Verify that it works to compile and link libgcc1-test.
# If it does, then there are sufficient replacements for libgcc1.a.
libgcc1-test: libgcc1-test.o native $(GCC_PARTS)
@echo "Testing libgcc1. Ignore linker warning messages."
$(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \
-nostartfiles -nostdlib `$(GCC_FOR_TARGET) --print-libgcc-file-name`
libgcc1-test.o: libgcc1-test.c native xgcc
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c
$(srcdir)/libgcc1-test.c
# Recompile all the language-independent object files.
# This is used only if the user explicitly asks for it.
compilations: ${OBJS}
# Create a list of the language-independent object files so the language
# subdirectories needn't mention their names explicitly.
s-objlist: Makefile $(OBJS) $(BC_OBJS)
echo.exe -o s-objlist $(addprefix ../,$(OBJS) $(BC_OBJS))
# We call this executable `xgcc' rather than `gcc'
# to avoid confusion if the current directory is in the path
# and CC is `gcc'. It is renamed to `gcc' when it is installed.
xgcc: gcc.o version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o version.o $(EXTRA_GCC_OBJS)
$(LIBS)
# Dump a specs file to make -B./ read these specs over installed ones.
specs: xgcc
$(GCC_FOR_TARGET) -dumpspecs > t-specs
mv t-specs specs
# We do want to create an executable named `xgcc', so we can use it to
# compile libgcc2.a.
# Also create gcc-cross, so that install-common will install properly.
gcc-cross: xgcc
cp xgcc$(exeext) gcc-cross$(exeext)
cc1: $(P) $(C_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(OBJS) $(BC_OBJS)
$(LIBS)
cc1obj: $(P) $(OBJC_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJC_OBJS) $(OBJS) $(BC_OBJS)
$(LIBS)
# Copy float.h from its source.
gfloat.h: $(FLOAT_H)
-rm -f gfloat.h
cp $(FLOAT_H) gfloat.h
# Create float.h source for the native machine.
float.h-nat: enquire
-./enquire -f > t-float.h
mv t-float.h float.h-nat
# Create a dummy float.h source for a cross-compiler.
float.h-cross:
echo "#error float.h values not known for cross-compiler" >
t-float.h-cross
mv t-float.h-cross float.h-cross
# Used to compile enquire with standard cc, but have forgotten why.
# Let's try with GCC.
enquire: enquire.o
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
enquire.o: $(srcdir)/enquire.c st-int-hdrs
# Breaking this line caused a problem with one version of GNU make.
$(GCC_FOR_TARGET) $
- Raw text -