Build rpcgen-generated files when cross compiling

Roland McGrath roland@hack.frob.com
Wed Mar 14 18:02:00 GMT 2012


My inclination is still to do this with generic variables/rules.
The existing native-compile cases can be converted to use the same
machinery, so we have only one place where the decisions about
compiling for the build host are kept.

> +cross-rpcgen-objs = $(addprefix $(objpfx)cross-,$(rpcgen-objs))

Actually, it's better for this to be := since it's unconditionally used
right away.

> +$(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c
> +	$(make-target-directory)
> +	$(BUILD_CC) $< -c -D_GNU_SOURCE $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) \
> +		-DIS_IN_build $(OUTPUT_OPTION) $(compile-mkdep-flags)

There should never be -D switches directly in a rule like this.
They all ought to be in some variable.


Thanks,
Roland



More information about the Libc-alpha mailing list