diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-07-30 19:16:35 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-07-30 19:16:43 +0200 |
commit | 7f0f6c771e501f923d10cec3faf51f379fce40e7 (patch) | |
tree | 65ef109950af7284bd9470d58235cb377705a914 /src/ghdldrv/ghdlcomp.adb | |
parent | d6998051266d78c2380fa15c960b334c1d1b9450 (diff) | |
download | ghdl-7f0f6c771e501f923d10cec3faf51f379fce40e7.tar.gz ghdl-7f0f6c771e501f923d10cec3faf51f379fce40e7.tar.bz2 ghdl-7f0f6c771e501f923d10cec3faf51f379fce40e7.zip |
ghdldrv: factorize part of --gen-makefile
Fix #1403
Diffstat (limited to 'src/ghdldrv/ghdlcomp.adb')
-rw-r--r-- | src/ghdldrv/ghdlcomp.adb | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/src/ghdldrv/ghdlcomp.adb b/src/ghdldrv/ghdlcomp.adb index c58360aee..96a854d28 100644 --- a/src/ghdldrv/ghdlcomp.adb +++ b/src/ghdldrv/ghdlcomp.adb @@ -34,7 +34,6 @@ with Vhdl.Utils; with Vhdl.Configuration; with Errorout; use Errorout; with Libraries; -with Version; package body Ghdlcomp is @@ -842,7 +841,6 @@ package body Ghdlcomp is is pragma Unreferenced (Cmd); use Simple_IO; - use Ada.Command_Line; use Name_Table; HT : constant Character := ASCII.HT; @@ -861,52 +859,11 @@ package body Ghdlcomp is Setup_Libraries (True); Files_List := Build_Dependence (Prim_Id, Sec_Id); - Put_Line ("# Makefile automatically generated by ghdl"); - Put ("# Version: GHDL "); - Put (Version.Ghdl_Ver); - Put (' '); - Put (Version.Ghdl_Release); - Put (" - "); - if Version_String /= null then - Put (Version_String.all); - end if; - New_Line; - Put_Line ("# Command used to generate this makefile:"); - Put ("# "); - Put (Command_Name); - for I in 1 .. Argument_Count loop - Put (' '); - Put (Argument (I)); - end loop; - New_Line; + Ghdllocal.Gen_Makefile_Disp_Header; New_Line; - Put ("GHDL="); - Put_Line (Command_Name); - - -- Extract options for command line. - Put ("GHDLFLAGS="); - for I in 2 .. Argument_Count loop - declare - Arg : constant String := Argument (I); - begin - if Arg (1) = '-' then - if (Arg'Length > 10 and then Arg (1 .. 10) = "--workdir=") - or else (Arg'Length > 7 and then Arg (1 .. 7) = "--ieee=") - or else (Arg'Length > 6 and then Arg (1 .. 6) = "--std=") - or else (Arg'Length > 7 and then Arg (1 .. 7) = "--work=") - or else (Arg'Length > 2 and then Arg (1 .. 2) = "-P") - or else (Arg'Length > 2 and then Arg (1 .. 2) = "-f") - or else (Arg'Length > 6 and then Arg (1 .. 6) = "--std=") - then - Put (" "); - Put (Arg); - end if; - end if; - end; - end loop; - New_Line; + Ghdllocal.Gen_Makefile_Disp_Variables; Put ("GHDLRUNFLAGS="); for I in Next_Arg .. Args'Last loop |