message: Makefile: add CFLAGS and refactor CXXFLAGS to append to it
  Adding CFLAGS as the base C options, and appending C++ specific
  CXXFLAGS values to CFLAGS allows a common set of flags for both
  C and C++ without duplication.
  Rework the C example binaries to use $(CFLAGS) when building.
diff: @@ -18,7 +18,8 @@ ifeq ($(UNAME), Linux)
  EXE += daemon-binaries
  endif
  -CXXFLAGS += -Wall -g -O3 -Wno-unknown-pragmas -std=c++11 -fPIC
  +CFLAGS += -Wall -g -O3 -Wno-unknown-pragmas -fPIC
  +CXXFLAGS += $(CFLAGS) -std=c++11
  # uncomment if your Linux kernel supports access to /dev/mem from user space
  # CXXFLAGS += -DPCM_USE_PCI_MM_LINUX
  @@ -83,10 +84,10 @@ libpcm.so: $(COMMON_OBJS) pcm-core.o
  $(CXX) $(LDFLAGS) $(CXXFLAGS) -DPCM_SILENT -shared $^ $(LIB) -o $@
  c_example.x: c_example.c libpcm.so
  - $(CC) -DPCM_DYNAMIC_LIB $< -ldl -Wl,-rpath,$(shell pwd) -o $@
  + $(CC) $(CFLAGS) -DPCM_DYNAMIC_LIB $< -ldl -Wl,-rpath,$(shell pwd) -o $@
  c_example_shlib.x: c_example.c libpcm.so
  - $(CC) $< -L./ -Wl,-rpath,$(shell pwd) -lpcm -o $@
  + $(CC) $(CFLAGS) $< -L./ -Wl,-rpath,$(shell pwd) -lpcm -o $@
  %.o: %.cpp
  $(CXX) $(CXXFLAGS) -c $*.cpp -o $*.o
  