On 07.08.2017 21:33, Gonzalo GarramuƱo via Boost-users wrote:
El 07/08/17 a las 05:54, Peter Koukoulis via Boost-users escribiĆ³:
The files look as follows:
# the makefile: CC=g++ CFLAGS=-c -Wall -std=gnu++14 -lboost_system -lboost_thread -ldl -lpq
CFLAGS=-c -Wall -std=gnu++14 -DBOOST_THREAD_VERSION=5 LDFLAGS= -lboost_system -lboost_thread -ldl -lpq
Yes, and LDFLAGS should then be used in test_t rule. But, both by convention and by implicit rules implementation, the C++ compiler is contained in CXX variable (and not CC, which is supposed to be C compiler) with its compile flags being stored in CXXFLAGS variable. By properly setting CPPFLAGS (preprocessor flags (-I, -D, ...) for both CC and CXX) , CXXFLAGS, and LDFLAGS you can build test_t purely by using implicit rules. Cheers, Leon