einpoklum
einpoklum

Reputation: 131626

clearmake doesn't like my MAKEFLAGS=j12 values

I use both GNU Make and - woe is me - ClearCase' clearmake.

Now, GNU make respect a flag named MAKEFLAGS, which for me is set to j20 on this multi-core machine I'm on. Unfortunately, clearmake also recognizes this option, yet doesn't except this value. It tells me:

clearmake: Error: Bad option (j)
clearmake: Error: Bad option (2)
clearmake: Error: Bad option (0)

Questions:

  1. Why is this happening? Should ClearMake accommodate GNU Make's usage?
  2. How can I get around it, other then turning the flag off an on repeatedly?

Upvotes: 1

Views: 225

Answers (3)

Brian Cowan
Brian Cowan

Reputation: 1073

Are you calling GNU make from a clearmake build script? Or are you trying to create a single makefile that will support both build tools? I think the GNUMAKEFLAGS EV is safer for GNU make specific values. I would also use

  • CCASE_MAKEFLAGS for any makeflags that are specific to clearmake.
  • CCASE_CONC to set the concurrency value. While clearmake no longer passes the -J in MAKEFLAGS, it used to, and if you're using an older clearmake (somewhere in the 7's as I recall), you could upset "child" GNU make sessions since they like -J about as much as clearmake likes -j.

Finally, check the env_ccase man page for the behavior mentioned in CCASE_MAKEFLAGS_V6_OBSOLETE. If you pass MAKEFLAGS explicitly in the build script like

$(MAKE) $(MAKEFLAGS) TARGET=x

And had started clearmake like this:

clearmake -C gnu TARGET=Y

You'll actually get both TARGET macro definitions in the command line. Setting the mentioned EV (at all) avoids the "pass defined macros in MAKEFLAGS" behavior. The switch exists because some people have makefiles that DEPEND on this behavior, while others have ones BROKEN BY this behavior...

Assuming for the sake of argument that your company has a support agreement with either IBM or HCL, this is a good time to use your support channels to bring up clearmake concerns.

Upvotes: 0

MadScientist
MadScientist

Reputation: 100856

It's been 15 years or so since I used clearmake, but assuming it doesn't support the GNU make-specific GNUMAKEFLAGS variable you can use:

export GNUMAKEFLAGS=-j20

and leave MAKEFLAGS unset.

Upvotes: 1

VonC
VonC

Reputation: 1324606

The "BUILDING SOFTWARE WITH CLEARCASE" clearly states in its T"unsupported Gnu make features" that this option is indeed not supported.

–j [JOBS]
--jobs=[JOBS]

Maybe a clearmake -C -J can help (for testing): there should then be no limit to the number of parallel builds.

Upvotes: 0

Related Questions