diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-07-15 06:32:58 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-07-16 15:06:44 +0200 |
commit | e35b24adbb1d0e76c076fe475c8442738b3378be (patch) | |
tree | b65ad8fa33cfad1dbbff863561d6cb964f889801 /Makefile.in | |
parent | 0eadd36bc47b08ad552d325c54f9e3a305c6838c (diff) | |
download | ghdl-e35b24adbb1d0e76c076fe475c8442738b3378be.tar.gz ghdl-e35b24adbb1d0e76c076fe475c8442738b3378be.tar.bz2 ghdl-e35b24adbb1d0e76c076fe475c8442738b3378be.zip |
Rework gcc build procedure. Add vpi build command.
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 106 |
1 files changed, 49 insertions, 57 deletions
diff --git a/Makefile.in b/Makefile.in index 7bde0921b..66238f009 100644 --- a/Makefile.in +++ b/Makefile.in @@ -97,7 +97,7 @@ include $(GRTSRCDIR)/Makefile.inc #################### For mcode backend ############################## -all.mcode: ghdl_mcode libs.vhdl.mcode +all.mcode: ghdl_mcode libs.vhdl.mcode all.vpi GHDL_MCODE_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/grt -aI$(srcdir)/src/ortho -aI$(srcdir)/src/ortho/mcode @@ -114,7 +114,7 @@ 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.vhdllib +install.mcode: install.mcode.program install.vhdllib install.vpi oread-mcode: force $(MAKE) -f $(srcdir)/src/ortho/mcode/Makefile \ @@ -126,8 +126,11 @@ oread-mcode: force gcc_vhdl_dir=$(gcc_src_dir)/gcc/vhdl all.gcc: - echo "For installing sources in gcc, do: make copy-sources" - echo "Then configure gcc" + echo "For installing sources in gcc, do:" + echo "1) make copy-sources" + echo "2) configure, build and install gcc" + echo "3) make ghdllib" + echo "4) make install" copy-sources.gcc: $(RM) -rf $(gcc_vhdl_dir) @@ -141,21 +144,20 @@ copy-sources.gcc: $(CP) -p $(srcdir)/src/ortho/gcc/*.c $(gcc_vhdl_dir) $(CP) -p $(srcdir)/src/ortho/gcc/*.opt $(gcc_vhdl_dir) $(CP) -p $(srcdir)/doc/ghdl.texi $(srcdir)/doc/ghdl.1 $(gcc_vhdl_dir) - $(MKDIR) $(gcc_vhdl_dir)/grt - $(CP) -pR $(srcdir)/src/grt/* $(gcc_vhdl_dir)/grt - $(MKDIR) $(gcc_vhdl_dir)/libraries - $(CP) -pR $(srcdir)/libraries/* $(gcc_vhdl_dir)/libraries $(MKDIR) $(gcc_vhdl_dir)/ghdldrv $(CP) -pR $(srcdir)/src/ghdldrv/*.ad? $(gcc_vhdl_dir)/ghdldrv $(CP) -p $(srcdir)/dist/gcc/Make-lang.in $(gcc_vhdl_dir) - $(SED) \ - -e "/^####libraries Makefile.inc/r $(srcdir)/libraries/Makefile.inc" \ - -e "/^####grt Makefile.inc/r $(srcdir)/src/grt/Makefile.inc" \ - < $(srcdir)/dist/gcc/Makefile.in > $(gcc_vhdl_dir)/Makefile.in $(CP) -p $(srcdir)/dist/gcc/config-lang.in $(gcc_vhdl_dir) $(CP) -p $(srcdir)/dist/gcc/lang-options.h $(gcc_vhdl_dir) $(CP) -p $(srcdir)/dist/gcc/lang-specs.h $(gcc_vhdl_dir) +libs.vhdl.gcc: + $(MAKE) GHDL=$(bindir)/ghdl vhdl.libs.all libs.vhdl.standard + +ghdllib: libs.vhdl.gcc libgrt.a + +install.gcc: install.vhdllib install.grt install.vpi + GHDL_GCC_INCFLAGS=$(GHDL_COMMON_INCFLAGS) ghdl1-gcc: force @@ -176,9 +178,7 @@ grt.links: ln -sf $(libdirreverse)/libbacktrace.a .; \ fi -libs.vhdl.gcc: ghdl_gcc ghdl1-gcc - $(MAKE) GHDL=ghdl_gcc vhdl.libs.all - $(MAKE) GHDL1=./ghdl1-gcc libs.vhdl.standard +libs.vhdl.local_gcc: ghdl_gcc ghdl1-gcc vhdl.libs.all libs.vhdl.standard ghdl1-debug: force $(MAKE) -f $(srcdir)/src/ortho/debug/Makefile \ @@ -195,7 +195,7 @@ oread-gcc: force GHDL_LLVM_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir)/src/grt -aI$(srcdir)/src/ortho -aI$(srcdir)/src/ortho/llvm -all.llvm: ghdl1-llvm ghdl_llvm grt-all libs.vhdl.llvm +all.llvm: ghdl1-llvm ghdl_llvm grt-all libs.vhdl.llvm all.vpi all.llvm_jit: ghdl_llvm_jit @@ -212,11 +212,10 @@ llvm-cbindings.o: $(srcdir)/src/ortho/llvm/llvm-cbindings.cpp $(OPT_FLAGS) -o $@ $< libs.vhdl.llvmjit: ghdl_llvm_jit - $(MAKE) GHDL=ghdl_llvm_jit vhdl.libs.all + $(MAKE) GHDL=$(PWD)/ghdl_llvm_jit vhdl.libs.all libs.vhdl.llvm: ghdl_llvm ghdl1-llvm - $(MAKE) GHDL=ghdl_llvm ANALYZE_OPTS="--GHDL1=ghdl1-llvm$(EXEEXT)" vhdl.libs.all - $(MAKE) GHDL1=./ghdl1-llvm$(EXEEXT) libs.vhdl.standard + $(MAKE) GHDL=$(PWD)/ghdl_llvm ANALYZE_OPTS="--GHDL1=ghdl1-llvm$(EXEEXT)" vhdl.libs.all libs.vhdl.standard ghdl_llvm: force $(GNATMAKE) $(GHDL_LLVM_INCFLAGS) -aI$(srcdir)/src/ghdldrv $(GNATFLAGS)\ @@ -235,16 +234,11 @@ oread-llvm: force GNAT_FLAGS="-aI$(srcdir)/src/ortho/oread $(GNATFLAGS)" \ LLVM_CONFIG="$(LLVM_CONFIG)" -install.grt.llvm: libgrt.a grt.lst install.dirs - $(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.llvm.program: install.dirs ghdl1-llvm ghdl_llvm $(INSTALL_PROGRAM) ghdl_llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl$(EXEEXT) $(INSTALL_PROGRAM) ghdl1-llvm$(EXEEXT) $(DESTDIR)$(bindir)/ghdl1-llvm$(EXEEXT) -install.llvm: install.llvm.program install.vhdllib install.grt.llvm +install.llvm: install.llvm.program install.vhdllib install.grt install.vpi ################ For simul (no code generation, interpretation) ########## @@ -253,8 +247,7 @@ GHDL_SIMUL_INCFLAGS=$(GHDL_COMMON_INCFLAGS) -aI$(srcdir)/src/ghdldrv -aI$(srcdir ghdl_simul: $(GRT_ADD_OBJS) $(GRT_SRC_DEPS) force $(GNATMAKE) $(GHDL_SIMUL_INCFLAGS) $(GNATFLAGS) ghdl_simul $(GNAT_BARGS) -largs $(GNAT_LARGS) $(GRT_ADD_OBJS) $(subst @,$(GRTSRCDIR),$(GRT_EXTRA_LIB)) -libs.vhdl.simul: ghdl_simul - $(MAKE) GHDL=ghdl_simul vhdl.libs.all +libs.vhdl.simul: ghdl_simul vhdl.libs.all ################ mhdlsim (library for the vhdl part) #################### @@ -281,10 +274,18 @@ ghwdump.o: $(srcdir)/src/grt/ghwdump.c $(srcdir)/src/grt/ghwlib.h ghwlib.o: $(srcdir)/src/grt/ghwlib.c $(srcdir)/src/grt/ghwlib.h $(CC) -c -o $@ $< $(OPT_FLAGS) $(WARN_CFLAGS) +############### grt ##################################################### + +install.grt: libgrt.a grt.lst install.dirs + $(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 + ################ VPI ##################################################### vpi_thunk.o: $(GRTSRCDIR)/vpi_thunk.c $(GRTSRCDIR)/vpi_thunk.h - $(CC) -c -o $@ $< -fPIC $(OPT_FLAGS) $(WARN_CFLAGS) +# Do not use OPT_FLAGS (do not enable coverage) + $(CC) -c -o $@ $< -fPIC -O $(WARN_CFLAGS) libghdlvpi.so: vpi_thunk.o $(CC) -o $@ $< -shared -Wl,-soname,libghdlvpi.so @@ -296,7 +297,9 @@ libghdlvpi.dylib: vpi_thunk.o # Allow the use of -rpath in executable $(CC) -o $@ $< -shared -Wl,-install_name,@rpath/libghdlvpi.dylib -install.vpi: libghdlvpi$(SOEXT) install.dirs +all.vpi: libghdlvpi$(SOEXT) + +install.vpi: all.vpi install.dirs $(INSTALL_DATA) -p libghdlvpi$(SOEXT) $(DESTDIR)$(libdir)/ $(INSTALL_DATA) -p $(GRTSRCDIR)/vpi_user.h $(DESTDIR)$(incdir)/ @@ -305,43 +308,30 @@ install.vpi: libghdlvpi$(SOEXT) install.dirs LIBSRC_DIR:=$(srcdir)/libraries LIBDST_DIR:=$(libdirsuffix) -GHDL=ghdl_$(backend) +GHDL=$(PWD)/ghdl_$(backend) ANALYZE_OPTS:= -ANALYZE:=$(libdirreverse)/../../$(GHDL) -a $(ANALYZE_OPTS) $(LIB_CFLAGS) +ANALYZE:=$(GHDL) -a $(ANALYZE_OPTS) $(LIB_CFLAGS) ANALYZE_DEP:=$(GHDL) include $(srcdir)/libraries/Makefile.inc -GHDL1=./ghdl1-gcc -$(LIB93_DIR)/std/std_standard.o: $(GHDL1) -ifeq ($(GHDL),ghdl_llvm) - $(GHDL1) --std=93 -quiet $(LIB_CFLAGS) -c -o $@ --compile-standard +ifeq "$(backend)" "gcc" + STD_GHDL_FLAGS= else - $(GHDL1) --std=93 -quiet $(LIB_CFLAGS) -o std_standard_93.s \ - --compile-standard - $(CC) -c -o $@ std_standard_93.s - $(RM) std_standard_93.s + STD_GHDL_FLAGS=--GHDL1=$(PWD)/ghdl1-$(backend) endif -$(LIB87_DIR)/std/std_standard.o: $(GHDL1) -ifeq ($(GHDL),ghdl_llvm) - $(GHDL1) --std=87 -quiet $(LIB_CFLAGS) -c -o $@ --compile-standard -else - $(GHDL1) --std=87 -quiet $(LIB_CFLAGS) -o std_standard_87.s \ - --compile-standard - $(CC) -c -o $@ std_standard_87.s - $(RM) std_standard_87.s -endif +$(LIB93_DIR)/std/std_standard.o: $(GHDL) + cd $(LIB93_DIR)/std; \ + $(GHDL) --bootstrap-standard $(STD_GHDL_FLAGS) --std=93 $(LIB_CFLAGS) -$(LIB08_DIR)/std/std_standard.o: $(GHDL1) -ifeq ($(GHDL),ghdl_llvm) - $(GHDL1) --std=08 -quiet $(LIB_CFLAGS) -c -o $@ --compile-standard -else - $(GHDL1) --std=08 -quiet $(LIB_CFLAGS) -o std_standard_08.s \ - --compile-standard - $(CC) -c -o $@ std_standard_08.s - $(RM) std_standard_08.s -endif +$(LIB87_DIR)/std/std_standard.o: $(GHDL) + cd $(LIB87_DIR)/std; \ + $(GHDL) --bootstrap-standard $(STD_GHDL_FLAGS) --std=87 $(LIB_CFLAGS) + +$(LIB08_DIR)/std/std_standard.o: $(GHDL) + cd $(LIB08_DIR)/std; \ + $(GHDL) --bootstrap-standard $(STD_GHDL_FLAGS) --std=08 $(LIB_CFLAGS) libs.vhdl.standard: $(LIB93_DIR)/std/std_standard.o \ $(LIB87_DIR)/std/std_standard.o \ @@ -351,6 +341,8 @@ install.dirs: [ -d $(DESTDIR)$(prefix) ] || $(MKDIR) -p $(DESTDIR)$(prefix) [ -d $(DESTDIR)$(bindir) ] || $(MKDIR) -p $(DESTDIR)$(bindir) [ -d $(DESTDIR)$(libdir) ] || $(MKDIR) -p $(DESTDIR)$(libdir) + [ -d $(DESTDIR)$(prefix)/$(libdirsuffix) ] || \ + $(MKDIR) -p $(DESTDIR)$(prefix)/$(libdirsuffix) [ -d $(DESTDIR)$(incdir) ] || $(MKDIR) -p $(DESTDIR)$(incdir) install.vhdllib: install.dirs |