-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
112 lines (90 loc) · 3.18 KB
/
Makefile
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
102
103
104
105
106
107
108
109
110
111
112
#
# Build targets
#
SHELL := /bin/bash
A_LIBRARIES := libdsme
SO_LIBRARIES := libdsme libdsme_dbus_if
VERSION := 0.60.28
#
# Install files in this directory
#
INSTALL_PERM := 644
INSTALL_OWNER := $(shell id -u)
INSTALL_GROUP := $(shell id -g)
INSTALL_A_LIBRARIES := libdsme.a
$(INSTALL_A_LIBRARIES) : INSTALL_DIR := $(DESTDIR)/usr/lib
INSTALL_SO_LIBRARIES := libdsme.so libdsme_dbus_if.so
$(INSTALL_SO_LIBRARIES): INSTALL_PERM := 755
$(INSTALL_SO_LIBRARIES): INSTALL_DIR := $(DESTDIR)/usr/lib
INSTALL_INCLUDES := include/dsme/protocol.h \
include/dsme/messages.h \
include/dsme/processwd.h \
include/dsme/state.h \
include/dsme/state_states.h \
modules/dsme_dbus_if.h
$(INSTALL_INCLUDES) : INSTALL_DIR := $(DESTDIR)/usr/include/dsme
#INSTALL_OTHER := README
#README: INSTALL_DIR := $(DESTDIR)/usr/share/doc/dsme
INSTALL_OTHER := dsme.pc dsme_dbus_if.pc
dsme.pc : INSTALL_DIR := $(DESTDIR)/usr/lib/pkgconfig
dsme_dbus_if.pc : INSTALL_DIR := $(DESTDIR)/usr/lib/pkgconfig
#
# Compiler and tool flags
# C_OPTFLAGS are not used for debug builds (ifdef DEBUG)
# C_DBGFLAGS are not used for normal builds
#
C_GENFLAGS := -DPRG_VERSION=$(VERSION) -pthread -g \
-Wall -Wwrite-strings -Wmissing-prototypes -Werror# -pedantic
C_OPTFLAGS := -O2 -s
C_DBGFLAGS := -g -DDEBUG -DDSME_LOG_ENABLE
C_DEFINES := DSME_POSIX_TIMER DSME_WD_SYNC DSME_BMEIPC
C_INCDIRS := $(TOPDIR)/include $(TOPDIR)/modules $(TOPDIR)
MKDEP_INCFLAGS := $$(pkg-config --cflags-only-I glib-2.0)
LD_GENFLAGS := -pthread
LD_LIBPATHS := $(TOPDIR)
# If OSSO_DEBUG is defined, compile in the logging
#ifdef OSSO_LOG
C_OPTFLAGS += -DDSME_LOG_ENABLE
#endif
ifneq (,$(findstring DSME_BMEIPC,$(C_DEFINES)))
export DSME_BMEIPC = yes
endif
ifneq (,$(findstring DSME_MEMORY_THERMAL_MGMT,$(C_DEFINES)))
export DSME_MEMORY_THERMAL_MGMT = yes
endif
#
# Target composition and overrides
#
# libdsme.so and libdsme.a
protocol.o : C_EXTRA_GENFLAGS := -fPIC $$(pkg-config --cflags glib-2.0)
message.o : C_EXTRA_GENFLAGS := -fPIC
libdsme_C_OBJS := protocol.o message.o
libdsme_EXTRA_LDFLAGS := $$(pkg-config --libs glib-2.0)
libdsme.so : LIBRARY_VERSION := 0.2.0
# libdsme_dbus_if.so
libdsme_dbus_if_C_OBJS := modules/dsme_dbus_if.o
modules/dsme_dbus_if.o: C_EXTRA_GENFLAGS := -fPIC
libdsme_dbus_if.so : LIBRARY_VERSION := 0.2.0
# TODO: move dsme-exec-helper to modules/
# dsme-exec-helper
dsme-exec-helper_C_OBJS := dsme-exec-helper.o oom.o
dsme-exec-helper.o : C_EXTRA_GENFLAGS := $$(pkg-config --cflags glib-2.0)
#
# This is the topdir for build
#
TOPDIR := $(shell /bin/pwd)
#
# Non-target files/directories to be deleted by distclean
#
DISTCLEAN_DIRS := doc tags
#DISTCLN_SUBDIRS := _distclean_tests
#
# Actual rules
#
include $(TOPDIR)/Rules.make
.PHONY: tags
tags:
find . -name '*.[hc]' |xargs ctags
.PHONY: doc
doc:
doxygen