RFC: Adding CPPFLAGS to Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

Klaus asked me to put this up for discussion:

At least Debian and Debian derivatives provide standard values for
CFLAGS/CXXFLAGS/LDFLAGS/CPPFLAGS/FFLAGS.

VDR's Makefile does not use CPPFLAGS (C-Pre-Processor flags) right now.
Not a big deal and easy to work-around, but for the sake of providing a
"standards-conform" Makefile I suggest adding CPPFLAGS as well.

Please see the attached patch.

It's only a suggestions and Klaus already indicated that such a change
might not make it into 2.0.0, so please don't panic, that all
plugin-Makefiles must be changed once again :-)

bye,

Tobias

Description: Add CPPFLAGS to Makefiles
Author: Tobias Grimm <tg@xxxxxxxxxx>

Index: vdr/Makefile
===================================================================
--- vdr.orig/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -114,14 +114,14 @@
 # Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 # Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
@@ -133,7 +133,7 @@
 # The libsi library:
 
 $(SILIB):
-	$(MAKE) --no-print-directory -C $(LSIDIR) CXXFLAGS="$(CXXFLAGS)" DEFINES="$(CDEFINES)" all
+	$(MAKE) --no-print-directory -C $(LSIDIR) CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" DEFINES="$(CDEFINES)" all
 
 # pkg-config file:
 
@@ -213,7 +213,7 @@
 	    if ! grep -q "PKGCFG" "$(PLUGINDIR)/src/$$i/Makefile" ; then\
 	       echo "WARNING: plugin $$i is using an old Makefile!";\
 	       oldmakefile="$$oldmakefile $$i";\
-	       $(MAKE) --no-print-directory -C "$(PLUGINDIR)/src/$$i" CFLAGS="$(CFLAGS) $(CDEFINES) $(CINCLUDES)" CXXFLAGS="$(CXXFLAGS) $(CDEFINES) $(CINCLUDES)" LIBDIR="$(PLUGINDIR)/lib" VDRDIR="$(CWD)" all || failed="$$failed $$i";\
+	       $(MAKE) --no-print-directory -C "$(PLUGINDIR)/src/$$i" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS) $(CDEFINES) $(CINCLUDES)" CXXFLAGS="$(CXXFLAGS) $(CDEFINES) $(CINCLUDES)" LIBDIR="$(PLUGINDIR)/lib" VDRDIR="$(CWD)" all || failed="$$failed $$i";\
 	       continue;\
 	       fi;\
 	    # New Makefile\
Index: vdr/PLUGINS/src/dvbhddevice/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/dvbhddevice/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/dvbhddevice/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -62,14 +62,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/dvbhddevice/libhdffcmd/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/dvbhddevice/libhdffcmd/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/dvbhddevice/libhdffcmd/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -27,14 +27,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $<
 
 ### Dependencies:
 
 MAKEDEP = $(CC) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(LIB_OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(DEFINES) $(INCLUDES) $(LIB_OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/dvbsddevice/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/dvbsddevice/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/dvbsddevice/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -61,14 +61,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/epgtableid0/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/epgtableid0/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/epgtableid0/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -61,14 +61,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/hello/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/hello/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/hello/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -62,14 +62,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/osddemo/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/osddemo/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/osddemo/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -61,14 +61,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/pictures/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/pictures/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/pictures/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -62,14 +62,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/rcu/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/rcu/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/rcu/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -61,14 +61,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/servicedemo/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/servicedemo/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/servicedemo/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -58,14 +58,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/skincurses/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/skincurses/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/skincurses/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -62,14 +62,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/status/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/status/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/status/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -61,14 +61,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/PLUGINS/src/svdrpdemo/Makefile
===================================================================
--- vdr.orig/PLUGINS/src/svdrpdemo/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/PLUGINS/src/svdrpdemo/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -61,14 +61,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/libsi/Makefile
===================================================================
--- vdr.orig/libsi/Makefile	2013-02-23 08:23:41.000000000 +0100
+++ vdr/libsi/Makefile	2013-02-23 08:27:58.000000000 +0100
@@ -18,14 +18,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
+	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
 
 ### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(CPPFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
Index: vdr/newplugin
===================================================================
--- vdr.orig/newplugin	2013-02-23 08:27:55.000000000 +0100
+++ vdr/newplugin	2013-02-23 08:31:21.000000000 +0100
@@ -121,14 +121,14 @@
 ### Implicit rules:
 
 %.o: %.c
-	\$(CXX) \$(CXXFLAGS) -c \$(DEFINES) \$(INCLUDES) -o \$\@ \$<
+	\$(CXX) \$(CPPFLAGS) \$(CXXFLAGS) -c \$(DEFINES) \$(INCLUDES) -o \$\@ \$<
 
 ### Dependencies:
 
 MAKEDEP = \$(CXX) -MM -MG
 DEPFILE = .dependencies
 \$(DEPFILE): Makefile
-	\@\$(MAKEDEP) \$(CXXFLAGS) \$(DEFINES) \$(INCLUDES) \$(OBJS:%.o=%.c) > \$\@
+	\@\$(MAKEDEP) \$(CPPFLAGS) \$(CXXFLAGS) \$(DEFINES) \$(INCLUDES) \$(OBJS:%.o=%.c) > \$\@
 
 -include \$(DEPFILE)
 
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux