CPPFLAGS is for pre-processor options (-I and -D), CFLAGS is for
compiler options (-Wall).  Of course, the pkg-config integration
with autotools doesn't seem to separate them :)

Targets that set their own target_CFLAGS or target_LDFLAGS will
not use the defaults set in the AM_ variables, so include those
as well to make sure we're just adding to the flags list.

Signed-off-by: Chris Leech <[email protected]>
---

 Makefile.am |   29 +++++++++++------------------
 1 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 61027fd..a1349a3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,34 +2,27 @@
 sbin_PROGRAMS = fcoeadm fcoemon fcping fipvlan fcnsq fcrls
 
 ## all targets should look for headers in the include directory
-AM_CPPFLAGS = -Wall -I${srcdir}/include
-
 ## pass the sysconfdir into the C proprocessor
-AM_CFLAGS = -DSYSCONFDIR="\"${sysconfdir}\""
+AM_CPPFLAGS = -I${srcdir}/include -DSYSCONFDIR="\"${sysconfdir}\""
+AM_CFLAGS = -Wall
 
 ## rules for building fcoeadm
 fcoeadm_SOURCES = fcoeadm.c fcoeadm_display.c
 fcoeadm_LDADD = lib/libutil.a
-
-## fcoeadm uses HBAAPI, so get the right flags for compiling and linking
-fcoeadm_CFLAGS = $(HBAAPI_CFLAGS)
-fcoeadm_LDFLAGS = $(HBAAPI_LIBS)
-
-## rules for building fcping
-fcping_SOURCES = fcping.c
-fcping_LDADD = lib/libutil.a
-
-## fcping uses HBAAPI, so get the right flags for compiling and linking
-fcping_CFLAGS = $(HBAAPI_CFLAGS)
-fcping_LDFLAGS = $(HBAAPI_LIBS) -lrt
+fcoeadm_CFLAGS = $(AM_CFLAGS) $(HBAAPI_CFLAGS)
+fcoeadm_LDFLAGS = $(AM_LDFLAGS) $(HBAAPI_LIBS)
 
 ## rules for building fcoemon
 fcoemon_SOURCES = fcoemon.c
 fcoemon_LDADD = lib/libutil.a
+fcoemon_CFLAGS = $(AM_CFLAGS) $(DCBD_CFLAGS)
+fcoemon_LDFLAGS = $(AM_LDFLAGS) -lrt
 
-## fcoemon needs headers from dcbd, get the right include path for them
-fcoemon_CFLAGS = $(DCBD_CFLAGS)
-fcoemon_LDFLAGS = -lrt
+## rules for building fcping
+fcping_SOURCES = fcping.c
+fcping_LDADD = lib/libutil.a
+fcping_CFLAGS = $(AM_CFLAGS) $(HBAAPI_CFLAGS)
+fcping_LDFLAGS = $(AM_LDFLAGS) $(HBAAPI_LIBS) -lrt
 
 ## rules for building fipvlan
 fipvlan_SOURCES = fipvlan.c

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to