summaryrefslogtreecommitdiffstats
path: root/scrub/Makefile.in
blob: c97a1dd57fa01ed0701fcdadeace5971bcc4f235 (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
#
# Makefile for e2scrub
#

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
top_builddir = ..
my_dir = scrub
INSTALL = @INSTALL@
MKDIR_P = @MKDIR_P@

@MCONFIG@

PROGS=		e2scrub e2scrub_all
MANPAGES=	e2scrub.8 e2scrub_all.8
CONFFILES=	e2scrub.conf

ifeq ($(HAVE_UDEV),yes)
UDEV_RULES	= e2scrub.rules
UDISKS_RULES	= ext4.rules
INSTALLDIRS_TGT	+= installdirs-udev
INSTALL_TGT	+= install-udev
UNINSTALL_TGT	+= uninstall-udev
endif

ifeq ($(HAVE_CROND),yes)
CRONTABS	= e2scrub_all.cron
LIBPROGS	+= e2scrub_all_cron
INSTALLDIRS_TGT	+= installdirs-crond installdirs-libprogs
INSTALL_TGT	+= install-crond install-libprogs
UNINSTALL_TGT	+= uninstall-crond uninstall-libprogs
endif

ifeq ($(HAVE_SYSTEMD),yes)
SERVICE_FILES	= e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service
LIBPROGS	+= e2scrub_fail
INSTALLDIRS_TGT	+= installdirs-systemd installdirs-libprogs
INSTALL_TGT	+= install-systemd install-libprogs
UNINSTALL_TGT	+= uninstall-systemd uninstall-libprogs
endif

all:: $(PROGS) $(MANPAGES) $(CONFFILES) $(UDEV_RULES) $(UDISKS_RULES) $(SERVICE_FILES) $(CRONTABS) $(LIBPROGS)

e2scrub: $(DEP_SUBSTITUTE) e2scrub.in
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/e2scrub.in $@
	$(Q) chmod a+x $@

e2scrub_all: e2scrub_all.in
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/e2scrub_all.in $@
	$(Q) chmod a+x $@

e2scrub_fail: e2scrub_fail.in
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/e2scrub_fail.in $@
	$(Q) chmod a+x $@

e2scrub_all_cron: e2scrub_all_cron.in
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/e2scrub_all_cron.in $@
	$(Q) chmod a+x $@

%.8: %.8.in $(DEP_SUBSTITUTE)
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $< $@

%.conf: %.conf.in $(DEP_SUBSTITUTE)
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $< $@

%.rules: %.rules.in $(DEP_SUBSTITUTE)
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $< $@

%.service: %.service.in $(DEP_SUBSTITUTE)
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $< $@

%.cron: %.cron.in $(DEP_SUBSTITUTE)
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $< $@

%.timer: %.timer.in $(DEP_SUBSTITUTE)
	$(E) "	SUBST $@"
	$(Q) $(SUBSTITUTE_UPTIME) $< $@

installdirs-udev:
	$(E) "	MKDIR_P $(UDEV_RULES_DIR)"
	$(Q) $(MKDIR_P) $(DESTDIR)$(UDEV_RULES_DIR)

installdirs-crond:
	$(E) "	MKDIR_P $(CROND_DIR)"
	$(Q) $(MKDIR_P) $(DESTDIR)$(CROND_DIR)

installdirs-libprogs:
	$(E) "	MKDIR_P $(pkglibexecdir)"
	$(Q) $(MKDIR_P) $(DESTDIR)$(pkglibexecdir)

installdirs-systemd:
	$(E) "	MKDIR_P $(SYSTEMD_SYSTEM_UNIT_DIR)"
	$(Q) $(MKDIR_P) $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)

installdirs: $(INSTALLDIRS_TGT)
	$(E) "	MKDIR_P $(root_sbindir) $(man8dir) $(root_sysconfdir)"
	$(Q) $(MKDIR_P) $(DESTDIR)$(root_sbindir) \
		$(DESTDIR)$(man8dir) $(DESTDIR)$(root_sysconfdir)

install-udev: installdirs-udev
	$(Q) for i in $(UDEV_RULES); do \
		$(ES) "	INSTALL $(UDEV_RULES_DIR)/$$i"; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR)/96-$$i; \
	done
	$(Q) for i in $(UDISKS_RULES); do \
		$(ES) "	INSTALL $(UDEV_RULES_DIR)/$$i"; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR)/64-$$i; \
	done

install-crond: installdirs-crond
	$(Q) if test -n "$(CRONTABS)" ; then \
		$(ES) "	INSTALL $(CROND_DIR)/e2scrub_all" ; \
		$(INSTALL_DATA) e2scrub_all.cron $(DESTDIR)$(CROND_DIR)/e2scrub_all ; \
	fi

install-libprogs: $(LIBPROGS) installdirs-libprogs
	$(Q) for i in $(LIBPROGS); do \
		$(ES) "	INSTALL $(pkglibexecdir)/$$i"; \
		$(INSTALL_PROGRAM) $$i $(DESTDIR)$(pkglibexecdir)/$$i; \
	done

install-systemd: $(SERVICE_FILES) installdirs-systemd
	$(Q) for i in $(SERVICE_FILES); do \
		$(ES) "	INSTALL_DATA $(SYSTEMD_SYSTEM_UNIT_DIR)/$$i"; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)/$$i; \
	done

install-strip: install

install: $(PROGS) $(MANPAGES) $(FMANPAGES) installdirs $(INSTALL_TGT)
	$(Q) for i in $(PROGS); do \
		$(ES) "	INSTALL $(root_sbindir)/$$i"; \
		$(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
	done
	$(Q) for i in $(MANPAGES); do \
		for j in $(COMPRESS_EXT); do \
			$(RM) -f $(DESTDIR)$(man8dir)/$$i.$$j; \
		done; \
		$(ES) "	INSTALL_DATA $(man8dir)/$$i"; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
	done
	$(Q) for i in $(CONFFILES); do \
		$(ES) "	INSTALL_DATA $(root_sysconfdir)/$$i"; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(root_sysconfdir)/$$i; \
	done

uninstall-udev:
	for i in $(UDEV_RULES); do \
		$(RM) -f $(DESTDIR)$(UDEV_RULES_DIR)/96-$$i; \
	done
	for i in $(UDISKS_RULES); do \
		$(RM) -f $(DESTDIR)$(UDEV_RULES_DIR)/64-$$i; \
	done

uninstall-crond:
	if test -n "$(CRONTABS)" ; then \
		$(RM) -f $(DESTDIR)$(CROND_DIR)/e2scrub_all ; \
	fi

uninstall-libprogs:
	for i in $(LIBPROGS); do \
		$(RM) -f $(DESTDIR)$(pkglibexecdir)/$$i; \
	done

uninstall-systemd:
	for i in $(SERVICE_FILES); do \
		$(RM) -f $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)/$$i; \
	done

uninstall: $(UNINSTALL_TGT)
	for i in $(PROGS); do \
		$(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
	done
	for i in $(MANPAGES); do \
		$(RM) -f $(DESTDIR)$(man8dir)/$$i; \
	done
	for i in $(CONFFILES); do \
		$(RM) -f $(DESTDIR)$(root_sysconfdir)/$$i; \
	done

clean::
	$(RM) -f $(PROGS) $(MANPAGES) $(CONFFILES) $(UDEV_RULES) $(UDISKS_RULES) $(SERVICE_FILES) $(CRONTABS) $(LIBPROGS)

mostlyclean: clean
distclean: clean
	$(RM) -f .depend Makefile $(srcdir)/TAGS $(srcdir)/Makefile.in.old