summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold2014-12-27 06:07:16 +0100
committerTristan Gingold2014-12-27 06:07:16 +0100
commitd563d20806b6ad4ae070858194f82d379a8a8a35 (patch)
tree483072ec063d20dcaf5ce3ab265b68712b756065
parent316f7526249a9b8cbf6c717a3c3b3fb12e9585c5 (diff)
downloadghdl-d563d20806b6ad4ae070858194f82d379a8a8a35.tar.gz
ghdl-d563d20806b6ad4ae070858194f82d379a8a8a35.tar.bz2
ghdl-d563d20806b6ad4ae070858194f82d379a8a8a35.zip
dist/gcc: add compilation flags, avoid to rebuilt ghdllib.
-rw-r--r--dist/gcc/Make-lang.in23
-rw-r--r--dist/gcc/Makefile.in12
2 files changed, 25 insertions, 10 deletions
diff --git a/dist/gcc/Make-lang.in b/dist/gcc/Make-lang.in
index 701a517..8c99c33 100644
--- a/dist/gcc/Make-lang.in
+++ b/dist/gcc/Make-lang.in
@@ -39,6 +39,9 @@
MV = mv
RM = rm -f
+GHDLLIB_CFLAGS=-O2 -g
+GHDLLIB_AFLAGS=-gnatpn
+
# Extra flags to pass to recursive makes.
GHDL_ADAFLAGS= -Wall -gnata
VHDL_LIB_DIR=$(libsubdir)/vhdl
@@ -46,7 +49,9 @@ GNATBIND = gnatbind
GNATMAKE = gnatmake
VHDL_FLAGS_TO_PASS = \
"GHDL_ADAFLAGS=$(GHDL_ADAFLAGS)" \
- "GRT_FLAGS=-O -g" \
+ "GRT_FLAGS=$(GHDLLIB_CFLAGS)" \
+ "GRT_ADAFLAGS=$(GHDLLIB_AFLAGS)" \
+ "LIB_CFLAGS=$(GHDLLIB_CFLAGS)" \
"GNATMAKE=$(GNATMAKE)" \
"GNATBIND=$(GNATBIND)" \
"CFLAGS=$(CFLAGS)" \
@@ -60,7 +65,7 @@ VHDL_FLAGS_TO_PASS = \
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
+vhdl VHDL: ghdl1$(exeext) ghdl$(exeext) vhdl/libgrt.a ghdllib
# Tell GNU Make to ignore these, if they exist.
.PHONY: vhdl VHDL ghdllib
@@ -89,6 +94,7 @@ ghdl1$(exeext): force $(GHDL1_OBJS) $(BACKEND) $(LIBDEPS)
-bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \
-largs --LINK=$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GHDL1_OBJS) \
$(filter-out main.o,$(BACKEND)) $(LIBS) $(BACKENDLIBS)
+ if test $@ -nt s-ghdllib; then $(RM) -f s-ghdllib; fi
vhdl/default_pathes.ads: Makefile
echo "-- DO NOT EDIT" > tmp-dpathes.ads
@@ -116,10 +122,17 @@ ghdl$(exeext): ghdl1$(exeext) vhdl/default_pathes.ads force
$(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aI$(srcdir)/vhdl/ghdldrv \
-aIvhdl -aOvhdl ghdl_gcc \
-bargs -E -cargs $(ADA_CFLAGS) $(GHDL_ADAFLAGS) -largs $(LIBS)
+ if test $@ -nt s-ghdllib; then $(RM) -f s-ghdllib; fi
# Ghdl libraries.
-ghdllib: ghdl$(exeext) ghdl1$(exeext) $(GCC_PASSES) vhdl/Makefile force
+s-ghdllib:
$(MAKE_IN_VHDL) ghdllib
+ touch $@
+
+ghdllib: s-ghdllib
+
+vhdl/libgrt.a: vhdl/Makefile force
+ $(MAKE_IN_VHDL) libgrt.a grt.lst
vhdl/Makefile: config.status $(srcdir)/vhdl/Makefile.in
CONFIG_HEADERS= CONFIG_LINKS= CONFIG_COMMANDS= \
@@ -160,7 +173,7 @@ vhdl.install-normal:
vhdl.install-plugin:
# Install the driver program as ghdl.
-vhdl.install-common: ghdl$(exeext) vhdl/Makefile
+vhdl.install-common: ghdl$(exeext) s-ghdllib vhdl/Makefile
-mkdir $(DESTDIR)$(bindir)
-$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext)
$(INSTALL_PROGRAM) ghdl$(exeext) $(DESTDIR)$(bindir)/ghdl$(exeext)
@@ -171,7 +184,7 @@ install-info:: $(DESTDIR)$(infodir)/ghdl.info
vhdl.install-info: $(DESTDIR)$(infodir)/ghdl.info
-install-ghdllib: ghdl$(exeext) ghdl1$(exeext) vhdl/Makefile
+install-ghdllib: ghdl$(exeext) ghdl1$(exeext) vhdl/Makefile s-ghdllib
$(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 2d1cdc7..9430d02 100644
--- a/dist/gcc/Makefile.in
+++ b/dist/gcc/Makefile.in
@@ -168,22 +168,24 @@ ANALYZE_DEP:=
####libraries Makefile.inc
+ANALYZE_STD=$(GHDL1) -quiet --compile-standard $(LIB_CFLAGS)
+
std87_standard.o: $(GHDL1)
- $(GHDL1) --std=87 -quiet -o std87_standard.s --compile-standard
+ $(ANALYZE_STD) --std=87 -o std87_standard.s
../xgcc -c -o $@ std87_standard.s
$(RM) -f std87_standard.s
std93_standard.o: $(GHDL1)
- $(GHDL1) --std=93 -quiet -o std93_standard.s --compile-standard
+ $(ANALYZE_STD) --std=93 -o std93_standard.s
../xgcc -c -o $@ std93_standard.s
$(RM) -f std93_standard.s
std08_standard.o: $(GHDL1)
- $(GHDL1) --std=08 -quiet -o std08_standard.s --compile-standard
+ $(ANALYZE_STD) --std=08 -o std08_standard.s
../xgcc -c -o $@ std08_standard.s
$(RM) -f std08_standard.s
-ghdllib: libgrt.a std87_standard.o std93_standard.o std08_standard.o vhdl.libs.all
+ghdllib: std87_standard.o std93_standard.o std08_standard.o vhdl.libs.all
ghdllibs-clean: force
$(RM) -rf $(LIB87_DIR) $(LIB93_DIR) $(LIB08_DIR)
@@ -196,7 +198,7 @@ GRT_RANLIB=$(RANLIB)
####grt Makefile.inc
-install-ghdllib: ghdllib grt.lst
+install-ghdllib:
$(RM) -rf $(DESTDIR)$(VHDL_LIB_DIR)
$(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR)
# Install libgrt