aboutsummaryrefslogtreecommitdiffstats
path: root/dist/gcc
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-12-18 06:48:45 +0100
committerTristan Gingold <tgingold@free.fr>2014-12-18 06:48:45 +0100
commit17d4852b72d3b488cb3aaacf5fe3767f56a8c089 (patch)
tree64ce7d9bde63bdb4ebc4fc156e0f9b6c3953b894 /dist/gcc
parent7536206f05e52657f972cfbb35bed45615048b69 (diff)
downloadghdl-17d4852b72d3b488cb3aaacf5fe3767f56a8c089.tar.gz
ghdl-17d4852b72d3b488cb3aaacf5fe3767f56a8c089.tar.bz2
ghdl-17d4852b72d3b488cb3aaacf5fe3767f56a8c089.zip
Adjust makefiles to accept absolute srcdir path.
Diffstat (limited to 'dist/gcc')
-rw-r--r--dist/gcc/Make-lang.in14
-rw-r--r--dist/gcc/Makefile.in93
2 files changed, 32 insertions, 75 deletions
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