-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildconf.mk
48 lines (39 loc) · 1.15 KB
/
buildconf.mk
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
40
41
42
43
44
45
46
47
48
# build environment
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
BUILD ?= $(ROOT_DIR)/build/out
DISTRO ?= DEBIAN
BUILD_BINDIR := $(BUILD)/bin
BUILD_LIBDIR := $(BUILD)/lib
BUILD_LIBEXEC_DIR := $(BUILD)/lib/syndicate
BUILD_INCLUDEDIR := $(BUILD)/include/
# install environment
DESTDIR ?=
PREFIX ?= /usr/local
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
LIBEXECDIR ?= $(DESTDIR)$(PREFIX)/lib/syndicate
INCLUDEDIR ?= $(DESTDIR)$(PREFIX)/include
PKGCONFIGDIR ?= $(DESTDIR)$(PREFIX)/lib/pkgconfig
# replica gateway
BUILD_RG := $(BUILD_BINDIR)
BUILD_RG_DIRS := $(BUILD_RG)
# compiler
CPPFLAGS := -std=c++11 -Wall -g -fPIC -fstack-protector -fstack-protector-all -pthread
CPP := c++ $(CPPFLAGS)
INC := -I. -I$(ROOT_DIR)
DEFS := -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_DISTRO_$(DISTRO) $(EXTRA_DEFS)
LIBINC := -L$(BUILD_LIBDIR)
# build setup
BUILD_DIRS := $(BUILD_RG_DIRS)
# misc
ifeq ($(DISTRO),DEBIAN)
LIBJSON ?= json-c
else
LIBJSON ?= json
endif
all:
build_setup: $(BUILD_DIRS)
$(BUILD_DIRS):
@mkdir -p $@
# debugging...
print-%: ; @echo $*=$($*)