[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CFLAGS and other flag variables
From: |
Sébastien Hinderer |
Subject: |
Re: CFLAGS and other flag variables |
Date: |
Tue, 16 Jul 2024 15:47:53 +0200 |
Hello,
I'd say to keep all your C compiler flags in a separate variable,
MY_CFLAGS, say.
Then your rule shoudlmention the two variables, e.g.:
%.o: %.c
$(CC) $(MY_CFLAGS) $(CFLAGS) -c $<
In this way, users can specify the CFLAGS they want without risking to
accidentally override something the build system wants. And at the same
timethey have the lastword.
Same goesfor CPPFLAGS, LDFLAGS etc.
hth,
Seb.