title: How to merge two separate c++ code files with make files
body: <p>I have two different source code files
  File A.cpp  with CMakeLists.txt and File B.cpp with Makefile. for e.g; </p>
  
  <pre><code>cmake_minimum_required(VERSION 2.6 FATAL_ERROR)       
  project(A)
  find_package(PCL 1.7 REQUIRED) ..... 
  </code></pre>
  
  <p>and Makefile as below`</p>
  
  <pre><code>OS_NAME ?=$(shell uname)                                                  
  LIBS = -lpthread                                                      
  LIB_NAME = AdsLib-$(OS_NAME).a                                        
  CXXFLAGS += -std=c++11                                                
  CXXFLAGS += -pedantic                                                 
  CXXFLAGS += -Wall                                                            
  CXXFLAGS += $(ci_cxx_flags) ifeq ($(OS_NAME),win32)
      LIBS += -lws2_32                       endif                          
      all: example.bin                                                      example.bin: $(LIB_NAME) example.cpp
  $(CXX) example.cpp $&lt; $(LIBS) $(CXXFLAGS) -o $@                          
    test: example.bin
  ./$&lt;                                                                               
   clean:
  rm -f *.o *.bin
  </code></pre>
  
  <p>Goal is to merge the two source code files A.cpp and B.cpp together or lets say to bring the functionality of B.cpp into A.cpp. 
  In A.cpp the data acquisition and processing is performed for a sensor and in B.cpp the communication is established between the PC and an embedded PC. 
  What I am looking for is to directly communicate from A.cpp to the embedded PC.
  To do that I want to merge the make files into a single make file which generates
  a single executable. </p>