mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS
@ 2012-06-26 13:41 Juergen Beisert
  2012-06-29 14:02 ` Michael Olbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Juergen Beisert @ 2012-06-26 13:41 UTC (permalink / raw)
  To: ptxdist

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>

diff --git a/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch 
b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
new file mode 100644
index 0000000..7222ffe
--- /dev/null
+++ b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
@@ -0,0 +1,32 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Date: Tue, 26 Jun 2012 15:30:00 +0200
+Subject: [PATCH] Let the build-system honor external defined CFLAGS and
+ LDFLAGS variables
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+---
+ Rules.make |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Rules.make b/Rules.make
+index 5ef8cef..fb5a5b5 100644
+--- a/Rules.make
++++ b/Rules.make
+@@ -6,7 +6,7 @@ HOSTCC = gcc
+ IFLAGS = -I$(TOPDIR)/include
+ #DFLAGS = -g
+ OFLAGS = -O2 -fomit-frame-pointer
+-CFLAGS = -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)
++CFLAGS += -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)
+ 
+ SRCS += $(wildcard *.c)
+ OBJS += $(subst .c,.o,$(SRCS))
+@@ -24,7 +24,7 @@ ifdef SUBDIRS
+ endif
+ 
+ $(TARGET):	$(OBJS)
+-		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
++		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS) $(LDFLAGS)
+ 
+ $(O_TARGET):	$(OBJS)
+ 		$(LD) -r -o $(O_TARGET) $(filter $(OBJS), $^)
diff --git a/patches/fbtest-20041102-1/series b/patches/fbtest-20041102-1/series
index a820fe8..15055b3 100644
--- a/patches/fbtest-20041102-1/series
+++ b/patches/fbtest-20041102-1/series
@@ -5,4 +5,5 @@
 0003-Workaround-for-a-gcc-compiler-bug.patch
 0004-remove-asm-page.h-use-sysconf.patch
 0005-add-install-target.patch
-# 9bb723ec368cacab6034723702d740a1  - git-ptx-patches magic
+0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
+# 0c97af2d952319b97e339bee2423856b  - git-ptx-patches magic

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS
  2012-06-26 13:41 [ptxdist] [PATCH] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS Juergen Beisert
@ 2012-06-29 14:02 ` Michael Olbrich
  2012-06-29 14:37   ` Juergen Beisert
  2012-06-29 14:44   ` [ptxdist] [PATCHv2] " Juergen Beisert
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Olbrich @ 2012-06-29 14:02 UTC (permalink / raw)
  To: ptxdist

On Tue, Jun 26, 2012 at 03:41:50PM +0200, Juergen Beisert wrote:
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> 
> diff --git a/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch 
> b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
> new file mode 100644
> index 0000000..7222ffe
> --- /dev/null
> +++ b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
> @@ -0,0 +1,32 @@
> +From: Juergen Beisert <jbe@pengutronix.de>
> +Date: Tue, 26 Jun 2012 15:30:00 +0200
> +Subject: [PATCH] Let the build-system honor external defined CFLAGS and
> + LDFLAGS variables
> +
> +Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> +---
> + Rules.make |    4 ++--
> + 1 files changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Rules.make b/Rules.make
> +index 5ef8cef..fb5a5b5 100644
> +--- a/Rules.make
> ++++ b/Rules.make
> +@@ -6,7 +6,7 @@ HOSTCC = gcc
> + IFLAGS = -I$(TOPDIR)/include
> + #DFLAGS = -g
> + OFLAGS = -O2 -fomit-frame-pointer
> +-CFLAGS = -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)
> ++CFLAGS += -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)
> + 
> + SRCS += $(wildcard *.c)
> + OBJS += $(subst .c,.o,$(SRCS))
> +@@ -24,7 +24,7 @@ ifdef SUBDIRS
> + endif
> + 
> + $(TARGET):	$(OBJS)
> +-		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
> ++		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS) $(LDFLAGS)

		$(CC) $(LDFLAGS) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)

I think. I'm not sure it makes a difference here, but in general LDFLAGS
should come first.

Michael

> + 
> + $(O_TARGET):	$(OBJS)
> + 		$(LD) -r -o $(O_TARGET) $(filter $(OBJS), $^)
> diff --git a/patches/fbtest-20041102-1/series b/patches/fbtest-20041102-1/series
> index a820fe8..15055b3 100644
> --- a/patches/fbtest-20041102-1/series
> +++ b/patches/fbtest-20041102-1/series
> @@ -5,4 +5,5 @@
>  0003-Workaround-for-a-gcc-compiler-bug.patch
>  0004-remove-asm-page.h-use-sysconf.patch
>  0005-add-install-target.patch
> -# 9bb723ec368cacab6034723702d740a1  - git-ptx-patches magic
> +0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
> +# 0c97af2d952319b97e339bee2423856b  - git-ptx-patches magic
> 
> -- 
> Pengutronix e.K.                              | Juergen Beisert             |
> Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCH] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS
  2012-06-29 14:02 ` Michael Olbrich
@ 2012-06-29 14:37   ` Juergen Beisert
  2012-06-29 14:44   ` [ptxdist] [PATCHv2] " Juergen Beisert
  1 sibling, 0 replies; 5+ messages in thread
From: Juergen Beisert @ 2012-06-29 14:37 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

Michael Olbrich wrote:
> [...]
> > +
> > + $(TARGET):	$(OBJS)
> > +-		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
> > ++		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS) $(LDFLAGS)
>
> 		$(CC) $(LDFLAGS) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
>
> I think. I'm not sure it makes a difference here, but in general LDFLAGS
> should come first.

I took a look into the built-in rules of "make":

To convert a C-file into a binary the following built-in rule will be used:

$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@

"LINK.c" is defined to:

LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)

Which results into the following line:

$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@

So, you could be right. I will change it.

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCHv2] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS
  2012-06-29 14:02 ` Michael Olbrich
  2012-06-29 14:37   ` Juergen Beisert
@ 2012-06-29 14:44   ` Juergen Beisert
  2012-06-29 15:32     ` Michael Olbrich
  1 sibling, 1 reply; 5+ messages in thread
From: Juergen Beisert @ 2012-06-29 14:44 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Olbrich

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>

diff --git a/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch 
b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
new file mode 100644
index 0000000..079a3a7
--- /dev/null
+++ b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
@@ -0,0 +1,32 @@
+From: Juergen Beisert <jbe@pengutronix.de>
+Date: Tue, 26 Jun 2012 15:30:00 +0200
+Subject: [PATCH] Let the build-system honor external defined CFLAGS and
+ LDFLAGS variables
+
+Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
+---
+ Rules.make |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Rules.make b/Rules.make
+index 5ef8cef..9b5baf4 100644
+--- a/Rules.make
++++ b/Rules.make
+@@ -6,7 +6,7 @@ HOSTCC = gcc
+ IFLAGS = -I$(TOPDIR)/include
+ #DFLAGS = -g
+ OFLAGS = -O2 -fomit-frame-pointer
+-CFLAGS = -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)
++CFLAGS += -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)
+ 
+ SRCS += $(wildcard *.c)
+ OBJS += $(subst .c,.o,$(SRCS))
+@@ -24,7 +24,7 @@ ifdef SUBDIRS
+ endif
+ 
+ $(TARGET):	$(OBJS)
+-		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
++		$(CC) $(LDFLAGS) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
+ 
+ $(O_TARGET):	$(OBJS)
+ 		$(LD) -r -o $(O_TARGET) $(filter $(OBJS), $^)
diff --git a/patches/fbtest-20041102-1/series b/patches/fbtest-20041102-1/series
index a820fe8..15055b3 100644
--- a/patches/fbtest-20041102-1/series
+++ b/patches/fbtest-20041102-1/series
@@ -5,4 +5,5 @@
 0003-Workaround-for-a-gcc-compiler-bug.patch
 0004-remove-asm-page.h-use-sysconf.patch
 0005-add-install-target.patch
-# 9bb723ec368cacab6034723702d740a1  - git-ptx-patches magic
+0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
+# 0c97af2d952319b97e339bee2423856b  - git-ptx-patches magic

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [PATCHv2] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS
  2012-06-29 14:44   ` [ptxdist] [PATCHv2] " Juergen Beisert
@ 2012-06-29 15:32     ` Michael Olbrich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Olbrich @ 2012-06-29 15:32 UTC (permalink / raw)
  To: ptxdist

On Fri, Jun 29, 2012 at 04:44:34PM +0200, Juergen Beisert wrote:
> Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> 
> diff --git a/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch 
> b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
> new file mode 100644
> index 0000000..079a3a7
> --- /dev/null
> +++ b/patches/fbtest-20041102-1/0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
> @@ -0,0 +1,32 @@
> +From: Juergen Beisert <jbe@pengutronix.de>
> +Date: Tue, 26 Jun 2012 15:30:00 +0200
> +Subject: [PATCH] Let the build-system honor external defined CFLAGS and
> + LDFLAGS variables
> +
> +Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
> +---
> + Rules.make |    4 ++--
> + 1 files changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Rules.make b/Rules.make
> +index 5ef8cef..9b5baf4 100644
> +--- a/Rules.make
> ++++ b/Rules.make
> +@@ -6,7 +6,7 @@ HOSTCC = gcc
> + IFLAGS = -I$(TOPDIR)/include
> + #DFLAGS = -g
> + OFLAGS = -O2 -fomit-frame-pointer
> +-CFLAGS = -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)
> ++CFLAGS += -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS)

Hmm, I just tested it, and the CPPFLAGS are not used. I think

CFLAGS += -Wall $(IFLAGS) $(DFLAGS) $(OFLAGS) $(CPPFLAGS)

is probably the easiest way to add it.

Michael

> + 
> + SRCS += $(wildcard *.c)
> + OBJS += $(subst .c,.o,$(SRCS))
> +@@ -24,7 +24,7 @@ ifdef SUBDIRS
> + endif
> + 
> + $(TARGET):	$(OBJS)
> +-		$(CC) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
> ++		$(CC) $(LDFLAGS) -o $(TARGET) $(filter $(OBJS), $^) $(LIBS)
> + 
> + $(O_TARGET):	$(OBJS)
> + 		$(LD) -r -o $(O_TARGET) $(filter $(OBJS), $^)
> diff --git a/patches/fbtest-20041102-1/series b/patches/fbtest-20041102-1/series
> index a820fe8..15055b3 100644
> --- a/patches/fbtest-20041102-1/series
> +++ b/patches/fbtest-20041102-1/series
> @@ -5,4 +5,5 @@
>  0003-Workaround-for-a-gcc-compiler-bug.patch
>  0004-remove-asm-page.h-use-sysconf.patch
>  0005-add-install-target.patch
> -# 9bb723ec368cacab6034723702d740a1  - git-ptx-patches magic
> +0006-Let-the-build-system-honor-external-defined-CFLAGS-a.patch
> +# 0c97af2d952319b97e339bee2423856b  - git-ptx-patches magic
> 
> -- 
> Pengutronix e.K.                              | Juergen Beisert             |
> Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-06-29 15:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26 13:41 [ptxdist] [PATCH] fbtest: Make its build-system aware of external CFLAGS and LDFLAGS Juergen Beisert
2012-06-29 14:02 ` Michael Olbrich
2012-06-29 14:37   ` Juergen Beisert
2012-06-29 14:44   ` [ptxdist] [PATCHv2] " Juergen Beisert
2012-06-29 15:32     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox