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
1ea61641
Commit
1ea61641
authored
Apr 10, 2014
by
Pawel Szostek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
__main__.py: better automatic flow dispatching
parent
976a21c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
+30
-22
__main__.py
hdlmake/__main__.py
+30
-22
No files found.
hdlmake/__main__.py
View file @
1ea61641
...
...
@@ -42,7 +42,7 @@ except:
def
main
():
usage
=
"""hdlmake [
--py CODE] [--debug LVL] [
command] [options]"""
usage
=
"""hdlmake [command] [options]"""
description
=
"""To see optional arguments for particular command type:
hdlmake <command> --help
...
...
@@ -61,11 +61,7 @@ def main():
# check_manifest = subparsers.add_parser("check-manifest", help="check manifest for formal correctness")
# check_manifest.add_argument("--top", help="indicate path to the top manifest", default=None)
manifest_help
=
subparsers
.
add_parser
(
"manifest-help"
,
help
=
"print manifest file variables description"
)
auto
=
subparsers
.
add_parser
(
"auto"
,
help
=
"default action for hdlmake. Run when no args are given"
)
auto
.
add_argument
(
"--force"
,
help
=
"force hdlmake to generate the makefile, even if the specified tool is missing"
,
default
=
False
,
action
=
"store_true"
)
auto
.
add_argument
(
"--noprune"
,
help
=
"prevent hdlmake from pruning unneeded files"
,
default
=
False
,
action
=
"store_true"
)
auto
.
add_argument
(
"--generate-project-vhd"
,
help
=
"generate project.vhd file with a meta package describing the project"
,
dest
=
"generate_project_vhd"
,
default
=
False
,
action
=
"store_true"
)
fetch
=
subparsers
.
add_parser
(
"fetch"
,
help
=
"fetch and/or update remote modules listed in Manifest"
)
fetch
.
add_argument
(
"--flatten"
,
help
=
"`flatten' modules' hierarchy by storing everything in top module's fetchto direactoru"
,
default
=
False
,
action
=
"store_true"
)
...
...
@@ -86,28 +82,40 @@ def main():
condition_check
.
add_argument
(
"--tool"
,
dest
=
"tool"
,
required
=
True
)
condition_check
.
add_argument
(
"--reference"
,
dest
=
"reference"
,
required
=
True
)
condition_check
.
add_argument
(
"--condition"
,
dest
=
"condition"
,
required
=
True
)
# version = subparsers.add_parser("version", help="print version id of this Hdlmake build")
auto
=
subparsers
.
add_parser
(
"auto"
,
help
=
"default action for hdlmake. Run when no args are given"
)
auto
.
add_argument
(
"--force"
,
help
=
"force hdlmake to generate the makefile, even if the specified tool is missing"
,
default
=
False
,
action
=
"store_true"
)
auto
.
add_argument
(
"--noprune"
,
help
=
"prevent hdlmake from pruning unneeded files"
,
default
=
False
,
action
=
"store_true"
)
auto
.
add_argument
(
"--generate-project-vhd"
,
help
=
"generate project.vhd file with a meta package describing the project"
,
dest
=
"generate_project_vhd"
,
default
=
False
,
action
=
"store_true"
)
parser
.
add_argument
(
"--py"
,
dest
=
"arbitrary_code"
,
default
=
""
,
help
=
"add arbitrary code when evaluation all manifests"
)
parser
.
add_argument
(
"--log"
,
dest
=
"log"
,
default
=
"info"
,
help
=
"set logging level (one of debug, info, warning, error, critical"
)
if
len
(
sys
.
argv
)
<
2
:
options
=
parser
.
parse_args
([
'auto'
])
elif
len
(
sys
.
argv
)
==
2
and
sys
.
argv
[
1
][:
5
]
==
"--log"
:
options
=
parser
.
parse_args
(
sys
.
argv
[
1
:]
+
[
'auto'
])
elif
sys
.
argv
[
1
]
==
"_conditioncheck"
:
options
=
condition_check
.
parse_args
(
sys
.
argv
[
2
:])
env
=
Env
(
options
)
env
.
check_env
()
CheckCondition
(
modules_pool
=
None
,
options
=
options
,
env
=
env
)
.
run
()
quit
()
else
:
options
=
parser
.
parse_args
(
sys
.
argv
[
1
:])
parser
.
add_argument
(
"--generate-project-vhd"
,
help
=
"generate project.vhd file with a meta package describing the project"
,
dest
=
"generate_project_vhd"
,
default
=
False
,
action
=
"store_true"
)
parser
.
add_argument
(
"--force"
,
help
=
"force hdlmake to generate the makefile, even if the specified tool is missing"
,
default
=
False
,
action
=
"store_true"
)
options
=
None
if
len
(
sys
.
argv
[
1
:])
==
0
:
options
=
parser
.
parse_args
([
'auto'
])
elif
len
(
sys
.
argv
[
1
:])
==
1
:
if
sys
.
argv
[
1
]
==
"_conditioncheck"
:
options
=
condition_check
.
parse_args
(
sys
.
argv
[
2
:])
env
=
Env
(
options
)
env
.
check_env
()
CheckCondition
(
modules_pool
=
None
,
options
=
options
,
env
=
env
)
.
run
()
quit
()
elif
sys
.
argv
[
1
]
==
"--help"
or
sys
.
argv
[
1
]
==
"-h"
:
options
=
parser
.
parse_args
(
sys
.
argv
[
1
:])
else
:
options
=
parser
.
parse_args
([
"auto"
]
+
sys
.
argv
[
1
:])
print
(
options
)
global_mod
.
options
=
options
env
=
Env
(
options
)
...
...
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