With this small change it is possible to build flashrom again when specifying custom CFLAGS from the make command line like:
make CFLAGS="..."
I need to do this when building flashrom in a cross compiler environment like buildroot for a foreign target.
Signed-of-by: Clark Rawlins clark@bit63.org
Please guide me if I have not completed all the required steps or if my patch isn't quite ready.
Clark
On Tue, Feb 12, 2008 at 02:37:37PM -0500, Clark Rawlins wrote:
With this small change it is possible to build flashrom again when specifying custom CFLAGS from the make command line like:
make CFLAGS="..."
I need to do this when building flashrom in a cross compiler environment like buildroot for a foreign target.
Signed-of-by: Clark Rawlins clark@bit63.org
Please guide me if I have not completed all the required steps or if my patch isn't quite ready.
Untested yet, but looks good to me. Can you post another patch which also does the same for LDFLAGS etc. while we're at it?
Index: Makefile
--- Makefile (revision 3101) +++ Makefile (working copy) @@ -32,7 +32,7 @@ # of the checked out flashrom files. SVNDEF := -D'FLASHROM_VERSION="$(shell svnversion -cn . \ | sed -e "s/.*://" -e "s/([0-9]*).*/\1/")"' -CFLAGS += $(SVNDEF) +FLASHROM_CFLAGS = $(CFLAGS) $(SVNDEF)
$(PROGRAM): $(OBJS) $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) @@ -69,3 +69,5 @@
-include .dependencies
+%.o : %.c
- $(CC) -c $(FLASHROM_CFLAGS) $(CPPFLAGS) $< -o $@
Thanks, Uwe.
On Tue, 2008-02-12 at 21:22 +0100, Uwe Hermann wrote:
On Tue, Feb 12, 2008 at 02:37:37PM -0500, Clark Rawlins wrote:
With this small change it is possible to build flashrom again when specifying custom CFLAGS from the make command line like:
make CFLAGS="..."
I need to do this when building flashrom in a cross compiler environment like buildroot for a foreign target.
Signed-of-by: Clark Rawlins clark@bit63.org
Please guide me if I have not completed all the required steps or if my patch isn't quite ready.
Untested yet, but looks good to me. Can you post another patch which also does the same for LDFLAGS etc. while we're at it?
I am not sure that LDFLAGS needs the same treatment. CFLAGS for flashrom.c at least is broken because flashrom.c uses the FLASHROM_VERSION define to print a message to the user. I doubt that anyone who is building flashrom should really be changing the FLASHROM_VERSION define without confusing the end user and anyone supporting it.
On the LDFLAGS could be overridden for a number of reasons in a cross compiler environment depending on how and where the libraries that are being linked in are located.
Here is a second attempt to fix the problem in a more precise way. This patch doesn't define FLASHROM_VERSION for every .o target, it only adds the SVNDEF to the compiler options for flashrom.o.
Is this better?
Signed-of-by: Clark Rawlins clark@bit63.org
Index: Makefile
--- Makefile (revision 3101) +++ Makefile (working copy) @@ -32,7 +32,7 @@ # of the checked out flashrom files. SVNDEF := -D'FLASHROM_VERSION="$(shell svnversion -cn . \ | sed -e "s/.*://" -e "s/([0-9]*).*/\1/")"' -CFLAGS += $(SVNDEF) +FLASHROM_CFLAGS = $(CFLAGS) $(SVNDEF)
$(PROGRAM): $(OBJS) $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) @@ -69,3 +69,5 @@
-include .dependencies
+%.o : %.c
- $(CC) -c $(FLASHROM_CFLAGS) $(CPPFLAGS) $< -o $@
Thanks, Uwe.
Ping?
Is this attempt any better?
On Tue, 2008-02-12 at 21:22 +0100, Uwe Hermann wrote:
On Tue, Feb 12, 2008 at 02:37:37PM -0500, Clark Rawlins wrote:
With this small change it is possible to build flashrom again when specifying custom CFLAGS from the make command line like:
make CFLAGS="..."
I need to do this when building flashrom in a cross compiler environment like buildroot for a foreign target.
Signed-of-by: Clark Rawlins clark@bit63.org
Please guide me if I have not completed all the required steps or if my patch isn't quite ready.
Untested yet, but looks good to me. Can you post another patch which also does the same for LDFLAGS etc. while we're at it?
I am not sure that LDFLAGS needs the same treatment. CFLAGS for flashrom.c at least is broken because flashrom.c uses the FLASHROM_VERSION define to print a message to the user. I doubt that anyone who is building flashrom should really be changing the FLASHROM_VERSION define without confusing the end user and anyone supporting it.
On the LDFLAGS could be overridden for a number of reasons in a cross compiler environment depending on how and where the libraries that are being linked in are located.
Here is a second attempt to fix the problem in a more precise way. This patch doesn't define FLASHROM_VERSION for every .o target, it only adds the SVNDEF to the compiler options for flashrom.o.
Is this better?
Signed-of-by: Clark Rawlins clark@bit63.org
Index: Makefile
--- Makefile (revision 3101) +++ Makefile (working copy) @@ -32,7 +32,7 @@ # of the checked out flashrom files. SVNDEF := -D'FLASHROM_VERSION="$(shell svnversion -cn . \ | sed -e "s/.*://" -e "s/([0-9]*).*/\1/")"' -CFLAGS += $(SVNDEF) +FLASHROM_CFLAGS = $(CFLAGS) $(SVNDEF)
$(PROGRAM): $(OBJS) $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) @@ -69,3 +69,5 @@
-include .dependencies
+%.o : %.c
- $(CC) -c $(FLASHROM_CFLAGS) $(CPPFLAGS) $< -o $@
Thanks, Uwe.
Acked-by: Ronald G. Minnich rminnich@gmail.com
Hi,
On Wed, Feb 13, 2008 at 03:15:09PM -0500, Clark Rawlins wrote:
Is this attempt any better?
IMHO yes, committed in r3102. It allows to override both CFLAGS and LDFLAGS now (tested).
Signed-of-by: Clark Rawlins clark@bit63.org
That's '-off-' not '-of-' btw.
Cheers, Uwe.