summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: cb7c5bc2d1c2d86735ecce6be876bf14603be197 (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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

SUBDIRS = .

# legacy rc script dir
rcdir=$(sysconfdir)/rc.d

# Inherit from systemd
systemdsysconfdir=$(sysconfdir)/systemd
systemconfigunitdir=$(systemdsysconfdir)/system
userconfigunitdir=$(systemdsysconfdir)/user
systemdignoreunitdir=$(systemdsysconfdir)/default-extra-dependencies
systemunitdir=$(rootprefix)/lib/systemd/system
userunitdir=$(prefix)/lib/systemd/user
udevlibexecdir=$(rootprefix)/lib/udev
udevhomedir=$(udevlibexecdir)
udevrulesdir=$(udevlibexecdir)/rules.d
if MOBILE
sysctldir=$(prefix)/lib/sysctl.d
endif

# And these are the special ones for /
rootprefix=@rootprefix@
rootbindir=$(rootprefix)/bin
rootlibexecdir=$(rootprefix)/lib/systemd

if WITH_ENGMODE
engbindir=/opt/usr/devel/$(rootbindir)
endif

if MOBILE
noinst_LTLIBRARIES =
noinst_DATA =
sysctl_DATA =
endif

bin_SCRIPTS =
rc_SCRIPTS =
SCRIPT_IN_FILES =
sysconf_DATA =
systemdsysconf_DATA =
systemdignoreunit_DATA =
systemconfigunit_DATA =
systemunit_DATA =
udevrules_DATA =

if WITH_ENGMODE
engbin_PROGRAMS =
endif

if MOBILE
AM_CPPFLAGS = \
	-include $(top_builddir)/config.h \
	-I $(top_srcdir)/src \
	-I $(top_srcdir)/src/shared \
	$(OUR_CPPFLAGS)

AM_CFLAGS = $(OUR_CFLAGS)
AM_LDFLAGS = $(OUR_LDFLAGS)
endif

INSTALL_EXEC_HOOKS =
UNINSTALL_EXEC_HOOKS =

SHUTDOWN_TARGET_WANTS =
LOCAL_FS_TARGET_WANTS =
BASIC_TARGET_WANTS =
SYSINIT_TARGET_WANTS =
SOCKETS_TARGET_WANTS =
TIMERS_TARGET_WANTS =
TIZEN_INIT_TARGET_WANTS =
TIZEN_BOOT_TARGET_WANTS =
TIZEN_SYSTEM_TARGET_WANTS =
TIZEN_RUNTIME_TARGET_WANTS =
MULTI_USER_TARGET_WANTS =
DEFAULT_TARGET_WANTS =
SYSCONF_LOCAL_FS_TARGET_WANTS =

if MOBILE
GRAPHICAL_TARGET_WANTS =
endif

install-target-wants-hook:
	where=$(systemunitdir) && what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && $(add-wants)
	where=$(systemunitdir) && what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && $(add-wants)
	where=$(systemunitdir) && what="$(BASIC_TARGET_WANTS)" && wants=basic.target && $(add-wants)
	where=$(systemunitdir) && what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && $(add-wants)
	where=$(systemunitdir) && what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants)
	where=$(systemunitdir) && what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants)
	where=$(systemunitdir) && what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants)
	where=$(systemunitdir) && what="$(SLICES_TARGET_WANTS)" && wants=slices.target && $(add-wants)
	where=$(systemunitdir) && what="$(TIZEN_INIT_TARGET_WANTS)" && wants=tizen-init.target && $(add-wants)
	where=$(systemunitdir) && what="$(TIZEN_BOOT_TARGET_WANTS)" && wants=tizen-boot.target && $(add-wants)
	where=$(systemunitdir) && what="$(TIZEN_SYSTEM_TARGET_WANTS)" && wants=tizen-system.target && $(add-wants)
	where=$(systemunitdir) && what="$(TIZEN_RUNTIME_TARGET_WANTS)" && wants=tizen-runtime.target && $(add-wants)
	where=$(systemunitdir) && what="$(TIZEN_RUNTIME_TARGET_WANTS)" && wants=tizen-runtime.target && $(add-wants)
if MOBILE
	where=$(systemunitdir) && what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && $(add-wants)
endif
	where=$(systemunitdir) && what="$(DEFAULT_TARGET_WANTS)" && wants=default.target && $(add-wants)
	where=$(systemconfigunitdir) && what="$(SYSCONF_LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && $(add-wants)

define add-wants
[ -z "$$what" -o -z "$$where" ] || ( \
	dir=$(DESTDIR)$$where/$$wants.wants && \
	$(MKDIR_P) -m 0755 $$dir && \
	cd $$dir && \
	rm -f $$what && \
	for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
endef

INSTALL_EXEC_HOOKS += \
	install-target-wants-hook

# ------------------------------------------------------------------------------
#  AM_V_M4 = $(AM_V_M4_$(V))
#  AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
#  AM_V_M4_0 = @echo "  M4      " $@;
#
#  AM_V_XSLT = $(AM_V_XSLT_$(V))
#  AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
#  AM_V_XSLT_0 = @echo "  XSLT    " $@;
#
#  AM_V_GPERF = $(AM_V_GPERF_$(V))
#  AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
#  AM_V_GPERF_0 = @echo "  GPERF   " $@;
#
#  AM_V_LN = $(AM_V_LN_$(V))
#  AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
#  AM_V_LN_0 = @echo "  LN      " $@;

# ------------------------------------------------------------------------------
if MOBILE
bin_SCRIPTS += \
	scripts/change-booting-mode.sh \
	scripts/cleanup-storage.sh \
	scripts/tizen-fstrim-on-charge.sh

systemunit_DATA += \
	units/check-mount.service \
	units/cleanup-storage.service \
	units/cleanup-storage.timer \
	units/ghost.service \
	units/init-conf.service \
	units/tizen-boot.target \
	units/tizen-fstrim-user.service \
	units/tizen-fstrim-user.timer \
	units/tizen-generate-env.service \
	units/tizen-init.target \
	units/tizen-init-check.service \
	units/tizen-init-done.service \
	units/tizen-initial-boot-done.service \
	units/tizen-journal-flush.service \
	units/tizen-readahead-collect.service \
	units/tizen-readahead-collect-stop.service \
	units/tizen-readahead-replay.service \
	units/tizen-runtime.target \
	units/tizen-system.target

SYSINIT_TARGET_WANTS += \
	init-conf.service

TIMERS_TARGET_WANTS += \
	cleanup-storage.timer

BASIC_TARGET_WANTS += \
	cleanup-storage.service \
	tizen-generate-env.service \
	tizen-init-check.service

TIZEN_INIT_TARGET_WANTS += \
	tizen-init-done.service \
	tizen-readahead-collect.service

MULTI_USER_TARGET_WANTS += \
	ghost.service \
	tizen-boot.target \
	tizen-runtime.target \
	tizen-system.target

GRAPHICAL_TARGET_WANTS += \
	tizen-fstrim-user.timer \
	tizen-initial-boot-done.service \
	tizen-journal-flush.service \
	tizen-readahead-replay.service

udevrules_DATA += \
	rules/51-tizen-udev-default.rules
else
bin_SCRIPTS += \
	scripts/change-booting-mode.sh \
	scripts/tizen-fstrim-on-charge.sh

systemunit_DATA += \
	units/check-mount.service \
	units/tizen-generate-env.service \
	units/tizen-readahead-collect.service \
	units/tizen-readahead-collect-stop.service \
	units/tizen-readahead-replay.service \
	units/tizen-fstrim-user.service \
	units/tizen-fstrim-user.timer \
	units/tizen-init.target \
	units/tizen-init-check.service \
	units/tizen-initial-boot-done.service \
	units/tizen-init-done.service

BASIC_TARGET_WANTS += \
	tizen-generate-env.service \
	tizen-init-check.service

TIZEN_INIT_TARGET_WANTS += \
	tizen-readahead-collect.service \
	tizen-init-done.service

MULTI_USER_TARGET_WANTS += \
	tizen-readahead-replay.service

DEFAULT_TARGET_WANTS += \
	tizen-fstrim-user.timer \
	tizen-initial-boot-done.service

udevrules_DATA += \
	rules/51-tizen-udev-default.rules
endif

systemdignoreunit_DATA += \
	conf/systemd/ignore-units

TIZEN_SYSTEM_TARGET_WANTS += \
	check-mount.service

if WITH_UDEVD_KILLER
systemunit_DATA += \
	units/systemd-udevd-kill.service \
	units/systemd-udevd-kill.timer

if MOBILE
GRAPHICAL_TARGET_WANTS += \
	systemd-udevd-kill.timer
else
DEFAULT_TARGET_WANTS += \
	systemd-udevd-kill.timer
endif
endif

if MOBILE
sysctl_DATA += \
	sysctl.d/50-tizen-default.conf
endif

if WITH_WMREADY
systemunit_DATA += \
	units/wm_ready.service

TIZEN_BOOT_TARGET_WANTS += \
	wm_ready.service
endif

if MOBILE
sysconf_DATA += \
	src/ghost/ghost.conf

ghost_SOURCES = \
	src/ghost/ghost.c

ghost_CFLAGS = \
	$(AM_CFLAGS) \
	$(DBUS_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GIO_CFLAGS)

bin_PROGRAMS = \
	ghost

ghost_LDADD = \
	libsystem-plugin-shared.la \
	$(DBUS_LIBS) \
	$(GLIB_LIBS) \
	$(GIO_LIBS)

# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
	libsystem-plugin-shared.la

libsystem_plugin_shared_la_SOURCES = \
	src/shared/conf-parser.c \
	src/shared/conf-parser.h \
	src/shared/dbus-common.h \
	src/shared/fileio.c \
	src/shared/fileio.h \
	src/shared/macro.h \
	src/shared/systemd.c \
	src/shared/systemd.h \
	src/shared/util.c \
	src/shared/util.h

libsystem_plugin_shared_la_CFLAGS = \
	$(AM_CFLAGS) \
        $(DBUS_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GIO_CFLAGS)

libsystem_plugin_shared_la_LIBADD = \
	$(DBUS_LIBS)
endif

# ------------------------------------------------------------------------------
substitutions = \
       '|rootlibexecdir=$(rootlibexecdir)|' \
       '|rootbindir=$(rootbindir)|' \
       '|bindir=$(bindir)|' \
       '|SYSTEMCTL=$(rootbindir)/systemctl|' \
       '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
       '|systemdsysconfdir=$(systemdsysconfdir)|' \
       '|SYSTEM_CONFIG_UNIT_PATH=$(systemdsysconfdir)/system|' \
       '|USER_CONFIG_UNIT_PATH=$(systemdsysconfdir)/user|' \
       '|pkgdatadir=$(pkgdatadir)|' \
       '|systemunitdir=$(systemunitdir)|' \
       '|userunitdir=$(userunitdir)|' \
       '|systempresetdir=$(systempresetdir)|' \
       '|userpresetdir=$(userpresetdir)|' \
       '|udevhwdbdir=$(udevhwdbdir)|' \
       '|udevrulesdir=$(udevrulesdir)|' \
       '|catalogdir=$(catalogdir)|' \
       '|tmpfilesdir=$(tmpfilesdir)|' \
       '|sysctldir=$(sysctldir)|' \
       '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
       '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
       '|PACKAGE_URL=$(PACKAGE_URL)|' \
       '|RANDOM_SEED=$(localstatedir)/lib/random-seed|' \
       '|prefix=$(prefix)|' \
       '|exec_prefix=$(exec_prefix)|' \
       '|libdir=$(libdir)|' \
       '|includedir=$(includedir)|' \
       '|VERSION=$(VERSION)|' \
       '|rootprefix=$(rootprefix)|' \
       '|udevlibexecdir=$(udevlibexecdir)|' \
       '|SUSHELL=$(SUSHELL)|' \
       '|DEBUGTTY=$(DEBUGTTY)|' \
       '|KILL=$(KILL)|' \
       '|KMOD=$(KMOD)|' \
       '|MKDIR_P=$(MKDIR_P)|' \
       '|QUOTAON=$(QUOTAON)|' \
       '|QUOTACHECK=$(QUOTACHECK)|' \
       '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
       '|VARLOGDIR=$(varlogdir)|' \
       '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
       '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
       '|PYTHON=$(PYTHON)|' \
       '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
       '|INITAILBOOT_DONE=$(INITAILBOOT_DONE)|' \
       '|INITIALIZE_DONE=$(INITIALIZE_DONE)|' \
       '|READAHEAD_DIR=$(READAHEAD_DIR)|' \
       '|DIRTY_WRITEBACK_CENTISECS=$(DIRTY_WRITEBACK_CENTISECS)|'

SED_PROCESS = \
	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
	$(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
		< $< > $@

units/%: units/%.in Makefile
	$(SED_PROCESS)

%.rules: %.rules.in Makefile
	$(SED_PROCESS)

%.sh: %.sh.in Makefile
	$(SED_PROCESS)
	$(AM_V_GEN)chmod +x $@

if MOBILE
src/%: src/%.m4
	$(AM_V_at)$(MKDIR_P) $(dir $@)
	$(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@

sysctl.d/%: sysctl.d/%.in Makefile
	$(SED_PROCESS)
endif

units/%: units/%.m4 Makefile
	$(AM_V_M4)$(MKDIR_P) $(dir $@)
	$(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@

install-exec-hook: $(INSTALL_EXEC_HOOKS)