This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile.am
154 lines (119 loc) · 4.65 KB
/
Makefile.am
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
ACLOCAL_AMFLAGS = -I m4
VERSION_CURRENT = 0
VERSION_REVISION = 0
VERSION_AGE = 0
LIBCGMANAGER_VERSION = $(VERSION_CURRENT):$(VERSION_REVISION):$(VERSION_AGE)
LIBCGMANAGER_VERSION_DOTTED = $(VERSION_CURRENT).$(VERSION_REVISION).$(VERSION_AGE)
AM_CFLAGS = -Wall -ggdb -D_GNU_SOURCE -DSBINDIR=\"$(SBINDIR)\"
AM_CFLAGS += $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS)
AM_CFLAGS += -DLIBEXECDIR=\"$(LIBEXECDIR)\"
AM_LDFLAGS = $(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS)
client_files_OUTPUTS = cgmanager-client.c cgmanager-client.h
manager_files_OUTPUTS = org.linuxcontainers.cgmanager.c org.linuxcontainers.cgmanager.h
BUILT_SOURCES = $(manager_files_OUTPUTS) $(client_files_OUTPUTS)
CLEANFILES = \
$(manager_files_OUTPUTS) \
$(client_files_OUTPUTS) \
cgmanager cgproxy \
cgm-release-agent \
*.o *.so \
libcgmanager.pc.in
sbin_PROGRAMS = cgmanager cgproxy
bin_PROGRAMS = cgm
pkglibexec_PROGRAMS = cgm-release-agent
lib_LTLIBRARIES = libcgmanager.la
SUBDIRS = config
pkginclude_HEADERS = cgmanager-client.h cgmanager.h
if HAVE_HELP2MAN
man_MANS = cgm.1 cgproxy.8 cgmanager.8
endif
libcgmanager.pc: libcgmanager.pc.in
sed -e 's|[@]LIBCGMANAGER_VERSION_DOTTED[@]|$(LIBCGMANAGER_VERSION_DOTTED)|g' \
$< > $@
EXTRA_DIST = libcgmanager.pc.in.in cgmanager.spec cgm cgm.man.add \
cgmanager.man.add cgproxy.man.add tests/*.sh tests/*.c
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcgmanager.pc
$(manager_files_OUTPUTS): org.linuxcontainers.cgmanager.xml
$(AM_V_GEN)$(NIH_DBUS_TOOL) \
--package=cgmanager \
--mode=object \
--prefix=cgmanager \
--default-interface=org.linuxcontainers.cgmanager0_0 \
org.linuxcontainers.cgmanager.xml
$(client_files_OUTPUTS): org.linuxcontainers.cgmanager.xml
$(AM_V_GEN)$(NIH_DBUS_TOOL) \
--package=cgmanager \
--mode=proxy --prefix=cgmanager \
--default-interface=org.linuxcontainers.cgmanager0_0 \
--output=cgmanager-client.c \
org.linuxcontainers.cgmanager.xml
cgmanager_SOURCES = cgmanager.c \
$(manager_files_OUTPUTS) \
access_checks.h access_checks.c \
fs.c fs.h cgmanager.h \
frontend.c frontend.h
cgmanager_CFLAGS = $(AM_CFLAGS) -DCGMANAGER
cgproxy_SOURCES = cgmanager-proxy.c \
$(manager_files_OUTPUTS) \
access_checks.c access_checks.h \
fs.c fs.h cgmanager.h \
frontend.c frontend.h
cgm_release_agent_SOURCES = cgm-release-agent.c
cgm_release_agent_LDADD = -L.libs -lcgmanager
cgm_release_agent_DEPENDENCIES = libcgmanager.la
cgm_SOURCES = cgm.c cgmanager.h
cgm_LDADD = -L.libs -lcgmanager
cgm_DEPENDENCIES = libcgmanager.la
libcgmanager_la_SOURCES = \
$(client_files_OUTPUTS) \
org.linuxcontainers.cgmanager.xml
libcgmanager_la_CFLAGS = -fPIC -DPIC $(DBUS_CFLAGS) $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS)
libcgmanager_la_LDFLAGS = -E \
-version-info $(LIBCGMANAGER_VERSION)
libcgmanager_la_LIBADD = \
$(DBUS_LIBS) $(NIH_LIBS) $(NIH_DBUS_LIBS)
if HAVE_HELP2MAN
cgmanager.8: cgmanager.c cgmanager cgmanager.man.add
$(HELP2MAN) -n "a daemon to manage cgroups" -s 8 -I cgmanager.man.add -N ./cgmanager > cgmanager.8
cgproxy.8: cgmanager-proxy.c cgproxy cgproxy.man.add
$(HELP2MAN) -n "a proxy for cgmanager" -s 8 -I cgproxy.man.add -N ./cgproxy > cgproxy.8
cgm.1: cgm cgm.man.add
$(HELP2MAN) -n "a client script for cgmanager" -s 1 -I cgm.man.add -N ./cgm > cgm.1
endif
install-exec-local:
$(MKDIR_P) $(DESTDIR)$(datarootdir)/cgmanager/tests
cd tests; \
for f in *.sh; do \
install -c -m 755 $$f $(DESTDIR)$(datarootdir)/cgmanager/tests; \
done
rpm: dist
rpmbuild --clean -ta ${distdir}.tar.gz
TESTS_SCM: tests/scmtest.c
$(CC) -o tests/scmtest tests/scmtest.c
tests/nstest.o: tests/nstest.c
$(CC) -I. $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS) $(DBUS_CFLAGS) -c \
-fPIC -DPIC -o tests/nstest.o tests/nstest.c
TEST_NSTEST: tests/nstest.o
$(CCLD) -o tests/nstest tests/nstest.o \
$(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lcgmanager
tests/cgm-concurrent.o: tests/cgm-concurrent.c
$(CC) -I. $(NIH_CFLAGS) $(NIH_DBUS_CFLAGS) $(DBUS_CFLAGS) -c \
-fPIC -DPIC -o tests/cgm-concurrent.o tests/cgm-concurrent.c
TESTS_CGM_CONCURRENT: tests/cgm-concurrent.o
$(CCLD) -o tests/cgm-concurrent tests/cgm-concurrent.o \
$(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lpthread -lcgmanager
if HAVE_PAM
pam_LTLIBRARIES = pam_cgm.la
pam_cgm_la_SOURCES = pam/pam_cgm.c pam/cgmanager.c pam/cgmanager.h
pam_cgm_la_CFLAGS = $(AM_CFLAGS)
pam_cgm_la_LIBADD = $(AM_LIBS) $(PAM_LIBS) -L$(top_srcdir) -lpthread -lpopt -lcgmanager
pam_cgm_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -shared
pam_cgm_la_DEPENDENCIES = libcgmanager.la
install-data-hook: install-pamLTLIBRARIES
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.la"
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.a"
uninstall-local:
rm -f "$(DESTDIR)$(pamdir)/pam_cgm.so"
endif
tests: TESTS_CGM_CONCURRENT TESTS_SCM TEST_NSTEST