]> git.proxmox.com Git - mirror_smartmontools-debian.git/blob - Makefile.am
7540f57019ded8de4e97941935827415e127ab0d
[mirror_smartmontools-debian.git] / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 #
3 # $Id: Makefile.am 4519 2017-10-08 15:41:54Z chrfranke $
4 #
5
6 @SET_MAKE@
7
8 ACLOCAL_AMFLAGS = -I m4
9
10 # Make sure .cpp takes precedence to avoid compiling old .c file
11 SUFFIXES = .cpp .c .s .o
12
13 # BUILD_INFO can be provided by package maintainers (see INSTALL file)
14 BUILD_INFO= "(local build)"
15
16 AM_CPPFLAGS = \
17 -DBUILD_INFO='$(BUILD_INFO)' \
18 -DSMARTMONTOOLS_SYSCONFDIR='"$(sysconfdir)"' \
19 -DSMARTMONTOOLS_SMARTDSCRIPTDIR='"$(smartdscriptdir)"'
20
21 if ENABLE_DRIVEDB
22 AM_CPPFLAGS += -DSMARTMONTOOLS_DRIVEDBDIR='"$(drivedbdir)"'
23 endif
24 if ENABLE_SAVESTATES
25 AM_CPPFLAGS += -DSMARTMONTOOLS_SAVESTATES='"$(savestates)"'
26 endif
27 if ENABLE_ATTRIBUTELOG
28 AM_CPPFLAGS += -DSMARTMONTOOLS_ATTRIBUTELOG='"$(attributelog)"'
29 endif
30
31 if OS_WIN32_MINGW
32 AM_CPPFLAGS += -I$(srcdir)/os_win32
33 endif
34 if NEED_GETOPT_LONG
35 AM_CPPFLAGS += -I$(srcdir)/getopt -DHAVE_GETOPT_LONG -D__GNU_LIBRARY__
36 endif
37 if NEED_REGEX
38 AM_CPPFLAGS += -I$(srcdir)/regex
39 endif
40
41 sbin_PROGRAMS = \
42 smartctl \
43 smartd
44
45 if ENABLE_UPDATE_SMART_DRIVEDB
46 if OS_WIN32_MINGW
47 else
48 sbin_SCRIPTS = update-smart-drivedb
49 endif
50 endif
51
52
53 smartctl_SOURCES = \
54 smartctl.cpp \
55 smartctl.h \
56 atacmdnames.cpp \
57 atacmdnames.h \
58 atacmds.cpp \
59 atacmds.h \
60 ataidentify.cpp \
61 ataidentify.h \
62 ataprint.cpp \
63 ataprint.h \
64 dev_ata_cmd_set.cpp \
65 dev_ata_cmd_set.h \
66 dev_intelliprop.cpp \
67 dev_intelliprop.h \
68 dev_interface.cpp \
69 dev_interface.h \
70 dev_tunnelled.h \
71 drivedb.h \
72 int64.h \
73 knowndrives.cpp \
74 knowndrives.h \
75 nvmecmds.cpp \
76 nvmecmds.h \
77 nvmeprint.cpp \
78 nvmeprint.h \
79 scsicmds.cpp \
80 scsicmds.h \
81 scsiata.cpp \
82 scsiprint.cpp \
83 scsiprint.h \
84 utility.cpp \
85 utility.h
86
87 smartctl_LDADD = $(os_deps) $(os_libs)
88 smartctl_DEPENDENCIES = $(os_deps)
89
90 EXTRA_smartctl_SOURCES = \
91 os_darwin.cpp \
92 os_darwin.h \
93 os_linux.cpp \
94 os_linux.h \
95 os_freebsd.cpp \
96 os_freebsd.h \
97 os_netbsd.cpp \
98 os_netbsd.h \
99 os_openbsd.cpp \
100 os_openbsd.h \
101 os_os2.cpp \
102 os_os2.h \
103 os_qnxnto.cpp \
104 os_qnxnto.h \
105 os_solaris.cpp \
106 os_solaris.h \
107 os_win32.cpp \
108 os_generic.cpp \
109 os_generic.h \
110 aacraid.h \
111 cciss.cpp \
112 cciss.h \
113 cissio_freebsd.h \
114 dev_areca.cpp \
115 dev_areca.h \
116 dev_legacy.cpp \
117 linux_nvme_ioctl.h \
118 megaraid.h
119
120 if OS_WIN32_MINGW
121
122 smartctl_LDADD += smartctl_res.o
123 smartctl_DEPENDENCIES += smartctl_res.o
124
125 endif
126
127
128 smartd_SOURCES = \
129 smartd.cpp \
130 atacmdnames.cpp \
131 atacmdnames.h \
132 atacmds.cpp \
133 atacmds.h \
134 dev_ata_cmd_set.cpp \
135 dev_ata_cmd_set.h \
136 dev_intelliprop.cpp \
137 dev_intelliprop.h \
138 dev_interface.cpp \
139 dev_interface.h \
140 dev_tunnelled.h \
141 drivedb.h \
142 int64.h \
143 knowndrives.cpp \
144 knowndrives.h \
145 nvmecmds.cpp \
146 nvmecmds.h \
147 scsicmds.cpp \
148 scsicmds.h \
149 scsiata.cpp \
150 utility.cpp \
151 utility.h
152
153 smartd_LDADD = $(os_deps) $(os_libs) $(CAPNG_LDADD)
154 smartd_DEPENDENCIES = $(os_deps)
155
156 EXTRA_smartd_SOURCES = \
157 os_darwin.cpp \
158 os_darwin.h \
159 os_linux.cpp \
160 os_linux.h \
161 os_freebsd.cpp \
162 os_freebsd.h \
163 os_netbsd.cpp \
164 os_netbsd.h \
165 os_openbsd.cpp \
166 os_openbsd.h \
167 os_os2.cpp \
168 os_os2.h \
169 os_qnxnto.cpp \
170 os_qnxnto.h \
171 os_solaris.cpp \
172 os_solaris.h \
173 os_win32.cpp \
174 os_generic.cpp \
175 os_generic.h \
176 aacraid.h \
177 cciss.cpp \
178 cciss.h \
179 cissio_freebsd.h \
180 dev_areca.cpp \
181 dev_areca.h \
182 dev_legacy.cpp \
183 linux_nvme_ioctl.h \
184 freebsd_nvme_ioctl.h \
185 netbsd_nvme_ioctl.h \
186 megaraid.h
187
188 if OS_WIN32_MINGW
189
190 smartd_SOURCES += \
191 os_win32/daemon_win32.cpp \
192 os_win32/daemon_win32.h \
193 os_win32/syslog_win32.cpp \
194 os_win32/syslog.h
195
196 smartd_LDADD += smartd_res.o
197 smartd_DEPENDENCIES += smartd_res.o
198
199 endif
200
201 # Exclude from source tarball
202 nodist_EXTRA_smartctl_SOURCES = os_solaris_ata.s
203 nodist_EXTRA_smartd_SOURCES = os_solaris_ata.s
204
205 if NEED_GETOPT_LONG
206
207 smartctl_SOURCES += \
208 getopt/getopt.c \
209 getopt/getopt.h \
210 getopt/getopt1.c
211
212 smartd_SOURCES += \
213 getopt/getopt.c \
214 getopt/getopt.h \
215 getopt/getopt1.c
216
217 endif
218
219 if NEED_REGEX
220
221 smartctl_SOURCES += \
222 regex/regex.c \
223 regex/regex.h \
224 regex/regex_internal.h
225
226 smartd_SOURCES += \
227 regex/regex.c \
228 regex/regex.h \
229 regex/regex_internal.h
230
231 # Included by regex.c:
232 EXTRA_smartctl_SOURCES += \
233 regex/regcomp.c \
234 regex/regexec.c \
235 regex/regex_internal.c
236
237 EXTRA_smartd_SOURCES += \
238 regex/regcomp.c \
239 regex/regexec.c \
240 regex/regex_internal.c
241
242 endif
243
244 if OS_WIN32
245
246 smartctl_SOURCES += \
247 csmisas.h \
248 os_win32/wmiquery.cpp \
249 os_win32/wmiquery.h
250
251 smartd_SOURCES += \
252 csmisas.h \
253 os_win32/wmiquery.cpp \
254 os_win32/wmiquery.h
255
256 smartctl_LDADD += -lole32 -loleaut32
257 smartd_LDADD += -lole32 -loleaut32
258
259 endif
260
261 if OS_SOLARIS
262 # This block is required because Solaris uses manual page section 1m
263 # for administrative command (linux/freebsd use section 8) and Solaris
264 # uses manual page section 4 for file formats (linux/freebsd use
265 # section 5). Automake can deal cleanly with man page sections 1-8
266 # and n, but NOT with sections of the form 1m.
267 extra_MANS = smartd.conf.4 \
268 smartctl.1m \
269 smartd.1m
270 if ENABLE_UPDATE_SMART_DRIVEDB
271 extra_MANS += update-smart-drivedb.1m
272 endif
273
274 all-local: $(extra_MANS)
275 install-man: $(extra_MANS)
276 @$(NORMAL_INSTALL)
277 $(MKDIR_P) '$(DESTDIR)$(mandir)/man4'
278 $(MKDIR_P) '$(DESTDIR)$(mandir)/man1m'
279 for i in $(extra_MANS); do \
280 if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
281 else file=$$i; fi; \
282 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
283 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
284 inst=`echo $$inst | sed -e 's/^.*\///'`; \
285 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
286 echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
287 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
288 done
289 uninstall-man:
290 @$(NORMAL_UNINSTALL)
291 for i in $(extra_MANS); do \
292 if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
293 else file=$$i; fi; \
294 ext=`echo $$i | sed -e 's/^.*\\.//'`; \
295 inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
296 inst=`echo $$inst | sed -e 's/^.*\///'`; \
297 inst=`echo $$inst | sed '$(transform)'`.$$ext; \
298 echo " rm -f '$(DESTDIR)$(mandir)/man$$ext/$$inst'"; \
299 rm -f "$(DESTDIR)$(mandir)/man$$ext/$$inst"; \
300 done
301 else
302 # For systems that adopts traditional manner
303
304 man_MANS = smartd.conf.5 \
305 smartctl.8 \
306 smartd.8
307
308 if ENABLE_UPDATE_SMART_DRIVEDB
309 man_MANS += update-smart-drivedb.8
310 endif
311
312 endif
313
314 docsdir=$(docdir)
315 docs_DATA = \
316 AUTHORS \
317 ChangeLog \
318 ChangeLog-5.0-6.0 \
319 COPYING \
320 INSTALL \
321 NEWS \
322 README \
323 TODO \
324 smartd.conf
325
326 examplesdir=$(exampledir)
327 examples_DATA = \
328 examplescripts/README
329 examples_SCRIPTS = \
330 examplescripts/Example1 \
331 examplescripts/Example2 \
332 examplescripts/Example3 \
333 examplescripts/Example4 \
334 examplescripts/Example5 \
335 examplescripts/Example6
336
337 sysconf_DATA = smartd.conf
338
339 # If modified smartd.conf exists install smartd.conf.sample instead
340 install-sysconfDATA: $(sysconf_DATA)
341 $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'
342 @s="$(srcdir)/smartd.conf"; \
343 f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
344 if test -z "$(smartd_suffix)" && test -f "$$f"; then \
345 if cmp "$$s" "$$f" >/dev/null 2>/dev/null; then :; else \
346 echo "************************************************************"; \
347 echo "*** $$f preserved"; \
348 echo "*** installing smartd.conf.sample instead"; \
349 echo "************************************************************"; \
350 f="$$f".sample; \
351 fi; \
352 fi; \
353 echo " $(INSTALL_DATA) '$$s' '$$f'"; \
354 $(INSTALL_DATA) "$$s" "$$f"
355
356 # If smartd.conf.sample exists preserve smartd.conf
357 uninstall-sysconfDATA:
358 @f="$(DESTDIR)$(sysconfdir)/smartd.conf$(smartd_suffix)"; \
359 if test -z "$(smartd_suffix)" && test -f "$$f".sample; then \
360 echo "************************************************************"; \
361 echo "*** $$f preserved"; \
362 echo "*** removing smartd.conf.sample instead"; \
363 echo "************************************************************"; \
364 f="$$f".sample; \
365 fi; \
366 echo " rm -f '$$f'"; \
367 rm -f "$$f"
368
369 smartdscript_SCRIPTS = smartd_warning.sh
370
371 EXTRA_DIST = \
372 .editorconfig \
373 autogen.sh \
374 smartd.initd.in \
375 smartd.freebsd.initd.in \
376 smartd.8.in \
377 smartctl.8.in \
378 smartd.conf.5.in \
379 smartd.conf \
380 smartd.service.in \
381 smartd_warning.sh.in \
382 update-smart-drivedb.in \
383 update-smart-drivedb.8.in \
384 m4/pkg.m4 \
385 os_darwin/com.smartmontools.smartd.plist.in \
386 os_darwin/pkg/PackageInfo.in \
387 os_darwin/pkg/Distribution.in \
388 os_darwin/pkg/installer/README.html \
389 os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall \
390 os_win32/default.manifest \
391 os_win32/installer.nsi \
392 os_win32/runcmd.c \
393 os_win32/smartd_mailer.ps1 \
394 os_win32/smartd_mailer.conf.sample.ps1 \
395 os_win32/smartd_warning.cmd \
396 os_win32/syslogevt.mc \
397 os_win32/update-smart-drivedb.nsi \
398 os_win32/wbemcli_small.h \
399 os_win32/versioninfo.rc.in \
400 os_win32/wtssendmsg.c \
401 $(docs_DATA) \
402 $(examples_DATA) \
403 $(examples_SCRIPTS)
404
405 CLEANFILES = \
406 smartd.8 \
407 smartd.1m \
408 smartd.8.html \
409 smartd.8.html.tmp \
410 smartd.8.pdf \
411 smartd.8.txt \
412 smartctl.8 \
413 smartctl.1m \
414 smartctl.8.html \
415 smartctl.8.html.tmp \
416 smartctl.8.pdf \
417 smartctl.8.txt \
418 smartd.conf.5 \
419 smartd.conf.4 \
420 smartd.conf.5.html \
421 smartd.conf.5.html.tmp \
422 smartd.conf.5.pdf \
423 smartd.conf.5.txt \
424 smartd.initd \
425 smartd.freebsd.initd \
426 smartd.service \
427 smartd_warning.sh \
428 svnversion.h \
429 update-smart-drivedb \
430 update-smart-drivedb.8 \
431 update-smart-drivedb.1m \
432 update-smart-drivedb.8.html \
433 update-smart-drivedb.8.html.tmp \
434 update-smart-drivedb.8.pdf \
435 update-smart-drivedb.8.txt \
436 SMART
437
438 # 'make maintainer-clean' also removes files generated by './autogen.sh'
439 MAINTAINERCLEANFILES = \
440 $(srcdir)/Makefile.in \
441 $(srcdir)/aclocal.m4 \
442 $(srcdir)/compile \
443 $(srcdir)/configure \
444 $(srcdir)/config.guess \
445 $(srcdir)/config.h.in \
446 $(srcdir)/config.h.in~ \
447 $(srcdir)/config.sub \
448 $(srcdir)/depcomp \
449 $(srcdir)/install-sh \
450 $(srcdir)/missing \
451 $(srcdir)/m4/pkg.m4
452
453 utility.o: svnversion.h
454
455 if IS_SVN_BUILD
456 # Get version info from SVN
457 svnversion.h: ChangeLog Makefile $(svn_deps)
458 @echo ' svn info | $$(VERSION_FROM_SVN_INFO) > $@'
459 @echo '/* svnversion.h. Generated by Makefile from svn info. */' > $@
460 @(cd $(srcdir) \
461 && svnversion 2>/dev/null | sed -n 's,^\([0-9].*\),REV "\1",p' \
462 && TZ= LC_ALL=C svn info 2>/dev/null \
463 | sed -n 'h;s,^.* Date: *\([^ ]*\) .*$$,DATE "\1",p;g;s,^.* Date: *[^ ]* *\([^ ]*\) .*$$,TIME "\1",p') \
464 | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
465 else
466
467 # SVN not available, guess version info from Id strings
468 svnversion.h: ChangeLog Makefile NEWS
469 @echo ' cat ChangeLog NEWS $$(SOURCES) | $$(VERSION_FROM_SVN_IDS) > $@'
470 @echo '/* svnversion.h. Generated by Makefile from Id strings. */' > $@
471 @(cd $(srcdir) && cat ChangeLog NEWS Makefile.am configure.ac smart*.in *.cpp *.h) \
472 | sed -n 's,^.*\$$[I][d]: [^ ]* \([0-9][0-9]* [0-9][-0-9]* [0-9][:0-9]*\)[^:0-9][^$$]*\$$.*$$,\1,p' \
473 | sort -n -r \
474 | sed -n 'h;s,^\([^ ]*\) .*$$,REV "\1",p;g;s,^[^ ]* \([^ ]*\) .*$$,DATE "\1",p;g;s,^[^ ]* [^ ]* \([^ ]*\)$$,TIME "\1",p;q' \
475 | sed 's,^,#define SMARTMONTOOLS_SVN_,' >> $@
476 endif
477
478
479 if ENABLE_DRIVEDB
480 drivedb_DATA = drivedb.h
481 endif
482
483 update-smart-drivedb: update-smart-drivedb.in config.status
484 $(SHELL) ./config.status --file=$@
485 chmod +x $@
486
487 smartd_warning.sh: smartd_warning.sh.in config.status
488 $(SHELL) ./config.status --file=$@
489 chmod +x $@
490
491 if INSTALL_INITSCRIPT
492 if OS_DARWIN
493 initd_DATA = com.smartmontools.smartd.plist
494
495 initd_DATA_install = install-initdDATA-darwin
496 initd_DATA_uninstall = uninstall-initdDATA-darwin
497
498 com.smartmontools.smartd.plist : os_darwin/com.smartmontools.smartd.plist.in
499 sed "s|/usr/sbin/|$(sbindir)/|" $< > $@
500
501 install-initdDATA-darwin: $(initd_DATA)
502 $(MKDIR_P) '$(DESTDIR)$(initddir)'
503 $(INSTALL_DATA) $(top_builddir)/$(initd_DATA) $(DESTDIR)$(initddir)/$(initd_DATA)
504
505 uninstall-initdDATA-darwin:
506 rm -f $(DESTDIR)$(initddir)/$(initd_DATA)
507
508 else
509
510 initd_DATA = $(initdfile)
511
512 $(initdfile): $(srcdir)/$(initdfile).in Makefile
513 sed 's|/usr/local/sbin/|$(sbindir)/|g' $(srcdir)/$(initdfile).in > $@
514
515 initd_install_name = smartd$(smartd_suffix)
516
517 initd_DATA_install = install-initdDATA-generic
518 initd_DATA_uninstall = uninstall-initdDATA-generic
519
520 install-initdDATA-generic: $(initd_DATA)
521 $(MKDIR_P) '$(DESTDIR)$(initddir)'
522 $(INSTALL_SCRIPT) '$(top_builddir)/$(initdfile)' '$(DESTDIR)$(initddir)/smartd$(smartd_suffix)'
523
524 uninstall-initdDATA-generic:
525 rm -f '$(DESTDIR)$(initddir)/$(initd_install_name)'
526 endif
527 else
528
529 initd_DATA_install = install-initdDATA-null
530 initd_DATA_uninstall = uninstall-initdDATA-null
531
532 install-initdDATA-null:
533 uninstall-initdDATA-null:
534 endif
535
536 install-initdDATA : $(initd_DATA_install)
537
538 uninstall-initdDATA: $(initd_DATA_uninstall)
539
540 if INSTALL_SYSTEMDUNIT
541 systemdsystemunit_DATA = smartd.service
542 endif
543
544 smartd.service: smartd.service.in Makefile
545 @echo ' $$(SMARTD_SERVICE_FILTER) < $(srcdir)/smartd.service.in > $@'
546 @{ \
547 sed 's|/usr/local/sbin/smartd|$(sbindir)/smartd|' | \
548 if test -n '$(systemdenvfile)'; then \
549 sed 's|/usr/local/etc/sysconfig/smartmontools|$(systemdenvfile)|'; \
550 else \
551 sed -e '/^EnvironmentFile=/d' -e 's| *\$$smartd[_a-z]* *||g'; \
552 fi; } < $(srcdir)/smartd.service.in > $@
553
554
555 # Create empty directories if configured.
556 # Default install rules no longer create empty directories since automake 1.11.
557 installdirs-local:
558 @for d in '$(smartdplugindir)' '$(savestatesdir)' '$(attributelogdir)'; do \
559 test -n "$$d" || continue; \
560 echo " $(MKDIR_P) '$(DESTDIR)$$d'"; \
561 $(MKDIR_P) "$(DESTDIR)$$d" || exit 1; \
562 done
563
564 install-data-local: installdirs-local
565
566 #
567 # Build man pages
568 #
569 MAN_FILTER = { \
570 sed -e 's|CURRENT_SVN_VERSION|$(releaseversion)|g' \
571 -e "s|CURRENT_SVN_DATE|`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h`|g" \
572 -e "s|CURRENT_SVN_REV|`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h`|g" \
573 -e 's|/usr/local/share/man/|$(mandir)/|g' \
574 -e 's|/usr/local/sbin/|$(sbindir)/|g' \
575 -e 's|/usr/local/share/doc/smartmontools/examplescripts/|!exampledir!|g' \
576 -e 's|/usr/local/share/doc/smartmontools/|$(docsdir)/|g' \
577 -e 's|!exampledir!|$(exampledir)/|g' \
578 -e 's|/usr/local/etc/smartd\.conf|$(sysconfdir)/smartd.conf|g' \
579 -e 's|/usr/local/etc/smart_drivedb\.h|$(sysconfdir)/smart_drivedb.h|g' \
580 -e 's|/usr/local/etc/smartd_warning\.sh|$(smartdscriptdir)/smartd_warning.sh|g' \
581 -e 's|\\fBmail\\fP|\\fB$(os_mailer)\\fP|g' \
582 -e 's|\\'\''mail\\'\''|\\'\''$(os_mailer)\\'\''|g' \
583 -e 's|/usr/bin/mail|/usr/bin/$(os_mailer)|g' \
584 -e 's|RELEASE_6_0_DRIVEDB|$(DRIVEDB_BRANCH)|g' | \
585 if test -n '$(drivedbdir)'; then \
586 sed 's|/usr/local/share/smartmontools/drivedb\.h|$(drivedbdir)/drivedb.h|g' ; \
587 else \
588 sed '/^\.\\" %IF ENABLE_DRIVEDB/,/^\.\\" %ENDIF ENABLE_DRIVEDB/ s,^,.\\"\# ,' ; \
589 fi | \
590 if test '$(with_update_smart_drivedb)' = 'yes'; then \
591 cat; \
592 else \
593 sed '/^\.\\" %IF ENABLE_UPDATE_SMART_DRIVEDB/,/^\.\\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB/ s,^,.\\"\# ,' ; \
594 fi | \
595 if test -n '$(initddir)'; then \
596 sed 's|/usr/local/etc/rc\.d/init\.d/|$(initddir)/|g' ; \
597 else \
598 sed '/^\.\\" %IF ENABLE_INITSCRIPT/,/^\.\\" %ENDIF ENABLE_INITSCRIPT/ s,^,.\\"\# ,' ; \
599 fi | \
600 if test -n '$(savestates)'; then \
601 sed 's|/usr/local/var/lib/smartmontools/smartd\.|$(savestates)|g' ; \
602 else \
603 sed '/^\.\\" %IF ENABLE_SAVESTATES/,/^\.\\" %ENDIF ENABLE_SAVESTATES/ s,^,.\\"\# ,' ; \
604 fi | \
605 if test -n '$(attributelog)'; then \
606 sed 's|/usr/local/var/lib/smartmontools/attrlog\.|$(attributelog)|g' ; \
607 else \
608 sed '/^\.\\" %IF ENABLE_ATTRIBUTELOG/,/^\.\\" %ENDIF ENABLE_ATTRIBUTELOG/ s,^,.\\"\# ,' ; \
609 fi | \
610 if test -n '$(smartdplugindir)'; then \
611 sed 's|/usr/local/etc/smartd_warning\.d|$(smartdplugindir)|g' ; \
612 else \
613 sed '/^\.\\" %IF ENABLE_SMARTDPLUGINDIR/,/^\.\\" %ENDIF ENABLE_SMARTDPLUGINDIR/ s,^,.\\"\# ,' ; \
614 fi | \
615 if test -n '$(CAPNG_LDADD)'; then \
616 cat; \
617 else \
618 sed '/^\.\\" %IF ENABLE_CAPABILITIES/,/^\.\\" %ENDIF ENABLE_CAPABILITIES/ s,^,.\\"\# ,' ; \
619 fi | \
620 if test '$(with_nvme_devicescan)' = 'yes'; then \
621 cat; \
622 else \
623 sed '/^\.\\" %IF ENABLE_NVME_DEVICESCAN/,/^\.\\" %ENDIF ENABLE_NVME_DEVICESCAN/ s,^,.\\"\# ,' ; \
624 fi | \
625 if test -n '$(os_man_filter)'; then \
626 sed -e 's,OS_MAN_FILTER,$(os_man_filter),g' \
627 -e '/^\.\\" %IF NOT OS .*$(os_man_filter)/,/^.\\" %ENDIF NOT OS .*$(os_man_filter)/ s,^,.\\"\# ,' \
628 -e '/^\.\\" %IF OS .*$(os_man_filter)/,/^\.\\" %ENDIF OS .*$(os_man_filter)/ s,^,!!,' \
629 -e '/^\.\\" %IF OS ./,/^\.\\" %ENDIF OS ./ s,^,.\\"\# ,' \
630 -e '/^!*\.\\" %IF NOT OS ./,/^!*\.\\" %ENDIF NOT OS ./ s,^,!!,' \
631 -e 's,^!!!*\.\\"! \(.*\)$$,\1 \\"\#,' \
632 -e 's,^!!!*,,' ; \
633 else \
634 cat; \
635 fi; }
636
637 # Implicit rule 'smart%: smart%.in ...' does not work with BSD make
638 smartctl.8: smartctl.8.in Makefile svnversion.h
639 @echo ' $$(MAN_FILTER) < $(srcdir)/smartctl.8.in > $@'
640 @$(MAN_FILTER) < $(srcdir)/smartctl.8.in > $@
641
642 smartd.8: smartd.8.in Makefile svnversion.h
643 @echo ' $$(MAN_FILTER) < $(srcdir)/smartd.8.in > $@'
644 @$(MAN_FILTER) < $(srcdir)/smartd.8.in > $@
645
646 smartd.conf.5: smartd.conf.5.in Makefile svnversion.h
647 @echo ' $$(MAN_FILTER) < $(srcdir)/smartd.conf.5.in > $@'
648 @$(MAN_FILTER) < $(srcdir)/smartd.conf.5.in > $@
649
650 update-smart-drivedb.8: update-smart-drivedb.8.in Makefile svnversion.h
651 @echo ' $$(MAN_FILTER) < $(srcdir)/update-smart-drivedb.8.in > $@'
652 @$(MAN_FILTER) < $(srcdir)/update-smart-drivedb.8.in > $@
653
654 # Build Solaris specific man pages
655 SOLARIS_MAN_FILTER = \
656 sed -e '/^\.TH/s, \([58]\) , !!\1!! ,' \
657 -e '/^\.BR/s, (\([578]\)), (!!\1!!),' \
658 -e 's,\\fP(\([578]\)),\\fP(!!\1!!),g' \
659 -e 's,!!5!!,4,g' -e 's,!!7!!,5,g' -e 's,!!8!!,1m,g' \
660 -e 's,/var/log/messages,/var/adm/messages,g'
661
662 smartctl.1m: smartctl.8
663 @echo ' $$(SOLARIS_MAN_FILTER) < smartctl.8 > $@'
664 @$(SOLARIS_MAN_FILTER) < smartctl.8 > $@
665
666 smartd.1m: smartd.8
667 @echo ' $$(SOLARIS_MAN_FILTER) < smartd.8 > $@'
668 @$(SOLARIS_MAN_FILTER) < smartd.8 > $@
669
670 smartd.conf.4: smartd.conf.5
671 @echo ' $$(SOLARIS_MAN_FILTER) < smartd.conf.5 > $@'
672 @$(SOLARIS_MAN_FILTER) < smartd.conf.5 > $@
673
674 update-smart-drivedb.1m: update-smart-drivedb.8
675 @echo ' $$(SOLARIS_MAN_FILTER) < update-smart-drivedb.8 > $@'
676 @$(SOLARIS_MAN_FILTER) < update-smart-drivedb.8 > $@
677
678
679 # Convert man pages into .html, .pdf and .txt
680 # TODO: configure
681 MAN2HTML = man2html
682 #MAN2HTML = groff -man -Thtml
683 MAN2PDF = man -Tpdf -l
684 #MAN2PDF = groff -man -Tpdf
685 MAN2TXT = groff -man -Tascii -P'-bcou'
686
687 # Remove HTTP header and fix links in man2html output
688 FIXHTML = sed -e '1s,^Content-type.*,,' \
689 -e 's,<A HREF="[^"]*/man2html?\([1-8]\)+\(smart[cd][.a-z]*\)">,<A HREF="\2.\1.html">,g' \
690 -e 's,<A HREF="[^"]*/man2html">,<A HREF=".">,g' \
691 -e 's,<A HREF="[^"]*/man2html?[^"]*">\([^<]*\)</A>,\1,g' \
692 -e 's,<A HREF="mailto:[^s][^m][^a][^"]*">\([^<]*\)</A>,\1,g'
693
694 htmlman: smartctl.8.html smartd.8.html smartd.conf.5.html update-smart-drivedb.8.html
695
696 pdfman: smartctl.8.pdf smartd.8.pdf smartd.conf.5.pdf update-smart-drivedb.8.pdf
697
698 txtman: smartctl.8.txt smartd.8.txt smartd.conf.5.txt update-smart-drivedb.8.txt
699
700 %.5.html: %.5
701 $(MAN2HTML) $< > $@.tmp
702 @echo ' $$(FIXHTML) < $@.tmp > $@'
703 @$(FIXHTML) < $@.tmp > $@
704
705 %.8.html: %.8
706 $(MAN2HTML) $< > $@.tmp
707 @echo ' $$(FIXHTML) < $@.tmp > $@'
708 @$(FIXHTML) < $@.tmp > $@
709
710 %.5.pdf: %.5
711 $(MAN2PDF) $< > $@
712
713 %.8.pdf: %.8
714 $(MAN2PDF) $< > $@
715
716 %.5.txt: %.5
717 $(MAN2TXT) $< > $@
718
719 %.8.txt: %.8
720 $(MAN2TXT) $< > $@
721
722
723 # Check drive database syntax
724 check:
725 @if ./smartctl -B $(srcdir)/drivedb.h -P showall >/dev/null; then \
726 echo "$(srcdir)/drivedb.h: OK"; \
727 else \
728 echo "$(srcdir)/drivedb.h: Syntax check failed"; exit 1; \
729 fi
730
731
732 if OS_WIN32_MINGW
733 # Windows resources
734
735 smartctl_res.o: smartctl_res.rc $(os_win32_manifest)
736 $(WINDRES) $< $@
737
738 smartd_res.o: smartd_res.rc syslogevt.rc $(os_win32_manifest)
739 $(WINDRES) $< $@
740
741 runcmda_res.o: runcmda_res.rc defadmin.manifest
742 $(WINDRES) $< $@
743
744 runcmdu_res.o: runcmdu_res.rc $(os_win32_manifest)
745 $(WINDRES) $< $@
746
747 wtssendmsg_res.o: wtssendmsg_res.rc $(os_win32_manifest)
748 $(WINDRES) $< $@
749
750 # Convert version for VERSIONINFO resource: 6.6 r4519 -> 6.6.0.4519,
751 # set description, name, version and year
752 WIN_RC_FILTER = { \
753 ver=`echo '$(PACKAGE_VERSION).0' | sed -n 's,^\([0-9]*\.[0-9]*\.[0-9]*\).*$$,\1,p'` && \
754 rev=`sed -n 's,^.*REV[^"]*"\([0-9]*\).*$$,\1,p' svnversion.h` && \
755 txtver="$${ver:-0.0.0}.$${rev:-0}" && binver=`echo "$$txtver" | sed 's|\.|,|g'` && \
756 yy=`sed -n 's,^.*DATE[^"]*"20\([0-9][0-9]\).*$$,\1,p' svnversion.h` && yy="$${yy:-XX}" && \
757 sed -e "s|@DESC@|$$d|" -e "s|@NAME@|$$n|" -e "s|@BINARY_VERSION@|$$binver|g" \
758 -e "s|@TEXT_VERSION@|$$txtver|g" -e "s|@YY@|$$yy|g"; }
759
760 WIN_MAKE_RES = \
761 echo "n=$$n d=\"$$d"'"; $$(WIN_RC_FILTER) < $< > $@'; \
762 $(WIN_RC_FILTER) < $< > $@
763
764 WIN_APP_MANIFEST = \
765 if test -n '$(os_win32_manifest)'; then \
766 echo "echo '1 24 \"$(srcdir)/$(os_win32_manifest)\"' >> $@"; \
767 echo '1 24 "$(srcdir)/$(os_win32_manifest)"' >> $@; \
768 fi
769
770 smartctl_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
771 @n=smartctl d="Control and Monitor Utility for SMART Disks"; $(WIN_MAKE_RES)
772 @$(WIN_APP_MANIFEST)
773
774 smartd_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
775 @n=smartd d="SMART Disk Monitoring Daemon"; $(WIN_MAKE_RES)
776 echo '#include "./syslogevt.rc"' >> $@
777 @$(WIN_APP_MANIFEST)
778
779 runcmdu_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
780 @n=runcmdu d="Run console command"; $(WIN_MAKE_RES)
781 @$(WIN_APP_MANIFEST)
782
783 runcmda_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
784 @n=runcmda d="Run console command as admin"; $(WIN_MAKE_RES)
785 echo '1 24 "./defadmin.manifest"' >> $@
786
787 wtssendmsg_res.rc: os_win32/versioninfo.rc.in Makefile svnversion.h
788 @n=wtssendmsg d="Send console messages"; $(WIN_MAKE_RES)
789 @$(WIN_APP_MANIFEST)
790
791 syslogevt.rc: os_win32/syslogevt.mc
792 $(WINDMC) -b $<
793
794 defadmin.manifest: os_win32/default.manifest
795 sed 's,"asInvoker","requireAdministrator",' $< > $@
796
797 # Definitions for Windows distribution
798
799 if OS_WIN64
800 win_bits = 64
801 else
802 win_bits = 32
803 endif
804
805 distdir_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)
806 distzip_win32 = $(PACKAGE)-$(VERSION).win$(win_bits).zip
807 distinst_win32 = $(PACKAGE)-$(VERSION).win$(win_bits)-setup.exe
808
809 exedir_win32 = $(distdir_win32)/bin
810 docdir_win32 = $(distdir_win32)/doc
811
812 EXEFILES_WIN32 = \
813 $(exedir_win32)/smartctl.exe \
814 $(exedir_win32)/smartctl-nc.exe \
815 $(exedir_win32)/smartd.exe \
816 $(exedir_win32)/smartd_mailer.ps1 \
817 $(exedir_win32)/smartd_mailer.conf.sample.ps1 \
818 $(exedir_win32)/smartd_warning.cmd \
819 $(exedir_win32)/runcmda.exe \
820 $(exedir_win32)/runcmdu.exe \
821 $(exedir_win32)/wtssendmsg.exe
822
823 if ENABLE_DRIVEDB
824 if OS_WIN32_NSIS
825 EXEFILES_WIN32 += \
826 $(exedir_win32)/update-smart-drivedb.exe
827 endif
828 endif
829
830 FILES_WIN32 = \
831 $(EXEFILES_WIN32) \
832 $(docdir_win32)/AUTHORS.txt \
833 $(docdir_win32)/ChangeLog.txt \
834 $(docdir_win32)/ChangeLog-5.0-6.0.txt \
835 $(docdir_win32)/COPYING.txt \
836 $(docdir_win32)/INSTALL.txt \
837 $(docdir_win32)/NEWS.txt \
838 $(docdir_win32)/README.txt \
839 $(docdir_win32)/TODO.txt \
840 $(docdir_win32)/checksums$(win_bits).txt \
841 $(docdir_win32)/smartd.conf \
842 $(docdir_win32)/smartctl.8.html \
843 $(docdir_win32)/smartctl.8.pdf \
844 $(docdir_win32)/smartd.8.html \
845 $(docdir_win32)/smartd.8.pdf \
846 $(docdir_win32)/smartd.conf.5.html \
847 $(docdir_win32)/smartd.conf.5.pdf
848
849 if ENABLE_DRIVEDB
850 FILES_WIN32 += \
851 $(exedir_win32)/drivedb.h
852 endif
853
854 CLEANFILES += \
855 $(FILES_WIN32) \
856 defadmin.manifest \
857 distdir.mkdir \
858 runcmda.exe runcmda_res.rc \
859 runcmdu.exe runcmdu_res.rc \
860 smartctl-nc.exe smartctl-nc.exe.tmp \
861 smartctl_res.rc smartd_res.rc \
862 syslogevt.h \
863 syslogevt.rc syslogevt_*.bin \
864 update-smart-drivedb.exe \
865 wtssendmsg.exe wtssendmsg_res.rc
866
867 # Note: Only use without options to be compatible with all variants
868 UNIX2DOS = unix2dos
869
870 # Build Windows distribution
871
872 dist-win32: $(distzip_win32)
873
874 install-win32: $(distinst_win32)
875 ./$(distinst_win32)
876
877 installer-win32: $(distinst_win32)
878
879 distdir-win32: distdir.mkdir $(FILES_WIN32)
880
881 $(distzip_win32): distdir.mkdir $(FILES_WIN32)
882 @rm -fv $(distzip_win32)
883 cd $(distdir_win32) && zip -9 ../$(distzip_win32) bin/* doc/*
884 md5sum $@ > $@.md5
885 sha1sum $@ > $@.sha1
886 sha256sum $@ > $@.sha256
887
888 if OS_WIN32_NSIS
889 # Build NSIS installer
890 # Note: Only option character '-' is also compatible with Linux version of makensis
891 $(distinst_win32): os_win32/installer.nsi distdir.mkdir $(FILES_WIN32)
892 test -z '$(builddir_win64)' || ( cd $(builddir_win64) && make distdir-win32 )
893 @date=`sed -n 's,^.*DATE[^"]*"\([^"]*\)".*$$,\1,p' svnversion.h` && \
894 rev=`sed -n 's,^.*REV[^"]*"\([^"]*\)".*$$,r\1,p' svnversion.h` && \
895 verstr="$(PACKAGE_VERSION) $$date $$rev "$(BUILD_INFO) && \
896 d64= && if [ -n '$(builddir_win64)' ]; then d64='-DINPDIR64=$(builddir_win64)/$(PACKAGE)-$(VERSION).win64'; fi && \
897 echo "'$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR='$$verstr' $<" && \
898 '$(MAKENSIS)' -V2 -NOCD -DINPDIR=$(distdir_win32) $$d64 -DOUTFILE=$@ -DVERSTR="$$verstr" $<
899 md5sum $@ > $@.md5
900 sha1sum $@ > $@.sha1
901 sha256sum $@ > $@.sha256
902
903 # Build drivedb.h update tool
904 update-smart-drivedb.exe: os_win32/update-smart-drivedb.nsi
905 "$(MAKENSIS)" -V2 -NOCD -DBRANCH=$(DRIVEDB_BRANCH) $<
906
907 else
908 $(distinst_win32):
909 @echo "makensis: command not found. Please install NSIS from http://nsis.sourceforge.net/" 1>&2
910 @exit 1
911 endif
912
913 cleandist-win32:
914 rm -rf $(distdir_win32) distdir.mkdir
915
916 distdir.mkdir:
917 @test -d $(exedir_win32) || mkdir -pv $(exedir_win32)
918 @test -d $(docdir_win32) || mkdir -pv $(docdir_win32)
919 touch $@
920
921 $(exedir_win32)/%.exe: %.exe
922 cp -p $< $@
923 if test -n '$(STRIP)'; then $(STRIP) -s $@; else strip -s $@; fi
924 touch -r $< $@
925
926 # strip would break NSIS integrity check
927 $(exedir_win32)/update-smart-drivedb.exe: update-smart-drivedb.exe
928 cp -p $< $@
929
930 $(exedir_win32)/%.h: $(srcdir)/%.h
931 $(UNIX2DOS) < $< > $@
932 touch -r $< $@
933
934 $(exedir_win32)/%.cmd: $(srcdir)/os_win32/%.cmd
935 $(UNIX2DOS) < $< > $@
936 touch -r $< $@
937
938 $(exedir_win32)/%.ps1: $(srcdir)/os_win32/%.ps1
939 $(UNIX2DOS) < $< > $@
940 touch -r $< $@
941
942 $(docdir_win32)/%.html: %.html
943 $(UNIX2DOS) < $< > $@
944 touch -r $< $@
945
946 $(docdir_win32)/%.pdf: %.pdf
947 cp -p $< $@
948
949 $(docdir_win32)/%.txt: $(srcdir)/%
950 $(UNIX2DOS) < $< > $@
951 touch -r $< $@
952
953 $(docdir_win32)/%.conf: $(srcdir)/%.conf
954 $(UNIX2DOS) < $< > $@
955 touch -r $< $@
956
957 $(docdir_win32)/checksums$(win_bits).txt: $(EXEFILES_WIN32)
958 (cd $(exedir_win32) && md5sum *.exe && sha1sum *.exe && sha256sum *.exe) \
959 | $(UNIX2DOS) > $@
960
961 # Build non-console version of smartctl for GSmartControl.
962 # The script below changes the word at offset 220 (Subsystem) from 3
963 # (Console) to 2 (GUI) in a copy of smartctl.exe.
964 # This will be changed when a tool (like 'editbin') is available in
965 # the Cygwin distribution
966 smartctl-nc.exe: smartctl.exe
967 @rm -f $@
968 cp -p smartctl.exe $@.tmp
969 @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 3; then :; \
970 else echo "invalid EXE header"; exit 1; fi
971 @echo "editbin /subsystem:windows $@.tmp"
972 @echo -ne '\002' | dd bs=1 seek=220 count=1 conv=notrunc of=$@.tmp 2>/dev/null
973 @if test `od -A n -j 220 -N 2 -d $@.tmp` -eq 2; then :; \
974 else echo "EXE patch failed"; exit 1; fi
975 mv -f $@.tmp $@
976
977 # Build runcmd?.exe and wtssendmsg.exe
978 runcmd.o: os_win32/runcmd.c
979 $(CC) -c -Os $<
980
981 runcmdu.exe: runcmd.o runcmdu_res.o
982 $(CC) -o $@ $^
983
984 runcmda.exe: runcmd.o runcmda_res.o
985 $(CC) -o $@ $^
986
987 wtssendmsg.exe: os_win32/wtssendmsg.c wtssendmsg_res.o
988 $(CC) -Os -o $@ $^ -lwtsapi32
989
990 # Build os_win32/vc14/{config.h,smart*.rc,svnversion.h} for MSVC14 from MinGW files
991
992 vcver = 14
993
994 CONFIG_VC_FILES = \
995 $(srcdir)/os_win32/vc$(vcver)/config.h \
996 $(srcdir)/os_win32/vc$(vcver)/smartctl_res.rc \
997 $(srcdir)/os_win32/vc$(vcver)/smartd_res.rc \
998 $(srcdir)/os_win32/vc$(vcver)/svnversion.h
999
1000 config-vc$(vcver): $(CONFIG_VC_FILES)
1001
1002 $(srcdir)/os_win32/vc$(vcver)/config.h: config.h Makefile
1003 sed -e '1i/* os_win32/vc$(vcver)/config.h. Generated from config.h by Makefile. */' \
1004 -e 's,^#define HAVE_\(ATTR_PACKED\|GETTIMEOFDAY\|[DK_]*NTDDDISK_H\|STRINGS_H\|UNISTD_H\|WORKING_SNPRINTF\) 1$$,/* #undef HAVE_\1 */ /* VC$(vcver) */,' \
1005 -e 's,^\(#define SMARTMONTOOLS_BUILD_HOST "[^-]*\)[^"]*,\1-pc-w32vc$(vcver),' $< > $@
1006
1007 $(srcdir)/os_win32/vc$(vcver)/svnversion.h: svnversion.h
1008 cp $< $@
1009
1010 $(srcdir)/os_win32/vc$(vcver)/smartctl_res.rc: smartctl_res.rc
1011 sed '/^1 24 /d' $< > $@
1012
1013 $(srcdir)/os_win32/vc$(vcver)/smartd_res.rc: smartd_res.rc
1014 sed '/^1 24 /d' $< > $@
1015
1016 clean-vc$(vcver):
1017 rm -f $(srcdir)/os_win32/vc$(vcver)/smartmontools.VC.VC.opendb
1018 rm -f $(srcdir)/os_win32/vc$(vcver)/smartmontools.VC.db
1019 rm -f $(srcdir)/os_win32/vc$(vcver)/syslogevt.h
1020 rm -rf $(srcdir)/os_win32/vc$(vcver)/Debug
1021 rm -rf $(srcdir)/os_win32/vc$(vcver)/Release
1022 rm -rf $(srcdir)/os_win32/vc$(vcver)/x64
1023
1024 distclean-vc$(vcver): clean-vc$(vcver)
1025 rm -f $(CONFIG_VC_FILES)
1026
1027 maintainer-clean-vc$(vcver): distclean-vc$(vcver)
1028 rm -rf $(srcdir)/os_win32/vc$(vcver)/.vs
1029
1030 endif
1031
1032
1033 if OS_DARWIN
1034 # Definitions for OSX distribution
1035 distdir_darwin = $(PACKAGE)-$(VERSION).darwin
1036 dmg_darwin = $(PACKAGE)-$(VERSION).dmg
1037 pkg_darwin = $(PACKAGE)-$(VERSION).pkg
1038
1039 # build darwin installer
1040 $(pkg_darwin):
1041 ${MAKE} install DESTDIR=$(distdir_darwin)/root
1042 @cp $(srcdir)/os_darwin/pkg/root/usr/local/sbin/smart-pkg-uninstall $(distdir_darwin)/root$(sbindir)
1043 @mkdir -p $(distdir_darwin)/pkg
1044 @( cd $(distdir_darwin)/root && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > $(distdir_darwin)/pkg/Payload
1045 PAYLOAD_FILES=`find $(distdir_darwin)/root | wc -l` &&\
1046 PAYLOAD_SIZEKB=`du -BK -s $(distdir_darwin)/root|${AWK} '{print $$1}'|tr -d 'K'` &&\
1047 sed -e "s|@version@|$(VERSION)|" -e "s|@files@|$${PAYLOAD_FILES}|" \
1048 -e "s|@size@|$${PAYLOAD_SIZEKB}|" $(srcdir)/os_darwin/pkg/PackageInfo.in \
1049 > $(distdir_darwin)/pkg/PackageInfo &&\
1050 sed -e "s|@version@|$(VERSION)|" -e "s|@files@|$${PAYLOAD_FILES}|" -e "s|@size@|$${PAYLOAD_SIZEKB}|" \
1051 -e "s|@pkgname@|$(pkg_darwin)|" \
1052 $(srcdir)/os_darwin/pkg/Distribution.in > $(distdir_darwin)/pkg/Distribution
1053 @mkdir -p $(distdir_darwin)/pkg/Resources/English.lproj
1054 @cp $(srcdir)/COPYING $(distdir_darwin)/pkg/Resources/English.lproj/license.txt
1055 @mkbom -u 0 -g 80 $(distdir_darwin)/root $(distdir_darwin)/pkg/Bom
1056 @mkdir -p $(distdir_darwin)/dmg
1057 @( cd $(distdir_darwin)/pkg && xar --compression none -cf "../dmg/$(pkg_darwin)" * )
1058
1059 # build darwon dmg image
1060 $(dmg_darwin):
1061 @cp $(srcdir)/os_darwin/pkg/installer/README.html $(distdir_darwin)/dmg
1062 @mkisofs -V 'smartmontools' -no-pad -r -apple -o $(distdir_darwin)/smartmontools-$(VERSION).iso \
1063 -hfs-bless "$(distdir_darwin)/dmg/" "$(distdir_darwin)/dmg/"
1064 @dmg dmg $(distdir_darwin)/smartmontools-$(VERSION).iso $(dmg_darwin)
1065 md5sum $@ > $@.md5
1066 sha1sum $@ > $@.sha1
1067 sha256sum $@ > $@.sha256
1068
1069 install-darwin: install-darwin-cleanup $(pkg_darwin) $(dmg_darwin)
1070
1071 install-darwin-cleanup:
1072 @rm -rf $(distdir_darwin)
1073 endif