Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project level flag to build an entire project for a target debug level. #203

Closed
sbestgen opened this issue Feb 17, 2023 · 9 comments · Fixed by #231
Closed

Project level flag to build an entire project for a target debug level. #203

sbestgen opened this issue Feb 17, 2023 · 9 comments · Fixed by #231
Assignees

Comments

@sbestgen
Copy link
Collaborator

My project has a need to create two different targets from the same source: MYDBGLIB which builds all objects with a desired debug level (source) and MYOPTLIB, which builds all objects with DEBUG(*NONE) and then specifies various optimization options on target parts. Instead of having to override the DBGVIEW as a private compile parm on each part, and have a different rules.mk for the DBGLIB build vs the OPTLIB build, it would be great to have something more global (perhaps in the iproj.json or an optional parm on the makei build command) to set this option globally for the entire build.

@johnsherrill
Copy link

DBGVIEW in the def_rules.mk currently is set to DBGVIEW := *ALL. You could set it to something like this. DBGVIEW := $(BUILD_DEBUG). This will cause DBGVIEW to be set to the value of the environment variable BUILD_DEBUG. So before running you debug build you set the environment variable with either a export (in a script) or ADDENVVAR or CHGENVVAR. For example export BUILD_DEBUG="*SOURCE" or ADDENVVAR ENVVAR('BUILD_DEBUG') VALUE'*SOURCE').

@sbestgen
Copy link
Collaborator Author

Nice solution - thx for the tip.

@sbestgen
Copy link
Collaborator Author

I did try this with my project, but I'm not having luck getting the environment variable set in iproj.json to show up in def_rules.mk. Maybe I've missed something ..
image

@johnsherrill
Copy link

You may need to LEVEL(*SYS) to the addenvvar command. Depending on many things the environment variable may not be passed as job level one.

@sbestgen
Copy link
Collaborator Author

A good theory .. I tried that as well with no luck. At least I can verify the envirnoment variable value did get detected and the command ran.
image

@johnsherrill
Copy link

Maybe Edmund Reinhardt or Tongkun Zhang can comment, as they know the current setup much better than I.

@edmundreinhardt
Copy link
Member

Will investigate

@edmundreinhardt
Copy link
Member

The -e parameters set the variable into the os environment here
https://vscode.dev/github/IBM/ibmi-bob/blob/d62bd19d968708552b7950efd8adaa5ac96098f3/src/makei/cli/makei_entry.py#L272

I haven't figured out yet why this is not being recognized by the gmake invocation.

@edmundreinhardt
Copy link
Member

Figuring this out will also help address #208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants