Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
ded989dc
Commit
ded989dc
authored
Oct 01, 2019
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --cygwin/--windows options.
parent
1bafa174
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
commands.py
hdlmake/action/commands.py
+4
-0
main.py
hdlmake/main.py
+9
-0
shell.py
hdlmake/util/shell.py
+15
-1
No files found.
hdlmake/action/commands.py
View file @
ded989dc
...
...
@@ -35,6 +35,7 @@ from hdlmake.fetch.svn import Svn
from
hdlmake.fetch.git
import
Git
,
GitSM
from
hdlmake.fetch.local
import
Local
from
.action
import
Action
import
hdlmake.util.shell
as
shell
class
ActionCore
(
Action
):
...
...
@@ -61,6 +62,9 @@ class ActionCore(Action):
def
makefile
(
self
):
"""Write the Makefile for the current design"""
commands
=
self
.
options
.
__dict__
.
get
(
'make'
)
if
commands
:
shell
.
set_commands_os
(
commands
)
self
.
_check_all_fetched
()
self
.
build_file_set
()
self
.
solve_file_set
()
...
...
hdlmake/main.py
View file @
ded989dc
...
...
@@ -113,6 +113,15 @@ def _get_parser():
makefile
.
add_argument
(
"-f"
,
"--filename"
,
default
=
None
,
dest
=
"filename"
,
help
=
"name for the Makefile file to be created"
)
makefile
.
add_argument
(
"--make"
,
default
=
'auto'
,
dest
=
'make'
,
choices
=
[
'auto'
,
'cygwin'
,
'windows'
],
help
=
"select the type of 'make' on windows platforms"
)
makefile
.
add_argument
(
"--cygwin"
,
action
=
'store_const'
,
dest
=
'make'
,
const
=
'cygwin'
,
help
=
"select a cygwin 'make' on windows platforms"
)
makefile
.
add_argument
(
"--windows"
,
action
=
'store_const'
,
dest
=
'make'
,
const
=
'windows'
,
help
=
"select a mingw/windows 'make' on windows platforms"
)
subparsers
.
add_parser
(
"fetch"
,
...
...
hdlmake/util/shell.py
View file @
ded989dc
...
...
@@ -31,6 +31,17 @@ import logging
from
subprocess
import
PIPE
,
Popen
,
CalledProcessError
commands_os
=
'auto'
def
set_commands_os
(
name
):
"""Select the OS for commands"""
global
commands_os
if
name
==
'windows'
and
not
check_windows_tools
():
logging
.
warning
(
"Setting 'make' to windows may not work on non-windows platforms"
)
commands_os
=
name
def
run
(
command
):
"""Execute a command in the shell and print the output lines as a list"""
try
:
...
...
@@ -63,7 +74,10 @@ def check_windows_tools():
def
check_windows_commands
():
"""Check if we are using windows commands (del/type).
False on cygwin"""
return
platform
.
system
()
==
'Windows'
if
commands_os
==
'auto'
:
return
platform
.
system
()
==
'Windows'
else
:
return
commands_os
==
'windows'
def
del_command
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment