1. So the use of make rather than JCL has ABSOLUTELY NOTHING WHATSOEVER to do 
with the problem I posted, the subject of the thread??!! Gee, thanks.

I am not a C newbie. I am totally familiar with #ifdef (the relevant macro is 
__MVS__ FWIW). My code is 95% bimodal (Windows/z/OS) and some is trimodal 
(throw in Intel Linux). No amount of #ifdef __MVS__ solves the problem that 
command line/PARM=/OPTF options override #pragma OPTIONS.

2. So what IS a good tutorial for z/OS UNIX make? Also for -- what is the tool 
-- revealing my ignorance here -- that reads through the code and builds the 
dependency list for make automatically?

FWIW I guess the solution to my problem is to move the option totally out of 
PARM=/OPTF and into a common header file. (I happen to already have a "first in 
every module" header file.) It will need to be surrounded with #ifdef's for 
platform independence and so that one or two modules can bypass it.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Jack J. Woehr
Sent: Wednesday, November 25, 2015 6:11 PM
To: [email protected]
Subject: Re: Any clever way to defeat the C compiler's options precedence?

Charles Mills wrote:
> Touché.
>
> Yes, yes, I know, I should be using make. We all have a little bit of 
> dinosaur blood in us. Some are stuck in assembler.

I love assembler. When in assembler, I'm doing it your way.

>   I happen to be stuck in batch JCL compiles. I should learn make but it is 
> never at the top of the critical path.

I know the feeling. I'd love to play with z/OS more, have access, but same 
issue.

> 1. Will make in fact solve this specific problem? Can one readily specify 
> "global" compiler options for most modules and override them for specific 
> modules?

Not exactly. #pragma is #pragma and sometimes you just have to bite the bullet 
and manually surround preprocessor directives with platform #ifdefs

     #ifndef __Z_OS__ /* or whatever is the platform tag for you */
     #pragma(foo)
     #endif

Classic porting_software_to_myPlatform() pain in the butt. Welcome to the club. 
I do it all the time because I'm on one of the less popular open source 
operating systems and have to constantly participate in our community porting 
process.

But once can use make and macros to do all sorts of things that can accomplish 
what you are trying to achieve.

> 2. What's a good learning source for make? 
> www.oreilly.com/openbook/make3/book/index.csp ?

That's a real good start. That's GNU make, by the way, which is way advanced 
over Sys V make. So the make command you have on your system may have issues 
with some things that work with GNU.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to