On Wed, Oct 18, 2017 at 2:25 PM, Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote: > >> Overriding is probably the wrong word. We just want to pass in a >> baseline set of CFLAGS and then make can add that on to whatever it likes. > > Yes, very usual. If you only want to pass some CFLAGS base line. Maybe some thing like: make CFLAGS_BASE=xxxx will serve the purpose? > >> IIUC, the CFLAGS variable is sort of an autotools-ism. We could call it >> something else, but that's sort of the bog-standard way that this is >> done. > > I tend to avoid autotool but CFLAGS and friends are used with (g)make > builtin rules, so yes, very standard (and probably predate autotool). Using make file builtin rules is discouraged. So there way I see it, there is no stander CFLAGS usage rule. e.g. Was CFLAGS the variable to pass in command line or CFLAGS_BASE can serve the same role as well? Sparse will not use autotool and automake. They make things a lot more complicate. Directly using GNU make is fine and over all simpler. If it gets more complicate, I prefer some thing like the Linux kernel config file. > >> FWIW, the weird bit here is that the ALL_CFLAGS variable gets reexpanded >> like you'd expect when you don't pass in CFLAGS on the command line. >> It's only when we do that this thing seems to break. >> >> That seems sort of unexpected, IMO, but since we're passing ALL_CFLAGS >> to gcc, it makes sense to add these extra options on there in the >> makefile. In my mind, ALL_CFLAGS is there to make normal CFLAGS and BASE_CFLAGS two separate group. So variable is never directly append to ALL_CFLAGS. So when ALL_CFLAGS expand, it will show up as: <normal cflags expanded here> <basic cflags expand here> Some times the options need to have order in them. In those case, having the grouping help establish the order. Because we are not using autotools cmake here. How to use the CFLAGS just need to be internal consistent with the project. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html