1. Yeah, a separate folder solves this problem while complicating other chores 
issues or requirements or habits or whatever. I suspect it is the only 
solution. Grrrrrrr.

2. You can't do it with a #pragma! #pragma options only supports C and this is 
C++. Go figure.

Make may be goodness for a thousand reasons but it does nothing for this 
problem, unless you happen to be happier with CD commands than with paths in DD 
statements (which many people are -- I am roughly equally happy with each).

Charles

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

Charles Mills wrote:
> For your specific "omit the problem file from the JCL" suggestion there are 
> no files in the JCL. //SYSIN specifies a UNIX folder and the compiler grabs 
> all of the .C or .c files.
Okay. Two Ideas and one "But Anyway"

 1. Move the problem file out of the folder, compile separately, put object in 
the object folder, run the JCL link step.
 2. Remove the OPT=ARCH(5) or whatever from the JCL and edit the corresponding 
#pragma into the source files.

"But Anyway"

    If they're not in a data set but already in a directory under OMVS, it's 
going to take a lot less time to learn
    'make' than to solve this any other way.

    ...
    ###################
    # Compilation rules
    ###################

    CC = c89
    LD = ld

    $(OBJDIR1)/%.o : $(SRCDIR1)/%.cpp
             $(CC) $(INC_PATH_FLAGS) $(CFLAGS1) -c $< -o $@

    $(OBJDIR2)/%.o : $(SRCDIR2)/%.cpp
             $(CC) $(INC_PATH_FLAGS) $(CFLAGS2) -c $< -o $@

    .. where the two different CFLAGS would have your different options in this 
very simple example
    There are other ways to pass different flags to different files aside from 
sorting them into different dirs.

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

Reply via email to