aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in101
-rw-r--r--dist/gcc/Make-lang.in14
-rw-r--r--dist/gcc/Makefile.in93
-rw-r--r--libraries/Makefile.inc212
4 files changed, 185 insertions, 235 deletions
diff --git a/Makefile.in b/Makefile.in
index ba2f7be54..af1d22e36 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -92,25 +92,12 @@ ghdl_mcode: $(GRT_ADD_OBJS) $(ORTHO_DEPS) memsegs_c.o chkstk.o force
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
+libs.vhdl.mcode: vhdl.libs.all
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
+install.mcode: install.mcode.program install.vhdllib
#################### For gcc backend ##############################
@@ -162,7 +149,7 @@ 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) GHDL=ghdl_gcc vhdl.libs.all
$(MAKE) GHDL1=./ghdl1-gcc libs.vhdl.standard
ghdl1-debug: force
@@ -194,10 +181,10 @@ llvm-cbindings.o: $(srcdir)/src/ortho/llvm/llvm-cbindings.cpp
$(CXX) -c -m64 `$(LLVM_CONFIG) --includedir --cxxflags` -g -o $@ $<
libs.vhdl.llvmjit:
- $(MAKE) GHDL=ghdl_llvm_jit libs.vhdl.all
+ $(MAKE) GHDL=ghdl_llvm_jit vhdl.libs.all
libs.vhdl.llvm:
- $(MAKE) GHDL=ghdl_llvm libs.vhdl.all
+ $(MAKE) GHDL=ghdl_llvm vhdl.libs.all
$(MAKE) GHDL1=./ghdl1-llvm libs.vhdl.standard
ghdl_llvm: force
@@ -221,47 +208,29 @@ install.grt.llvm: libgrt.a grt.lst install.dirs
$(INSTALL_DATA) grt.lst $(DESTDIR)$(VHDL_LIB_DIR)/grt.lst
$(INSTALL_DATA) $(GRTSRCDIR)/grt.ver $(DESTDIR)$(VHDL_LIB_DIR)/grt.ver
-install.vhdl.llvm: 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.llvm.program: install.dirs ghdl1-llvm ghdl_llvm
$(INSTALL_PROGRAM) ghdl_llvm $(DESTDIR)$(bindir)/ghdl
$(INSTALL_PROGRAM) ghdl1-llvm $(DESTDIR)$(bindir)/ghdl1-llvm
-install.llvm: install.llvm.program install.vhdl.srcs \
- install.grt.llvm install.vhdl.llvm
+install.llvm: install.llvm.program install.vhdllib install.grt.llvm
################ For simul (no code generation, interpretation) ##########
ghdl_simul: $(GRT_ADD_OBJS) force
$(GNATMAKE) -aI../../simulate $(GNATFLAGS) ghdl_simul $(GNAT_BARGS) -largs $(GNAT_LARGS) $(GRT_ADD_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB))
-################ Libraries ###############################################
+libs.vhdl.simul:
+ $(MAKE) GHDL=ghdl_simul vhdl.libs.all
-LIB87_DIR:=$(libdirsuffix)/v87
-LIB93_DIR:=$(libdirsuffix)/v93
-LIB08_DIR:=$(libdirsuffix)/v08
+################ Libraries ###############################################
LIBSRC_DIR:=$(srcdir)/libraries
-REL_DIR:=$(libdirreverse)/../..
+LIBDST_DIR:=$(libdirsuffix)
+
GHDL=ghdl_$(backend)
-ANALYZE:=$(REL_DIR)/$(GHDL) -a $(LIB_CFLAGS)
+ANALYZE:=$(libdirreverse)/../../$(GHDL) -a $(LIB_CFLAGS)
ANALYZE_DEP:=$(GHDL)
-$(LIB87_DIR) $(LIB93_DIR) $(LIB08_DIR):
- [ -d $(libdirsuffix) ] || mkdir -p $(libdirsuffix)
- [ -d $@ ] || mkdir $@
-
include $(srcdir)/libraries/Makefile.inc
GHDL1=./ghdl1-gcc
@@ -295,53 +264,19 @@ else
$(RM) std_standard_08.s
endif
-libs.vhdl.v93: std.v93 ieee.v93 synopsys.v93 mentor.v93
-libs.vhdl.v87: std.v87 ieee.v87 synopsys.v87
-libs.vhdl.v08: std.v08 ieee.v08
-libs.vhdl.all: libs.vhdl.v87 libs.vhdl.v93 libs.vhdl.v08
-
libs.vhdl.standard: $(LIB93_DIR)/std/std_standard.o \
$(LIB87_DIR)/std/std_standard.o \
$(LIB08_DIR)/std/std_standard.o
-libs.vhdl.simul:
- $(MAKE) GHDL=ghdl_simul libs.vhdl.all
-
install.dirs:
[ -d $(DESTDIR)$(prefix) ] || $(MKDIR) -p $(DESTDIR)$(prefix)
[ -d $(DESTDIR)$(bindir) ] || $(MKDIR) -p $(DESTDIR)$(bindir)
-install.vhdl.srcs:
-# Install VHDL sources.
- $(RM) -rf $(DESTDIR)$(VHDL_LIB_DIR)/src
- $(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/src
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/std
- for i in $(STD93_SRCS) $(STD87_SRCS) $(STD08_SRCS); do \
- $(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/std; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee
- for i in $(IEEE93_SRCS) $(IEEE87_SRCS); do \
- $(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/vital95
- for i in $(VITAL95_SRCS); do \
- $(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/vital95; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/vital2000
- for i in $(VITAL2000_SRCS); do \
- $(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/vital2000; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/synopsys
- for i in $(SYNOPSYS_SRCS); do \
- $(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/synopsys; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/mentor
- for i in $(MENTOR93_SRCS); do \
- $(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/mentor; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee2008
- for i in $(IEEE08_SRCS); do \
- $(INSTALL_DATA) -p $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee2008; \
+install.vhdllib: install.dirs
+ for d in $(VHDLLIB_SUBDIRS); do \
+ $(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
+ $(INSTALL_DATA) -p \
+ $(LIBDST_DIR)/$$d/* $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
done
####################### clean ############################################
@@ -349,7 +284,7 @@ install.vhdl.srcs:
clean: force
$(RM) -f *.o *.ali b~*.ad? *~ *.d b__*.ad? *.a *.deps *.bexch
$(RM) -f ghdl_gcc ghdl_mcode ghdl ghdl_llvm ghdl_llvm_jit ghdl_simul
- $(RM) -f ghdl1-gcc ghdl1-llvm
+ $(RM) -f ghdl1-gcc ghdl1-llvm ghdl1-debug
$(RM) -f run-bind.ad? grt.lst grt-files grt-files.in
$(RM) -rf lib
diff --git a/dist/gcc/Make-lang.in b/dist/gcc/Make-lang.in
index 8b83c35d6..701a51714 100644
--- a/dist/gcc/Make-lang.in
+++ b/dist/gcc/Make-lang.in
@@ -46,6 +46,7 @@ GNATBIND = gnatbind
GNATMAKE = gnatmake
VHDL_FLAGS_TO_PASS = \
"GHDL_ADAFLAGS=$(GHDL_ADAFLAGS)" \
+ "GRT_FLAGS=-O -g" \
"GNATMAKE=$(GNATMAKE)" \
"GNATBIND=$(GNATBIND)" \
"CFLAGS=$(CFLAGS)" \
@@ -54,7 +55,9 @@ VHDL_FLAGS_TO_PASS = \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"libexecsubdir=$(libexecsubdir)"
-MAKE_IN_VHDL=$(MAKE) -C vhdl $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS)
+# Command to run the Makefile in vhdl subdir. Don't forget the dependency on
+# vhdl/Makefile
+MAKE_IN_VHDL=$(MAKE) -C vhdl $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS) ADAC="$(CC)" CC="$(CC)"
# Define the names for selecting vhdl in LANGUAGES.
vhdl VHDL: ghdl1$(exeext) ghdl$(exeext) ghdllib
@@ -104,7 +107,7 @@ vhdl/default_pathes.ads: Makefile
echo " Compiler_Llvm : constant String := \"\";" >> tmp-dpathes.ads
echo " Post_Processor : constant String := \"\";" >> tmp-dpathes.ads
echo " Lib_Prefix : constant String :=">> tmp-dpathes.ads
- echo " \"lib/gcc/$(target_noncanonical)/$(version)/vhdl/lib/\";" >> tmp-dpathes.ads
+ echo " \"lib/gcc/$(target_noncanonical)/$(version)/vhdl/\";" >> tmp-dpathes.ads
echo "end Default_Pathes;" >> tmp-dpathes.ads
$(srcdir)/../move-if-change tmp-dpathes.ads $@
@@ -116,8 +119,7 @@ ghdl$(exeext): ghdl1$(exeext) vhdl/default_pathes.ads force
# Ghdl libraries.
ghdllib: ghdl$(exeext) ghdl1$(exeext) $(GCC_PASSES) vhdl/Makefile force
- $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" $(FLAGS_TO_PASS) \
- ADAC=$(COMPILER_FOR_BUILD) ghdllib
+ $(MAKE_IN_VHDL) ghdllib
vhdl/Makefile: config.status $(srcdir)/vhdl/Makefile.in
CONFIG_HEADERS= CONFIG_LINKS= CONFIG_COMMANDS= \
@@ -169,8 +171,8 @@ install-info:: $(DESTDIR)$(infodir)/ghdl.info
vhdl.install-info: $(DESTDIR)$(infodir)/ghdl.info
-install-ghdllib:
- $(MAKE) -f vhdl/Makefile $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS) install-ghdllib
+install-ghdllib: ghdl$(exeext) ghdl1$(exeext) vhdl/Makefile
+ $(MAKE_IN_VHDL) install-ghdllib
vhdl.install-man: $(DESTDIR)$(man1dir)/ghdl$(man1ext)
diff --git a/dist/gcc/Makefile.in b/dist/gcc/Makefile.in
index ad8a3bfd6..2d1cdc761 100644
--- a/dist/gcc/Makefile.in
+++ b/dist/gcc/Makefile.in
@@ -161,34 +161,29 @@ clean: grt-clean ghdllibs-clean force
# Additionnal rules
-LIB87_DIR:=./lib/v87
-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 $@
+LIBDST_DIR:=lib
+ANALYZE=../../../../ghdl -a --GHDL1=./ghdl1 --ieee=none $(LIB_CFLAGS)
+ANALYZE_DEP:=
####libraries Makefile.inc
std87_standard.o: $(GHDL1)
- $(GHDL1) --std=87 -quiet -o std_standard.s --compile-standard
- ../xgcc -c -o std_standard.o std_standard.s
- $(MV) std_standard.o $@
+ $(GHDL1) --std=87 -quiet -o std87_standard.s --compile-standard
+ ../xgcc -c -o $@ std87_standard.s
+ $(RM) -f std87_standard.s
std93_standard.o: $(GHDL1)
- $(GHDL1) --std=93 -quiet -o std_standard.s --compile-standard
- ../xgcc -c -o std_standard.o std_standard.s
- $(MV) std_standard.o $@
+ $(GHDL1) --std=93 -quiet -o std93_standard.s --compile-standard
+ ../xgcc -c -o $@ std93_standard.s
+ $(RM) -f std93_standard.s
std08_standard.o: $(GHDL1)
- $(GHDL1) --std=08 -quiet -o std_standard.s --compile-standard
- ../xgcc -c -o std_standard.o std_standard.s
- $(MV) std_standard.o $@
+ $(GHDL1) --std=08 -quiet -o std08_standard.s --compile-standard
+ ../xgcc -c -o $@ std08_standard.s
+ $(RM) -f std08_standard.s
-ghdllib: std87_standard.o std93_standard.o std08_standard.o libgrt.a
+ghdllib: libgrt.a std87_standard.o std93_standard.o std08_standard.o vhdl.libs.all
ghdllibs-clean: force
$(RM) -rf $(LIB87_DIR) $(LIB93_DIR) $(LIB08_DIR)
@@ -201,63 +196,23 @@ GRT_RANLIB=$(RANLIB)
####grt Makefile.inc
-install-ghdllib: ghdllib grt.lst $(STD93_SRCS) $(STD87_SRCS) \
- $(IEEE93_SRCS) $(IEEE87_SRCS) $(SYNOPSYS_SRCS) \
- $(STD08_SRCS) $(IEEE08_SRCS)
+install-ghdllib: ghdllib grt.lst
$(RM) -rf $(DESTDIR)$(VHDL_LIB_DIR)
$(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)
# Install libgrt
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/lib
- $(INSTALL_DATA) libgrt.a $(DESTDIR)$(VHDL_LIB_DIR)/lib/libgrt.a
- $(INSTALL_DATA) grt.lst $(DESTDIR)$(VHDL_LIB_DIR)/lib/grt.lst
- $(INSTALL_DATA) $(GRTSRCDIR)/grt.ver $(DESTDIR)$(VHDL_LIB_DIR)/lib/grt.ver
+ $(INSTALL_DATA) libgrt.a $(DESTDIR)$(VHDL_LIB_DIR)/libgrt.a
+ $(INSTALL_DATA) grt.lst $(DESTDIR)$(VHDL_LIB_DIR)/grt.lst
+ $(INSTALL_DATA) $(GRTSRCDIR)/grt.ver $(DESTDIR)$(VHDL_LIB_DIR)/grt.ver
# Install VHDL sources.
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/std
- for i in $(STD93_SRCS) $(STD87_SRCS) $(STD08_SRCS); do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/std; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee
- for i in $(IEEE93_SRCS) $(IEEE87_SRCS); do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/vital95
- for i in $(VITAL95_SRCS); do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/vital95; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/vital2000
- for i in $(VITAL2000_SRCS); do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/vital2000; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/synopsys
- for i in $(SYNOPSYS_SRCS); do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/synopsys; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/mentor
- for i in $(MENTOR93_SRCS); do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/mentor; \
- done
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee2008
- for i in $(IEEE08_SRCS); do \
- $(INSTALL_DATA) $$i $(DESTDIR)$(VHDL_LIB_DIR)/src/ieee2008; \
+ for d in $(VHDLLIB_SUBDIRS); do \
+ $(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
+ $(INSTALL_DATA) -p \
+ $(LIBDST_DIR)/$$d/* $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \
done
-# Create library dirs
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/lib/v93
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/lib/v87
- $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)/lib/v08
-# Compile in place.
- PDIR=`pwd` && cd $(DESTDIR)$(VHDL_LIB_DIR) && \
- $(MAKE) -f $$PDIR/Makefile REL_DIR=../../.. LIBSRC_DIR="src" \
- LIB93_DIR=lib/v93 LIB87_DIR=lib/v87 LIB08_DIR=lib/v08 \
- ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none" \
- ANALYZE_DEP="$$PDIR/../ghdl1" \
- std.v87 ieee.v87 synopsys.v87 \
- std.v93 ieee.v93 synopsys.v93 mentor.v93 \
- std.v08 ieee.v08
# Copy std_standard (this is done after libraries, since they remove dirs).
$(INSTALL_DATA) std87_standard.o \
- $(DESTDIR)$(VHDL_LIB_DIR)/lib/v87/std/std_standard.o
+ $(DESTDIR)$(VHDL_LIB_DIR)/v87/std/std_standard.o
$(INSTALL_DATA) std93_standard.o \
- $(DESTDIR)$(VHDL_LIB_DIR)/lib/v93/std/std_standard.o
+ $(DESTDIR)$(VHDL_LIB_DIR)/v93/std/std_standard.o
$(INSTALL_DATA) std08_standard.o \
- $(DESTDIR)$(VHDL_LIB_DIR)/lib/v08/std/std_standard.o
+ $(DESTDIR)$(VHDL_LIB_DIR)/v08/std/std_standard.o
diff --git a/libraries/Makefile.inc b/libraries/Makefile.inc
index fbb14a402..f12c02338 100644
--- a/libraries/Makefile.inc
+++ b/libraries/Makefile.inc
@@ -17,18 +17,23 @@
# 02111-1307, USA.
# Variable to be defined:
-# LIB08_DIR
-# LIB93_DIR
-# LIB87_DIR
-# REL_DIR
-# LIBSRC_DIR
+# LIBSRC_DIR: path to the libraries sources
+# LIBDST_DIR: path to the build/destination dir.
# ANALYZE
# LN
# CP
-# VHDLLIBS_COPY_OBJS
-#
-# Note: the source files are analyzed in the LIBxx_DIR. So LIBSRC_DIR must be
-# relative to the target directory.
+# VHDLLIBS_COPY_OBJS: must be set to 'no' for jit
+
+vhdl.libs.all: vhdl.libs.v87 vhdl.libs.v93 vhdl.libs.v08
+
+vhdl.libs.v93: std.v93 ieee.v93 synopsys.v93 mentor.v93
+vhdl.libs.v87: std.v87 ieee.v87 synopsys.v87
+vhdl.libs.v08: std.v08 ieee.v08
+
+VHDLLIB_SUBDIRS= src/std src/ieee src/vital95 src/vital2000 src/synopsys src/mentor src/ieee2008 \
+ v87/std v87/ieee v87/synopsys \
+ v93/std v93/ieee v93/mentor v93/synopsys \
+ v08/std v08/ieee v08/std \
STD_SRCS := std/textio.vhdl std/textio_body.vhdl
IEEE_SRCS := ieee/std_logic_1164.vhdl ieee/std_logic_1164_body.vhdl \
@@ -72,26 +77,26 @@ MENTOR93_BSRCS := $(MENTOR_BSRCS)
.PREFIXES: .vhdl .v93 .v87 .v08
-%.v93: %.vhdl
- sed -e '/--V87/s/^/ --/' \
- -e '/--START-V08/,/--END-V08/s/^/--/' < $< > $@
+SED_V93 := sed -e '/--V87/s/^/ --/' \
+ -e '/--START-V08/,/--END-V08/s/^/--/'
-%.v08: %.vhdl
- sed -e '/--V87/s/^/ --/' < $< > $@
+SED_V87 := sed -e '/--V93/s/^/ --/' -e '/--START-V93/,/--END-V93/s/^/--/' \
+ -e '/--START-V08/,/--END-V08/s/^/--/'
-%.v87: %.vhdl
- sed -e '/--V93/s/^/ --/' -e '/--START-V93/,/--END-V93/s/^/--/' \
- -e '/--START-V08/,/--END-V08/s/^/--/' < $< > $@
+SED_V08 := sed -e '/--V87/s/^/ --/'
+LIB87_DIR:=$(LIBDST_DIR)/v87
STD87_DIR:=$(LIB87_DIR)/std
IEEE87_DIR:=$(LIB87_DIR)/ieee
SYN87_DIR:=$(LIB87_DIR)/synopsys
+LIB93_DIR:=$(LIBDST_DIR)/v93
STD93_DIR:=$(LIB93_DIR)/std
IEEE93_DIR:=$(LIB93_DIR)/ieee
SYN93_DIR:=$(LIB93_DIR)/synopsys
MENTOR93_DIR:=$(LIB93_DIR)/mentor
+LIB08_DIR:=$(LIBDST_DIR)/v08
STD08_DIR:=$(LIB08_DIR)/std
IEEE08_DIR:=$(LIB08_DIR)/ieee
@@ -99,41 +104,117 @@ ANALYZE87:=$(ANALYZE) --std=87
ANALYZE93:=$(ANALYZE) --std=93
ANALYZE08:=$(ANALYZE) --std=08
-STD87_SRCS=$(addprefix $(LIBSRC_DIR)/,$(STD87_BSRCS))
-STD93_SRCS=$(addprefix $(LIBSRC_DIR)/,$(STD93_BSRCS))
-STD08_SRCS=$(addprefix $(LIBSRC_DIR)/,$(STD08_BSRCS))
+STD87_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(STD87_BSRCS))
+STD93_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(STD93_BSRCS))
+STD08_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(STD08_BSRCS))
+
+IEEE93_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(IEEE93_BSRCS))
+IEEE87_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(IEEE87_BSRCS))
+IEEE08_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(IEEE08_BSRCS))
+SYNOPSYS_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(SYNOPSYS_BSRCS))
+MENTOR93_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(MENTOR93_BSRCS))
+VITAL95_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(VITAL95_BSRCS))
+VITAL2000_SRCS=$(addprefix $(LIBDST_DIR)/src/,$(VITAL2000_BSRCS))
+
+$(LIBDST_DIR)/src/std $(LIBDST_DIR)/src/ieee $(LIBDST_DIR)/src/ieee2008 $(LIBDST_DIR)/src/vital95 $(LIBDST_DIR)/src/vital2000 $(LIBDST_DIR)/src/synopsys $(LIBDST_DIR)/src/mentor:
+ -mkdir -p $@
+
+### V87 ###############################################################
+
+$(LIB87_DIR):
+ mkdir -p $@
+
+$(LIBDST_DIR)/src/std/%.v87: $(LIBSRC_DIR)/std/%.vhdl
+ $(SED_V87) < $< > $@
+
+std.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(LIBDST_DIR)/src/std $(STD87_SRCS) force
+ $(RM) -rf $(STD87_DIR)
+ mkdir $(STD87_DIR)
+ prev=`pwd`; cd $(STD87_DIR); \
+ for i in $(STD87_BSRCS); do \
+ cmd="$(ANALYZE87) --bootstrap --work=std ../../src/$$i"; \
+ echo $$cmd; eval $$cmd || exit 1; \
+ done; \
+ cd $$prev
+
+$(LIBDST_DIR)/src/ieee/%.v87: $(LIBSRC_DIR)/ieee/%.vhdl
+ $(SED_V87) < $< > $@
-IEEE93_SRCS=$(addprefix $(LIBSRC_DIR)/,$(IEEE93_BSRCS))
-IEEE87_SRCS=$(addprefix $(LIBSRC_DIR)/,$(IEEE87_BSRCS))
-IEEE08_SRCS=$(addprefix $(LIBSRC_DIR)/,$(IEEE08_BSRCS))
-SYNOPSYS_SRCS=$(addprefix $(LIBSRC_DIR)/,$(SYNOPSYS_BSRCS))
-MENTOR93_SRCS=$(addprefix $(LIBSRC_DIR)/,$(MENTOR93_BSRCS))
-VITAL95_SRCS=$(addprefix $(LIBSRC_DIR)/,$(VITAL95_BSRCS))
-VITAL2000_SRCS=$(addprefix $(LIBSRC_DIR)/,$(VITAL2000_BSRCS))
+$(LIBDST_DIR)/src/vital95/%.vhdl: $(LIBSRC_DIR)/vital95/%.vhdl
+ $(CP) $< $@
-std.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(STD93_SRCS) force
+ANALYZE_IEEE87=$(ANALYZE87) -P../std --work=ieee
+
+ieee.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(LIBDST_DIR)/src/ieee $(IEEE87_SRCS) $(LIBDST_DIR)/src/vital95 $(VITAL95_SRCS) std.v87 force
+ $(RM) -rf $(IEEE87_DIR); mkdir $(IEEE87_DIR)
+ prev=`pwd`; cd $(IEEE87_DIR); \
+ for i in $(IEEE87_BSRCS) $(VITAL95_BSRCS); do \
+ cmd="$(ANALYZE_IEEE87) ../../src/$$i";\
+ echo $$cmd; eval $$cmd || exit 1; \
+ done; \
+ cd $$prev
+
+$(LIBDST_DIR)/src/synopsys/%.vhdl: $(LIBSRC_DIR)/synopsys/%.vhdl
+ $(CP) $< $@
+
+synopsys.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(LIBDST_DIR)/src/synopsys $(SYNOPSYS_SRCS) ieee.v87 force
+ $(RM) -rf $(SYN87_DIR)
+ mkdir $(SYN87_DIR)
+ prev=`pwd`; cd $(SYN87_DIR); \
+ $(CP) ../ieee/ieee-obj87.cf . ; \
+ test x$(VHDLLIBS_COPY_OBJS) = "xno" || \
+ for i in $(IEEE_SRCS) $(VITAL95_SRCS); do \
+ b=`basename $$i .vhdl`; \
+ if [ -f ../ieee/$$b.o ]; then \
+ $(LN) ../ieee/$$b.o $$b.o || exit 1; \
+ fi; \
+ done; \
+ for i in $(SYNOPSYS87_BSRCS); do \
+ cmd="$(ANALYZE_IEEE87) ../../src/$$i";\
+ echo $$cmd; eval $$cmd || exit 1; \
+ done; \
+ cd $$prev
+
+### V93 ###############################################################
+
+$(LIB93_DIR):
+ mkdir -p $@
+
+$(LIBDST_DIR)/src/std/%.v93: $(LIBSRC_DIR)/std/%.vhdl
+ $(SED_V93) < $< > $@
+
+std.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(LIBDST_DIR)/src/std $(STD93_SRCS) force
$(RM) -rf $(STD93_DIR)
mkdir $(STD93_DIR)
prev=`pwd`; cd $(STD93_DIR); \
- for i in $(STD93_SRCS); do \
- cmd="$(ANALYZE93) --bootstrap --work=std $(REL_DIR)/$$i"; \
+ for i in $(STD93_BSRCS); do \
+ cmd="$(ANALYZE93) --bootstrap --work=std ../../src/$$i"; \
echo $$cmd; eval $$cmd || exit 1; \
done; \
cd $$prev
+$(LIBDST_DIR)/src/ieee/%.v93: $(LIBSRC_DIR)/ieee/%.vhdl
+ $(SED_V93) < $< > $@
+
+$(LIBDST_DIR)/src/ieee/%.vhdl: $(LIBSRC_DIR)/ieee/%.vhdl
+ $(CP) $< $@
+
+$(LIBDST_DIR)/src/vital2000/%.vhdl: $(LIBSRC_DIR)/vital2000/%.vhdl
+ $(CP) $< $@
+
ANALYZE_IEEE93=$(ANALYZE93) -P../std --work=ieee
-ieee.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(IEEE93_SRCS) std.v93 force
+ieee.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(LIBDST_DIR)/src/ieee $(IEEE93_SRCS) $(LIBDST_DIR)/src/vital2000 $(VITAL2000_SRCS) std.v93 force
$(RM) -rf $(IEEE93_DIR)
mkdir $(IEEE93_DIR)
prev=`pwd`; cd $(IEEE93_DIR); \
for i in $(IEEE93_BSRCS) $(VITAL2000_BSRCS); do \
- cmd="$(ANALYZE_IEEE93) $(REL_DIR)/$(LIBSRC_DIR)/$$i"; \
+ cmd="$(ANALYZE_IEEE93) ../../src/$$i"; \
echo $$cmd; eval $$cmd || exit 1; \
done; \
cd $$prev
-synopsys.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(SYNOPSYS_SRCS) ieee.v93 force
+synopsys.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(LIBDST_DIR)/src/synopsys $(SYNOPSYS_SRCS) ieee.v93 force
$(RM) -rf $(SYN93_DIR)
mkdir $(SYN93_DIR)
prev=`pwd`; cd $(SYN93_DIR); \
@@ -146,12 +227,15 @@ synopsys.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(SYNOPSYS_SRCS) ieee.v93 force
fi; \
done; \
for i in $(SYNOPSYS93_BSRCS); do \
- cmd="$(ANALYZE_IEEE93) $(REL_DIR)/$(LIBSRC_DIR)/$$i"; \
+ cmd="$(ANALYZE_IEEE93) ../../src/$$i"; \
echo $$cmd; eval $$cmd || exit 1; \
done; \
cd $$prev
-mentor.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(MENTOR93_SRCS) ieee.v93 force
+$(LIBDST_DIR)/src/mentor/%.vhdl: $(LIBSRC_DIR)/mentor/%.vhdl
+ $(CP) $< $@
+
+mentor.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(LIBDST_DIR)/src/mentor $(MENTOR93_SRCS) ieee.v93 force
$(RM) -rf $(MENTOR93_DIR)
mkdir $(MENTOR93_DIR)
prev=`pwd`; cd $(MENTOR93_DIR); \
@@ -164,69 +248,43 @@ mentor.v93: $(ANALYZE_DEP) $(LIB93_DIR) $(MENTOR93_SRCS) ieee.v93 force
fi; \
done ; \
for i in $(MENTOR93_BSRCS); do \
- cmd="$(ANALYZE_IEEE93) $(REL_DIR)/$(LIBSRC_DIR)/$$i";\
+ cmd="$(ANALYZE_IEEE93) ../../src/$$i";\
echo $$cmd; eval $$cmd || exit 1; \
done
-std.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(STD87_SRCS) force
- $(RM) -rf $(STD87_DIR)
- mkdir $(STD87_DIR)
- prev=`pwd`; cd $(STD87_DIR); \
- for i in $(STD87_SRCS); do \
- cmd="$(ANALYZE87) --bootstrap --work=std $(REL_DIR)/$$i"; \
- echo $$cmd; eval $$cmd || exit 1; \
- done; \
- cd $$prev
+### V08 ###############################################################
-ANALYZE_IEEE87=$(ANALYZE87) -P../std --work=ieee
+$(LIB08_DIR):
+ mkdir -p $@
-ieee.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(IEEE87_SRCS) std.v87 force
- $(RM) -rf $(IEEE87_DIR)
- mkdir $(IEEE87_DIR)
- prev=`pwd`; cd $(IEEE87_DIR); \
- for i in $(IEEE87_BSRCS) $(VITAL95_BSRCS); do \
- cmd="$(ANALYZE_IEEE87) $(REL_DIR)/$(LIBSRC_DIR)/$$i";\
- echo $$cmd; eval $$cmd || exit 1; \
- done; \
- cd $$prev
+$(LIBDST_DIR)/src/std/%.v08: $(LIBSRC_DIR)/std/%.vhdl
+ $(SED_V08) < $< > $@
-synopsys.v87: $(ANALYZE_DEP) $(LIB87_DIR) $(SYNOPSYS_SRCS) ieee.v87 force
- $(RM) -rf $(SYN87_DIR)
- mkdir $(SYN87_DIR)
- prev=`pwd`; cd $(SYN87_DIR); \
- $(CP) ../ieee/ieee-obj87.cf . ; \
- test x$(VHDLLIBS_COPY_OBJS) = "xno" || \
- for i in $(IEEE_SRCS) $(VITAL95_SRCS); do \
- b=`basename $$i .vhdl`; \
- if [ -f ../ieee/$$b.o ]; then \
- $(LN) ../ieee/$$b.o $$b.o || exit 1; \
- fi; \
- done; \
- for i in $(SYNOPSYS87_BSRCS); do \
- cmd="$(ANALYZE_IEEE87) $(REL_DIR)/$(LIBSRC_DIR)/$$i";\
- echo $$cmd; eval $$cmd || exit 1; \
- done; \
- cd $$prev
+$(LIBDST_DIR)/src/std/%.vhdl: $(LIBSRC_DIR)/std/%.vhdl
+ $(CP) $< $@
-std.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(STD08_SRCS) force
+std.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(LIBDST_DIR)/src/std $(STD08_SRCS) force
$(RM) -rf $(STD08_DIR)
mkdir $(STD08_DIR)
prev=`pwd`; cd $(STD08_DIR); \
- for i in $(STD08_SRCS); do \
- cmd="$(ANALYZE08) --bootstrap --work=std $(REL_DIR)/$$i"; \
+ for i in $(STD08_BSRCS); do \
+ cmd="$(ANALYZE08) --bootstrap --work=std ../../src/$$i"; \
echo $$cmd; eval $$cmd || exit 1; \
done; \
cd $$prev
+$(LIBDST_DIR)/src/ieee2008/%.vhdl: $(LIBSRC_DIR)/ieee2008/%.vhdl
+ $(CP) $< $@
+
ANALYZE_IEEE08=$(ANALYZE08) -P../std --work=ieee
-ieee.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(IEEE08_SRCS) std.v08 force
+ieee.v08: $(ANALYZE_DEP) $(LIB08_DIR) $(LIBDST_DIR)/src/ieee2008 $(IEEE08_SRCS) std.v08 force
$(RM) -rf $(IEEE08_DIR)
mkdir $(IEEE08_DIR)
# FIXME: add VITAL2000 ?
prev=`pwd`; cd $(IEEE08_DIR); \
for i in $(IEEE08_BSRCS); do \
- cmd="$(ANALYZE_IEEE08) $(REL_DIR)/$(LIBSRC_DIR)/$$i"; \
+ cmd="$(ANALYZE_IEEE08) ../../src/$$i"; \
echo $$cmd; eval $$cmd || exit 1; \
done; \
cd $$prev