diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 94 |
1 files changed, 70 insertions, 24 deletions
@@ -18,6 +18,8 @@ # On Debian systems, the complete text of the GNU General Public License # can be found in /usr/share/common-licenses/GPL-3 file. +SHELL := sh -e +LANGUAGES = $(shell cd manpages/po && ls) DESTDIR = PREFIX = /usr/local @@ -36,13 +38,13 @@ VPATH = src all: build -build: dosfsck dosfslabel mkdosfs +build: fatlabel fsck.fat mkfs.fat -dosfsck: boot.o check.o common.o fat.o file.o io.o lfn.o charconv.o dosfsck.o +fatlabel: boot.o check.o common.o fat.o file.o io.o lfn.o charconv.o fatlabel.o -dosfslabel: boot.o check.o common.o fat.o file.o io.o lfn.o charconv.o dosfslabel.o +fsck.fat: boot.o check.o common.o fat.o file.o io.o lfn.o charconv.o fsck.fat.o -mkdosfs: mkdosfs.o +mkfs.fat: mkfs.fat.o rebuild: distclean build @@ -50,35 +52,65 @@ install: install-bin install-doc install-man install-bin: build install -d -m 0755 $(DESTDIR)/$(SBINDIR) - install -m 0755 dosfsck dosfslabel mkdosfs $(DESTDIR)/$(SBINDIR) + install -m 0755 fatlabel fsck.fat mkfs.fat $(DESTDIR)/$(SBINDIR) - ln -sf dosfsck $(DESTDIR)/$(SBINDIR)/fsck.msdos - ln -sf dosfsck $(DESTDIR)/$(SBINDIR)/fsck.vfat - ln -sf mkdosfs $(DESTDIR)/$(SBINDIR)/mkfs.msdos - ln -sf mkdosfs $(DESTDIR)/$(SBINDIR)/mkfs.vfat + # legacy symlinks + ln -sf fatlabel $(DESTDIR)/$(SBINDIR)/dosfslabel + + ln -sf fsck.fat $(DESTDIR)/$(SBINDIR)/dosfsck + ln -sf fsck.fat $(DESTDIR)/$(SBINDIR)/fsck.msdos + ln -sf fsck.fat $(DESTDIR)/$(SBINDIR)/fsck.vfat + + ln -sf mkfs.fat $(DESTDIR)/$(SBINDIR)/mkdosfs + ln -sf mkfs.fat $(DESTDIR)/$(SBINDIR)/mkfs.msdos + ln -sf mkfs.fat $(DESTDIR)/$(SBINDIR)/mkfs.vfat install-doc: install -d -m 0755 $(DESTDIR)/$(DOCDIR)/dosfstools install -p -m 0644 ChangeLog doc/* $(DESTDIR)/$(DOCDIR)/dosfstools install-man: - install -d -m 0755 $(DESTDIR)/$(MANDIR)/man8 - install -p -m 0644 man/*.8 $(DESTDIR)/$(MANDIR)/man8 - - ln -sf dosfsck.8 $(DESTDIR)/$(MANDIR)/man8/fsck.msdos.8 - ln -sf dosfsck.8 $(DESTDIR)/$(MANDIR)/man8/fsck.vfat.8 - ln -sf mkdosfs.8 $(DESTDIR)/$(MANDIR)/man8/mkfs.msdos.8 - ln -sf mkdosfs.8 $(DESTDIR)/$(MANDIR)/man8/mkfs.vfat.8 + for MANPAGE in manpages/en/*; \ + do \ + SECTION="8"; \ + install -D -m 0644 $${MANPAGE} $(DESTDIR)/$(PREFIX)/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \ + done + + for LANGUAGE in $(LANGUAGES); \ + do \ + for MANPAGE in manpages/$${LANGUAGE}/*; \ + do \ + SECTION="8"; \ + install -D -m 0644 $${MANPAGE} $(DESTDIR)/$(PREFIX)/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \ + done; \ + done + + # legacy symlinks + ln -sf fatlabel.8 $(DESTDIR)/$(MANDIR)/man8/dosfslabel.8 + + ln -sf fsck.fat.8 $(DESTDIR)/$(MANDIR)/man8/dosfsck.8 + ln -sf fsck.fat.8 $(DESTDIR)/$(MANDIR)/man8/fsck.msdos.8 + ln -sf fsck.fat.8 $(DESTDIR)/$(MANDIR)/man8/fsck.vfat.8 + + ln -sf mkfs.fat.8 $(DESTDIR)/$(MANDIR)/man8/mkdosfs.8 + ln -sf mkfs.fat.8 $(DESTDIR)/$(MANDIR)/man8/mkfs.msdos.8 + ln -sf mkfs.fat.8 $(DESTDIR)/$(MANDIR)/man8/mkfs.vfat.8 uninstall: uninstall-bin uninstall-doc uninstall-man uninstall-bin: - rm -f $(DESTDIR)/$(SBINDIR)/dosfsck + rm -f $(DESTDIR)/$(SBINDIR)/fatlabel + rm -f $(DESTDIR)/$(SBINDIR)/fsck.fat + rm -f $(DESTDIR)/$(SBINDIR)/mkfs.fat + + # legacy symlinks rm -f $(DESTDIR)/$(SBINDIR)/dosfslabel - rm -f $(DESTDIR)/$(SBINDIR)/mkdosfs + rm -f $(DESTDIR)/$(SBINDIR)/dosfsck rm -f $(DESTDIR)/$(SBINDIR)/fsck.msdos rm -f $(DESTDIR)/$(SBINDIR)/fsck.vfat + + rm -f $(DESTDIR)/$(SBINDIR)/mkdosfs rm -f $(DESTDIR)/$(SBINDIR)/mkfs.msdos rm -f $(DESTDIR)/$(SBINDIR)/mkfs.vfat @@ -90,24 +122,38 @@ uninstall-doc: rmdir --ignore-fail-on-non-empty $(DESTDIR)/$(DOCDIR) uninstall-man: - rm -f $(DESTDIR)/$(MANDIR)/man8/dosfsck.8 + for MANPAGE in manpages/en/*; \ + do \ + SECTION="8"; \ + rm -f $(DESTDIR)/$(PREFIX)/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \ + done + + for LANGUAGE in $(LANGUAGES); \ + do \ + for MANPAGE in manpages/$${LANGUAGE}/*; \ + do \ + SECTION="8"; \ + rm -f $(DESTDIR)/$(PREFIX)/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \ + done; \ + done + + # legacy symlinks rm -f $(DESTDIR)/$(MANDIR)/man8/dosfslabel.8 - rm -f $(DESTDIR)/$(MANDIR)/man8/mkdosfs.8 + rm -f $(DESTDIR)/$(MANDIR)/man8/dosfsck.8 rm -f $(DESTDIR)/$(MANDIR)/man8/fsck.msdos.8 rm -f $(DESTDIR)/$(MANDIR)/man8/fsck.vfat.8 + + rm -f $(DESTDIR)/$(MANDIR)/man8/mkdosfs.8 rm -f $(DESTDIR)/$(MANDIR)/man8/mkfs.msdos.8 rm -f $(DESTDIR)/$(MANDIR)/man8/mkfs.vfat.8 - rmdir --ignore-fail-on-non-empty $(DESTDIR)/$(MANDIR)/man8 - rmdir --ignore-fail-on-non-empty $(DESTDIR)/$(MANDIR) - reinstall: distclean install clean: rm -f *.o distclean: clean - rm -f dosfsck dosfslabel mkdosfs + rm -f fatlabel fsck.fat mkfs.fat .PHONY: build rebuild install install-bin install-doc install-man uninstall uninstall-bin uninstall-doc uninstall-man reinstall clean distclean |