File: common.mk

package info (click to toggle)
swi-prolog 9.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 82,408 kB
  • sloc: ansic: 387,503; perl: 359,326; cpp: 6,613; lisp: 6,247; java: 5,540; sh: 3,147; javascript: 2,668; python: 1,900; ruby: 1,594; yacc: 845; makefile: 428; xml: 317; sed: 12; sql: 6
file content (39 lines) | stat: -rw-r--r-- 1,317 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Common Makefile definitions

RM=rm -f

# Get the latest swipl, built from head:
SWIPL:=$(realpath ../../../build/src/swipl)
PATH_WITH_SWIPL:=$(realpath ../../../build/src):$$PATH

# Where to find descriptor.proto:
PROTOC_DOTDOT:=$(realpath $(dir $(shell which protoc))/..)
PROTOC_INCLUDE=$(PROTOC_DOTDOT)/include
PROTOC_LIB:=$(PROTOC_DOTDOT)/lib

PROTOC_GEN_PROLOG_PB=gen_pb

# If SHELL is bash, can use `type -p protoc` instead of `which protoc`
# Requires having done "make" in ~/src/protobufs:
#   PROTOC:=$(realpath $(HOME)/src/protobuf/src/protoc)
PROTOC:=$(shell which protoc)
# Requires having LD_LIBRARY_PATH=$(realpath ../../../../protobuf/src/.libs):
#   PROTOC:=$(realpath $(HOME)/src/protobuf/src/.libs/protoc)

# If using $SRC/protobuf from git@github.com:protocolbuffers/protobuf.git:
#   -I$(SRC)/protobuf/src/google/protobuf
PROTOC_I=-I. -I../demo -I../interop -I$(PROTOC_INCLUDE)

# This is essentially what GNU Make 4.2.1 uses as a built-in rule:
#   CXX=g++
#   %o: %.cpp
# 	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $^

# Don't specify -Wall -- it produces warnings from the generated *.pb.cc files
CFLAGS=-O0
CXXFLAGS=-O0
# flags from pkg-config: -pthread -lprotobuf -lpthread
CPPFLAGS:=$(shell pkg-config --cflags protobuf)
LDFLAGS:=$(shell pkg-config --libs protobuf)

PYTHON:=$(shell which python3)