|
| 1 | +# Copyright 2019 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# A simple Makefile to test the `install` target. |
| 16 | +# |
| 17 | +# This is not intended to be a demonstration of how to write good Makefiles, |
| 18 | +# nor is it a general solution on how to build Makefiles for google-cloud-cpp. |
| 19 | +# It is simply a minimal file to test the installed pkg-config support files. |
| 20 | + |
| 21 | +# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for |
| 22 | +# our tests, but applications would typically make them configurable parameters. |
| 23 | +CXX=g++ -std=c++11 |
| 24 | +CXXLD=$(CXX) |
| 25 | + |
| 26 | +all: main |
| 27 | + |
| 28 | +# Configuration variables to compile and link against the library. |
| 29 | +PROTOS := googleapis_cpp_cloud_bigquery_protos |
| 30 | +CXXFLAGS := $(shell pkg-config $(PROTOS) --cflags) |
| 31 | +CXXLDFLAGS := $(shell pkg-config $(PROTOS) --libs-only-L) |
| 32 | +LIBS := $(shell pkg-config $(PROTOS) --libs-only-l) |
| 33 | + |
| 34 | +# A target using the Google Cloud Storage C++ client library. |
| 35 | +main: main.cc |
| 36 | + $(CXXLD) $(CXXFLAGS) $(CXXFLAGS) $(CXXLDFLAGS) -o $@ $^ $(LIBS) |
0 commit comments