summaryrefslogtreecommitdiff
path: root/Make.config
blob: cc6942f2eba6ee44e8fa396eec46a51e9acda903 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Make.config
#
# See the README file for copyright information and how to reach the author.
#

# user defined stuff

PREFIX       = /usr/local
_BINDEST     = $(DESTDIR)$(PREFIX)/bin
BINDEST      = $(PREFIX)/bin
CACHEDIR     = /var/cache/epgd
_PLGDEST     = $(DESTDIR)$(PREFIX)/lib/epgd/plugins
PLGDEST      = $(PREFIX)/lib/epgd/plugins
CONFDEST     = $(DESTDIR)/etc/epgd
HTTPDEST     = $(DESTDIR)/var/epgd/www
DEBUG        = 1
#USE_CLANG   = 1

SYSTEMDDEST  = $(DESTDIR)/etc/systemd/system
UPSTARTDEST  = $(DESTDIR)/etc/init

# select your init system { none, upstart, systemd }

INIT_SYSTEM  = none
INIT_AFTER   = mysql.service

# ------------------
# don't touch below

ifdef USE_CLANG
  CC = clang++
else
  CC = g++
endif

doCompile = $(CC) -c $(CFLAGS) $(DEFINES)
doLink    = $(CC) $(LFLAGS)
doLib     = ar -rs

PLGSRCDIR = ./PLUGINS
TMPDIR = /tmp

USELIBXML = 1
USECURL = 1
USEJPEG = 1
USEPYTHON = 1
USEEPGS = 1
USEWOL = 1

USES = -DUSEUUID -DUSEMD5 -DUSELIBXML -DUSELIBARCHIVE -DUSEJSON -DUSEGUNZIP
DEFINES += -D_GNU_SOURCE -DBINDEST='"$(BINDEST)"' -DTARGET='"$(TARGET)"' -DLOG_PREFIX='""' -DPLGDIR='"$(PLGDEST)"' $(USES)

ifeq "$(INIT_SYSTEM)" "systemd"
  SYSD_NOTIFY = 1
endif

ifdef SYSD_NOTIFY
  SYSTEMD_VERSION_210 := $(shell expr `pkg-config --modversion libsystemd 2>/dev/null || echo 0` \>= 210)
  SYSTEMD_VERSION_209 := $(shell expr `pkg-config --modversion libsystemd 2>/dev/null || pkg-config --modversion libsystemd-daemon 2>/dev/null || echo "0"` \>= 209)

  ifeq "$(SYSTEMD_VERSION_210)" "1"
    SYSDLIB_210 = 1
  endif

  ifeq "$(SYSTEMD_VERSION_209)" "1"
    SYSDLIB_209 = 1
  endif

endif

ifdef USELIBXML
  DEFINES += $(shell xml2-config --cflags) $(shell xslt-config --cflags) $(shell python-config --includes)
endif

ifdef SYSD_NOTIFY
  ifdef SYSDLIB_209
    USES += -DSYSDWDIFO
  endif
  USES += -DUSESYSD
endif

ifdef DEBUG
  CFLAGS += -ggdb -fno-stack-protector -O0
endif

CFLAGS   += -fPIC -Wreturn-type -Wall -Wextra -Wparentheses -Wformat -pedantic \
              -Wno-long-long -Wunused-variable -Wunused-label -Wno-unused-result \
              -Wunused-value -Wunused-function -Wno-variadic-macros -Wunused-local-typedefs \
              -Wno-unused-parameter -Werror=format-security \
              -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

CFLAGS   += -std=c++11 -D__STDC_FORMAT_MACROS

ifdef USE_CLANG
  CFLAGS += -x c++ -Wunused-const-variable
else
  CXXFLAGS += -Wunused-but-set-variable -Wunused-but-set-parameter
endif

%.o: %.c
	$(doCompile) -o $@ $<