Author Topic: how to force Make to pass "-std=gnu89" to gcc?  (Read 1442 times)

0 Members and 1 Guest are viewing this topic.

Offline 0dbTopic starter

  • Frequent Contributor
  • **
  • Posts: 336
  • Country: zm
how to force Make to pass "-std=gnu89" to gcc?
« on: April 13, 2020, 05:54:35 pm »
I tried several combinations, including export CFLAGS="-std=gnu89", and it didn't work.
I don't have skills with GNU, and I have several projects that need to be compiled with -std=gnu89.
How to force Make to pass it to Gcc without editing each Makefile?
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: how to force Make to pass "-std=gnu89" to gcc?
« Reply #1 on: April 13, 2020, 07:52:48 pm »
As long as you have a proper shell inheritance
configured in your system, jut do:

export CC="gcc -std=gnu89"

Paul
 
The following users thanked this post: 0db

Offline 0dbTopic starter

  • Frequent Contributor
  • **
  • Posts: 336
  • Country: zm
Re: how to force Make to pass "-std=gnu89" to gcc?
« Reply #2 on: April 13, 2020, 08:49:06 pm »
wow, it worked even with Gcc 9.2 ;D

Code: [Select]
export CC="gcc -std=gnu89 -fgnu89-inline"
Problem solved. Thank you so much!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf