1c72fcc34Sopenharmony_ciSUBDIRS = init
2c72fcc34Sopenharmony_ci
3c72fcc34Sopenharmony_cisbin_PROGRAMS=alsactl
4c72fcc34Sopenharmony_ciman_MANS=alsactl.1
5c72fcc34Sopenharmony_ciif USE_XMLTO
6c72fcc34Sopenharmony_ciman_MANS += alsactl_init.7
7c72fcc34Sopenharmony_ciendif
8c72fcc34Sopenharmony_ciEXTRA_DIST=alsactl.1 alsactl_init.xml
9c72fcc34Sopenharmony_ci
10c72fcc34Sopenharmony_ciAM_CFLAGS = -D_GNU_SOURCE
11c72fcc34Sopenharmony_ci
12c72fcc34Sopenharmony_ciAM_CPPFLAGS = -I$(top_srcdir)/include
13c72fcc34Sopenharmony_ci
14c72fcc34Sopenharmony_cialsactl_SOURCES=alsactl.c state.c lock.c utils.c init_parse.c init_ucm.c \
15c72fcc34Sopenharmony_ci		daemon.c monitor.c clean.c info.c
16c72fcc34Sopenharmony_ci
17c72fcc34Sopenharmony_cialsactl_CFLAGS=$(AM_CFLAGS) -D__USE_GNU \
18c72fcc34Sopenharmony_ci               -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\" \
19c72fcc34Sopenharmony_ci               -DSYS_LOCKPATH=\"$(ASOUND_LOCK_DIR)\" \
20c72fcc34Sopenharmony_ci               -DSYS_LOCKFILE=\"asound.state.lock\" \
21c72fcc34Sopenharmony_ci               -DSYS_PIDFILE=\"$(ALSACTL_PIDFILE_DIR)/alsactl.pid\"
22c72fcc34Sopenharmony_ci
23c72fcc34Sopenharmony_cinoinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c \
24c72fcc34Sopenharmony_ci               init_utils_run.c init_sysfs.c
25c72fcc34Sopenharmony_ci
26c72fcc34Sopenharmony_ciudevrules_DATA = \
27c72fcc34Sopenharmony_ci	90-alsa-restore.rules
28c72fcc34Sopenharmony_ci
29c72fcc34Sopenharmony_ciif HAVE_SYSTEMD
30c72fcc34Sopenharmony_ci
31c72fcc34Sopenharmony_cisystemdsystemunit_DATA = \
32c72fcc34Sopenharmony_ci	alsa-state.service \
33c72fcc34Sopenharmony_ci	alsa-restore.service
34c72fcc34Sopenharmony_ci
35c72fcc34Sopenharmony_ciinstall-data-hook:
36c72fcc34Sopenharmony_ci	$(MKDIR_P) -m 0755 \
37c72fcc34Sopenharmony_ci		$(DESTDIR)$(systemdsystemunitdir)/sound.target.wants
38c72fcc34Sopenharmony_ci	( cd $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants && \
39c72fcc34Sopenharmony_ci		rm -f alsa-state.service alsa-restore.service && \
40c72fcc34Sopenharmony_ci		$(LN_S) ../alsa-state.service alsa-state.service && \
41c72fcc34Sopenharmony_ci		$(LN_S) ../alsa-restore.service alsa-restore.service)
42c72fcc34Sopenharmony_ci
43c72fcc34Sopenharmony_ciendif
44c72fcc34Sopenharmony_ci
45c72fcc34Sopenharmony_ciedit = \
46c72fcc34Sopenharmony_ci	$(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
47c72fcc34Sopenharmony_ci		  -e 's,@mydatadir\@,$(mydatadir),g' \
48c72fcc34Sopenharmony_ci		  -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
49c72fcc34Sopenharmony_ci		  -e 's,@asoundrcfile\@,$(ASOUND_STATE_DIR)/asound.state,g' \
50c72fcc34Sopenharmony_ci							< $< > $@ || rm $@
51c72fcc34Sopenharmony_ci
52c72fcc34Sopenharmony_cialsa-state.service: alsa-state.service.in
53c72fcc34Sopenharmony_ci	$(edit)
54c72fcc34Sopenharmony_ci
55c72fcc34Sopenharmony_cialsa-restore.service: alsa-restore.service.in
56c72fcc34Sopenharmony_ci	$(edit)
57c72fcc34Sopenharmony_ci
58c72fcc34Sopenharmony_ci90-alsa-restore.rules: 90-alsa-restore.rules.in
59c72fcc34Sopenharmony_ci	$(edit)
60c72fcc34Sopenharmony_ci
61c72fcc34Sopenharmony_ciEXTRA_DIST += \
62c72fcc34Sopenharmony_ci	alsa-state.service.in \
63c72fcc34Sopenharmony_ci	alsa-restore.service.in \
64c72fcc34Sopenharmony_ci	90-alsa-restore.rules.in
65c72fcc34Sopenharmony_ci
66c72fcc34Sopenharmony_ciCLEANFILES = \
67c72fcc34Sopenharmony_ci	alsa-state.service \
68c72fcc34Sopenharmony_ci	alsa-restore.service \
69c72fcc34Sopenharmony_ci	90-alsa-restore.rules
70c72fcc34Sopenharmony_ci
71c72fcc34Sopenharmony_ci%.7: %.xml
72c72fcc34Sopenharmony_ci	xmlto man $?
73