summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in66
-rw-r--r--README18
-rw-r--r--dist/gcc/Makefile.in1
-rw-r--r--libraries/Makefile.inc18
4 files changed, 55 insertions, 48 deletions
diff --git a/Makefile.in b/Makefile.in
index 900b380..0654abe 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -76,7 +76,7 @@ Makefile: $(srcdir)/Makefile.in
#################### For mcode backend ##############################
-all.mcode: ghdl.mcode libs.vhdl.mcode
+all.mcode: ghdl_mcode libs.vhdl.mcode
GRTSRCDIR=$(srcdir)/src/grt
include $(GRTSRCDIR)/Makefile.inc
@@ -85,15 +85,33 @@ GHDL_COMMON_INCFLAGS=-aI$(srcdir)/src -aI$(srcdir)/src/vhdl -aI$(srcdir)/src/psl
GHDL_MCODE_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/grt -aI$(srcdir)/src/ortho/mcode
-ghdl.mcode: GRT_FLAGS+=-DWITH_GNAT_RUN_TIME
-ghdl.mcode: $(GRT_ADD_OBJS) $(ORTHO_DEPS) memsegs_c.o chkstk.o force
- $(GNATMAKE) -o ghdl $(GHDL_MCODE_INCFLAGS) $(GNATFLAGS) ghdl_jit.adb $(GNAT_BARGS) -largs memsegs_c.o chkstk.o $(GNAT_LARGS) $(GRT_ADD_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB))
-
-.PHONY: ghdl.mcode
+ghdl_mcode: GRT_FLAGS+=-DWITH_GNAT_RUN_TIME
+ghdl_mcode: $(GRT_ADD_OBJS) $(ORTHO_DEPS) memsegs_c.o chkstk.o force
+ $(GNATMAKE) -o $@ $(GHDL_MCODE_INCFLAGS) $(GNATFLAGS) ghdl_jit.adb $(GNAT_BARGS) -largs memsegs_c.o chkstk.o $(GNAT_LARGS) $(GRT_ADD_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB))
memsegs_c.o: $(srcdir)/src/ortho/mcode/memsegs_c.c
$(CC) -c -g -o $@ $<
+libs.vhdl.mcode: libs.vhdl.all
+
+install.vhdl.mcode: install.dirs #libs.vhdl.mcode
+# Copy libraries and relocate source files.
+ for d in v08/ieee v08/std v87/ieee v87/std v87/synopsys \
+ v93/ieee v93/mentor v93/std v93/synopsys; do \
+ $(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
+ $(INSTALL_DATA) -p \
+ $(libdirsuffix)/$$d/* $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
+ for c in $(libdirsuffix)/$$d/*.cf; do \
+ $(SED) -e '/file/s@".*/libraries@"../../src@g' \
+ < $$c > $(DESTDIR)$(prefix)/$$c; \
+ done; \
+ done
+
+install.mcode.program: install.dirs ghdl_mcode
+ $(INSTALL_PROGRAM) ghdl_mcode $(DESTDIR)$(bindir)/ghdl
+
+install.mcode: install.mcode.program install.vhdl.srcs install.vhdl.mcode
+
#################### For gcc backend ##############################
gcc_vhdl_dir=$(gcc_src_dir)/gcc/vhdl
@@ -144,6 +162,10 @@ ghdl_gcc: force
grt.links:
cd $(libdirsuffix); ln -sf $(libdirreverse)/grt.lst .; ln -sf $(libdirreverse)/libgrt.a .; ln -sf $(libdirreverse)/grt.ver .
+libs.vhdl.gcc: ghdl_gcc ghdl1-gcc
+ $(MAKE) GHDL=ghdl_gcc libs.vhdl.all
+ $(MAKE) GHDL1=./ghdl1-gcc libs.vhdl.standard
+
#################### For llvm backend ##############################
LLVM_CONFIG=$(llvm_prefix)/bin/llvm-config
@@ -182,8 +204,9 @@ LIB08_DIR:=$(libdirsuffix)/v08
LIBSRC_DIR:=$(srcdir)/libraries
REL_DIR:=$(libdirreverse)/../..
-GHDL=ghdl
+GHDL=ghdl_$(backend)
ANALYZE:=$(REL_DIR)/$(GHDL) -a $(LIB_CFLAGS)
+ANALYZE_DEP:=$(GHDL)
$(LIB87_DIR) $(LIB93_DIR) $(LIB08_DIR):
[ -d $(libdirsuffix) ] || mkdir -p $(libdirsuffix)
@@ -231,12 +254,6 @@ libs.vhdl.standard: $(LIB93_DIR)/std/std_standard.o \
$(LIB87_DIR)/std/std_standard.o \
$(LIB08_DIR)/std/std_standard.o
-libs.vhdl.gcc:
- $(MAKE) GHDL=ghdl_gcc libs.vhdl.all
- $(MAKE) GHDL1=./ghdl1-gcc libs.vhdl.standard
-
-libs.vhdl.mcode: libs.vhdl.all
-
libs.vhdl.simul:
$(MAKE) GHDL=ghdl_simul libs.vhdl.all
@@ -284,30 +301,13 @@ install.vhdl.srcs:
$(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee2008; \
done
-install.vhdl.mcode: install.dirs #libs.vhdl.mcode
-# Copy libraries and relocate source files.
- for d in v08/ieee v08/std v87/ieee v87/std v87/synopsys \
- v93/ieee v93/mentor v93/std v93/synopsys; do \
- $(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
- $(INSTALL_DATA) -p \
- $(libdirsuffix)/$$d/* $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
- for c in $(libdirsuffix)/$$d/*.cf; do \
- $(SED) -e '/file/s@".*/libraries@"../../src@g' \
- < $$c > $(DESTDIR)$(prefix)/$$c; \
- done; \
- done
-
-install.program: install.dirs ghdl.mcode
- $(INSTALL_PROGRAM) ghdl $(DESTDIR)$(bindir)
-
-install.mcode: install.program install.vhdl.srcs install.vhdl.mcode
-
####################### clean ############################################
clean: force
$(RM) -f *.o *.ali b~*.ad? *~ *.d b__*.ad? *.a *.deps *.bexch
- $(RM) -f ghdl_gcc ghdl_mcode ghdl_llvm ghdl_llvm_jit ghdl_simul
- $(RM) -f ghdl1-gcc run-bind.ad? grt.lst grt-files grt-files.in
+ $(RM) -f ghdl_gcc ghdl_mcode ghdl ghdl_llvm ghdl_llvm_jit ghdl_simul
+ $(RM) -f ghdl1-gcc ghdl1-llvm
+ $(RM) -f run-bind.ad? grt.lst grt-files grt-files.in
$(RM) -rf lib
distclean: clean
diff --git a/README b/README
index 4c34319..0246d96 100644
--- a/README
+++ b/README
@@ -15,8 +15,8 @@ You need GNAT for x86 (32 bits). See below for instructions
$ ./configure
$ make
-At that place, you can already use the 'ghdl' built in the directory.
-You can also install it:
+At that place, you can already use the 'ghdl_mcode' built in the directory.
+You can also install GHDL (the executable is installed as 'ghdl'):
$ make install
That's all!
@@ -58,16 +58,20 @@ As GCC is written in Ada, you need to use the GNU Ada compiler (GNAT).
I recommend to use GNAT GPL from http://libre.adacore.com (free).
If you build with the mcode backend, you need an i386 version of GNAT.
-* Building with mcode backend.
+Building with mcode backend
+***************************
+
This is as simple as:
$ ./configure --prefix=PREFIX
where PREFIX is the directory for installation
$ make
- This builds the ghdl executable, which can be used as is.
+ This builds the ghdl_mcode executable, which can be used as is.
$ make install
To install within PREFIX
-* Building with the gcc backend
+Building with the gcc backend
+*****************************
+
You need to download and untar the sources of
gcc version 4.9.2 [do not modify this line as this is read by scripts].
@@ -77,7 +81,9 @@ $ ./configure --with-gcc=/path/to/gcc/source/dir
The configure gcc following the gcc instructions and also enable vhdl
languages (you can use --enable-languages=c,vhdl --disable-bootstrap)
-* Building with the llvm backend
+Building with the llvm backend
+******************************
+
You need llvm 3.5
First configure ghdl and specify where llvm is installed
diff --git a/dist/gcc/Makefile.in b/dist/gcc/Makefile.in
index 13f3296..6c5fffd 100644
--- a/dist/gcc/Makefile.in
+++ b/dist/gcc/Makefile.in
@@ -204,6 +204,7 @@ LIB93_DIR:=./lib/v93
LIB08_DIR:=./lib/v08
LIBSRC_DIR:=$(srcdir)/libraries
ANALYZE=../ghdl -a --GHDL1=../ghdl1 --ieee=none
+ANALYZE_DEP:=../ghdl
$(LIB93_DIR) $(LIB87_DIR):
$(srcdir)/../../mkinstalldirs $@
diff --git a/libraries/Makefile.inc b/libraries/Makefile.inc
index 67a2dff..fbb14a4 100644
--- a/libraries/Makefile.inc
+++ b/libraries/Makefile.inc
@@ -111,7 +111,7 @@ MENTOR93_SRCS=$(addprefix $(LIBSRC_DIR)/,$(MENTOR93_BSRCS))
VITAL95_SRCS=$(addprefix $(LIBSRC_DIR)/,$(VITAL95_BSRCS))
VITAL2000_SRCS=$(addprefix $(LIBSRC_DIR)/,$(VITAL2000_BSRCS))
-std.v93: $(LIB93_DIR) $(STD93_SRCS) force
+std.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(STD93_SRCS) force
$(RM) -rf $(STD93_DIR)
mkdir $(STD93_DIR)
prev=`pwd`; cd $(STD93_DIR); \
@@ -123,7 +123,7 @@ std.v93: $(LIB93_DIR) $(STD93_SRCS) force
ANALYZE_IEEE93=$(ANALYZE93) -P../std --work=ieee
-ieee.v93: $(LIB93_DIR) $(IEEE93_SRCS) force
+ieee.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(IEEE93_SRCS) std.v93 force
$(RM) -rf $(IEEE93_DIR)
mkdir $(IEEE93_DIR)
prev=`pwd`; cd $(IEEE93_DIR); \
@@ -133,7 +133,7 @@ ieee.v93: $(LIB93_DIR) $(IEEE93_SRCS) force
done; \
cd $$prev
-synopsys.v93: $(LIB93_DIR) $(SYNOPSYS_SRCS) force
+synopsys.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(SYNOPSYS_SRCS) ieee.v93 force
$(RM) -rf $(SYN93_DIR)
mkdir $(SYN93_DIR)
prev=`pwd`; cd $(SYN93_DIR); \
@@ -151,7 +151,7 @@ synopsys.v93: $(LIB93_DIR) $(SYNOPSYS_SRCS) force
done; \
cd $$prev
-mentor.v93: $(LIB93_DIR) $(MENTOR93_SRCS) force
+mentor.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(MENTOR93_SRCS) ieee.v93 force
$(RM) -rf $(MENTOR93_DIR)
mkdir $(MENTOR93_DIR)
prev=`pwd`; cd $(MENTOR93_DIR); \
@@ -168,7 +168,7 @@ mentor.v93: $(LIB93_DIR) $(MENTOR93_SRCS) force
echo $$cmd; eval $$cmd || exit 1; \
done
-std.v87: $(LIB87_DIR) $(STD87_SRCS) force
+std.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(STD87_SRCS) force
$(RM) -rf $(STD87_DIR)
mkdir $(STD87_DIR)
prev=`pwd`; cd $(STD87_DIR); \
@@ -180,7 +180,7 @@ std.v87: $(LIB87_DIR) $(STD87_SRCS) force
ANALYZE_IEEE87=$(ANALYZE87) -P../std --work=ieee
-ieee.v87: $(LIB87_DIR) $(IEEE87_SRCS) force
+ieee.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(IEEE87_SRCS) std.v87 force
$(RM) -rf $(IEEE87_DIR)
mkdir $(IEEE87_DIR)
prev=`pwd`; cd $(IEEE87_DIR); \
@@ -190,7 +190,7 @@ ieee.v87: $(LIB87_DIR) $(IEEE87_SRCS) force
done; \
cd $$prev
-synopsys.v87: $(LIB87_DIR) $(SYNOPSYS_SRCS) force
+synopsys.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(SYNOPSYS_SRCS) ieee.v87 force
$(RM) -rf $(SYN87_DIR)
mkdir $(SYN87_DIR)
prev=`pwd`; cd $(SYN87_DIR); \
@@ -208,7 +208,7 @@ synopsys.v87: $(LIB87_DIR) $(SYNOPSYS_SRCS) force
done; \
cd $$prev
-std.v08: $(LIB08_DIR) $(STD08_SRCS) force
+std.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(STD08_SRCS) force
$(RM) -rf $(STD08_DIR)
mkdir $(STD08_DIR)
prev=`pwd`; cd $(STD08_DIR); \
@@ -220,7 +220,7 @@ std.v08: $(LIB08_DIR) $(STD08_SRCS) force
ANALYZE_IEEE08=$(ANALYZE08) -P../std --work=ieee
-ieee.v08: $(LIB08_DIR) $(IEEE08_SRCS) force
+ieee.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(IEEE08_SRCS) std.v08 force
$(RM) -rf $(IEEE08_DIR)
mkdir $(IEEE08_DIR)
# FIXME: add VITAL2000 ?