Boost logo

Boost Users :

Subject: Re: [Boost-users] make file starting out
From: Leon Mlakar (leon_at_[hidden])
Date: 2017-08-08 11:04:30

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.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at