summaryrefslogtreecommitdiff
path: root/Make.config
blob: 7f78843797d7768a0503ea9d4430b3d43b916135 (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
# 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

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

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

INIT_SYSTEM  = systemd
INIT_AFTER   = mysql.service

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

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

CC        = g++
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)

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 -Wextra -Wno-unused-parameter -Wreturn-type -Wall -Wno-parentheses -Wformat -pedantic \
          -Wunused-variable -Wunused-label \
          -Werror=format-security -Wparentheses \
          -Wunused-value -Wunused-function -Wno-long-long \
          -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

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