aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-11-02 06:30:15 +0100
committerTristan Gingold <tgingold@free.fr>2014-11-02 06:30:15 +0100
commit77dadd243e9ec21f9f60473291f2cf8d1fdcf289 (patch)
treeeac5c54290b531c55144ede598f1d0d8c73c6e86
parent0490ec633ec8c32e91b4c8e8379570ceddadbb2a (diff)
downloadghdl-77dadd243e9ec21f9f60473291f2cf8d1fdcf289.tar.gz
ghdl-77dadd243e9ec21f9f60473291f2cf8d1fdcf289.tar.bz2
ghdl-77dadd243e9ec21f9f60473291f2cf8d1fdcf289.zip
Remove ortho/gcc/Makefile.inc and adjust.
-rw-r--r--ortho/gcc/Makefile30
-rw-r--r--translate/gcc/Make-lang.in20
-rwxr-xr-xtranslate/gcc/dist.sh19
3 files changed, 44 insertions, 25 deletions
diff --git a/ortho/gcc/Makefile b/ortho/gcc/Makefile
index 36ff842fa..5aafb31c7 100644
--- a/ortho/gcc/Makefile
+++ b/ortho/gcc/Makefile
@@ -11,8 +11,8 @@ COMPILER=$(CXX)
LINKER=$(CXX)
# Modify AGCC_GCCSRC_DIR and AGCC_GCCOBJ_DIR for your environment
-AGCC_GCCSRC_DIR:=$(HOME)/Projects/gcc4.8.2/source/gcc-4.8.2/
-AGCC_GCCOBJ_DIR:=$(HOME)/Projects/gcc4.8.2/build/
+AGCC_GCCSRC_DIR:=$(HOME)/Projects/gcc4.9.2/source/gcc-4.9.2/
+AGCC_GCCOBJ_DIR:=$(HOME)/Projects/gcc4.9.2/build/
# Supplied by main GCC Makefile, copied here for compatibility with same
GMPLIBS = -L$(AGCC_GCCOBJ_DIR)./gmp/.libs -L$(AGCC_GCCOBJ_DIR)./mpfr/.libs \
@@ -30,9 +30,26 @@ ZLIB=-lz
all: $(ortho_exec)
ORTHO_BASENAME=ortho_gcc
-include $(orthobe_srcdir)/Makefile.inc
include $(ortho_srcdir)/Makefile.inc
+AGCC_INC_FLAGS=-I$(AGCC_GCCOBJ_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/include \
+ -I$(AGCC_GCCSRC_DIR)/gcc -I$(AGCC_GCCSRC_DIR)/gcc/config \
+ -I$(AGCC_GCCSRC_DIR)/libcpp/include $(GMPINC)
+AGCC_CFLAGS=-g -Wall -DIN_GCC $(AGCC_INC_FLAGS)
+
+ortho-lang.o: $(agcc_srcdir)/ortho-lang.c \
+ $(AGCC_GCCOBJ_DIR)gcc/gtype-vhdl.h \
+ $(AGCC_GCCOBJ_DIR)gcc/gt-vhdl-ortho-lang.h
+ $(COMPILER) -c -o $@ $< $(AGCC_CFLAGS) $(INCLUDES)
+
+AGCC_LOCAL_OBJS=ortho-lang.o
+
+AGCC_DEPS := $(AGCC_LOCAL_OBJS)
+AGCC_OBJS := $(AGCC_LOCAL_OBJS) \
+ $(AGCC_GCCOBJ_DIR)gcc/attribs.o \
+ $(AGCC_GCCOBJ_DIR)libcpp/libcpp.a \
+ $(AGCC_GCCOBJ_DIR)libiberty/libiberty.a
+
LIBBACKTRACE = $(AGCC_GCCOBJ_DIR)/libbacktrace/.libs/libbacktrace.a
LIBDECNUMBER = $(AGCC_GCCOBJ_DIR)/libdecnumber/libdecnumber.a
LIBIBERTY = $(AGCC_GCCOBJ_DIR)/libiberty/libiberty.a
@@ -53,6 +70,10 @@ $(ortho_exec): $(AGCC_DEPS) $(orthobe_srcdir)/ortho_gcc.ads force
-bargs -E -largs --LINK=$(LINKER) $(AGCC_OBJS) \
$(BACKEND) $(LIBS) $(BACKENDLIBS)
+agcc-clean: force
+ $(RM) -f $(agcc_objdir)/*.o
+ $(RM) -f $(agcc_srcdir)/*~
+
clean: agcc-clean
$(RM) -f *.o *.ali ortho_nodes-main
$(RM) b~*.ad? *~
@@ -62,5 +83,4 @@ distclean: clean agcc-clean
force:
-.PHONY: force all clean
-
+.PHONY: force all clean agcc-clean
diff --git a/translate/gcc/Make-lang.in b/translate/gcc/Make-lang.in
index f3d5f98f8..310f01a9e 100644
--- a/translate/gcc/Make-lang.in
+++ b/translate/gcc/Make-lang.in
@@ -62,25 +62,24 @@ vhdl VHDL: ghdl1$(exeext) ghdl$(exeext) ghdllib
# Tell GNU Make to ignore these, if they exist.
.PHONY: vhdl VHDL ghdllib
-agcc_srcdir=$(srcdir)/vhdl
-agcc_objdir=.
+#ortho-lang.o: $(agcc_srcdir)/ortho-lang.c \
+# $(AGCC_GCCOBJ_DIR)gcc/gtype-vhdl.h \
+# $(AGCC_GCCOBJ_DIR)gcc/gt-vhdl-ortho-lang.h
+# $(COMPILER) -c -o $@ $< $(AGCC_CFLAGS) $(INCLUDES)
-AGCC_GCCSRC_DIR=$(srcdir)/..
-AGCC_GCCOBJ_DIR=../
-
-####gcc Makefile.inc
+GHDL1_OBJS = attribs.o vhdl/ortho-lang.o
# The compiler proper.
# It is compiled into the vhdl/ subdirectory to avoid file name clashes but
# linked in in gcc directory to be able to access to gcc object files.
-ghdl1$(exeext): $(AGCC_OBJS) $(AGCC_DEPS) force $(BACKEND) $(LIBDEPS)
+ghdl1$(exeext): force $(GHDL1_OBJS) $(BACKEND) $(LIBDEPS)
CURDIR=`pwd`; cd $(srcdir)/vhdl; VHDLSRCDIR=`pwd`; cd $$CURDIR/vhdl; \
$(GNATMAKE) -c -aI$$VHDLSRCDIR ortho_gcc-main \
-cargs $(CFLAGS) $(GHDL_ADAFLAGS)
$(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \
-bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
- -largs $(AGCC_OBJS) $(filter-out main.o,$(BACKEND)) \
- $(LIBS) $(BACKENDLIBS) -lstdc++
+ -largs --LINK=$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GHDL1_OBJS) \
+ $(filter-out main.o,$(BACKEND)) $(LIBS) $(BACKENDLIBS)
# The driver for ghdl.
ghdl$(exeext): force
@@ -159,7 +158,8 @@ vhdl.uninstall:
vhdl.mostlyclean:
-$(RM) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c
-vhdl.clean: agcc-clean
+vhdl.clean:
+ -$(RM) vhdl/*$(objext)
vhdl.distclean:
-$(RM) vhdl/Makefile
-$(RM) ghdl$(exeext)
diff --git a/translate/gcc/dist.sh b/translate/gcc/dist.sh
index e709a6448..c0152d062 100755
--- a/translate/gcc/dist.sh
+++ b/translate/gcc/dist.sh
@@ -91,8 +91,7 @@ do_Makefile ()
sed -e "/^####libraries Makefile.inc/r ../../libraries/Makefile.inc" \
-e "/^####grt Makefile.inc/r ../grt/Makefile.inc" \
< Makefile.in > $VHDLDIR/Makefile.in
- sed -e "/^####gcc Makefile.inc/r ../../ortho/gcc/Makefile.inc" \
- < Make-lang.in > $VHDLDIR/Make-lang.in
+ cp Make-lang.in $VHDLDIR/Make-lang.in
}
# Copy (or link) sources files into $VHDLDIR
@@ -185,27 +184,27 @@ do_compile ()
cd $GCCDISTOBJ
export CFLAGS="-O -g"
- case x86 in
- x86)
+ case $MACHINE in
+ i?86-*-linux*)
BUILD=i686-pc-linux-gnu
# gmp location (mpfr and mpc are supposed to be at the same place)
CONFIG_LIBS="--with-gmp=$PWD/../build"
;;
- x86-64)
+ x86_64-*-linux*)
BUILD=x86_64-pc-linux-gnu
CONFIG_LIBS=""
;;
- darwin)
+ x86_64-*-darwin*)
BUILD=x86_64-apple-darwin10.7
- CONFIG_LIBS="--with-gmp=$HOME/local"
+ CONFIG_LIBS="--with-gmp=$HOME/local --with-stage1-ldflags="
;;
*)
exit 1
;;
esac
- ../gcc-$GCCVERSION/configure --enable-languages=vhdl --prefix=$PREFIX --disable-bootstrap --with-bugurl="<URL:http://gna.org/projects/ghdl>" --build=$BUILD $CONFIG_LIBS --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp
+ ../gcc-$GCCVERSION/configure --enable-languages=vhdl --prefix=$PREFIX --disable-bootstrap --with-bugurl="<URL:http://gna.org/projects/ghdl>" --build=$BUILD $CONFIG_LIBS --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmatch --disable-libdecnumber
- make
+ make -j4
make -C gcc vhdl.info
cd $CWD
}
@@ -219,7 +218,7 @@ do_recompile ()
do_update_gcc_sources;
cd $GCCDISTOBJ
export CFLAGS="-O -g"
- make
+ make -j4
}
check_root ()