diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-01-10 14:08:23 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-01-10 14:36:56 +0900 |
commit | 3e04d82fa8da3f9c3077d4d06b334cdc2c947a61 (patch) | |
tree | 8682677660f63cc17352be86698a04f2e5d7ca95 /Makefile | |
parent | a43ffe7b214336b5ff551c8965d6fd16c63b13ed (diff) | |
download | dos2unix-3e04d82fa8da3f9c3077d4d06b334cdc2c947a61.tar.gz dos2unix-3e04d82fa8da3f9c3077d4d06b334cdc2c947a61.tar.bz2 dos2unix-3e04d82fa8da3f9c3077d4d06b334cdc2c947a61.zip |
Imported Upstream version 7.4.0upstream/7.4.0
Change-Id: I567718db10506669896b057a505586ec6e1d18d7
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 418 |
1 files changed, 223 insertions, 195 deletions
@@ -26,31 +26,31 @@ # # Description # -# This is a GNU Makefile that uses GNU compilers, linkers and cpp. The -# platform specific issues are determined by the various OS teets that -# rely on the uname(1) command and directory locations. +# This is a GNU Makefile that uses GNU compilers, linkers and cpp. The +# platform specific issues are determined by the various OS teets that +# rely on the uname(1) command and directory locations. # -# Set additional flags for the build with variables CFLAGS_USER, -# DEFS_USER and LDFLAGS_USER. +# Set additional flags for the build with variables CFLAGS_USER, +# DEFS_USER and LDFLAGS_USER. include version.mk -.PHONY: man txt html pdf mofiles tags merge test check +.PHONY: doc man txt html pdf mofiles tags merge test check .PRECIOUS: %.1 %.pod -CC ?= gcc -CPP ?= cpp -CPP_FLAGS_POD = ALL -STRIP = strip +CC ?= gcc +CPP ?= cpp +CPP_FLAGS_POD = ALL +STRIP = strip -PACKAGE = dos2unix -UNIX2DOS = unix2dos -MAC2UNIX = mac2unix -UNIX2MAC = unix2mac +PACKAGE = dos2unix +UNIX2DOS = unix2dos +MAC2UNIX = mac2unix +UNIX2MAC = unix2mac # Native Language Support (NLS) -ENABLE_NLS = 1 +ENABLE_NLS = 1 # Large File Support (LFS) LFS = 1 # DEBUG=1 adds the -g option to CFLAGS, for adding debug symbols. @@ -62,54 +62,60 @@ DIST_TARGET = dist-tgz EXE= -BIN = $(PACKAGE)$(EXE) -UNIX2DOS_BIN = $(UNIX2DOS)$(EXE) -MAC2UNIX_BIN = $(MAC2UNIX)$(EXE) -UNIX2MAC_BIN = $(UNIX2MAC)$(EXE) +BIN = $(PACKAGE)$(EXE) +UNIX2DOS_BIN = $(UNIX2DOS)$(EXE) +MAC2UNIX_BIN = $(MAC2UNIX)$(EXE) +UNIX2MAC_BIN = $(UNIX2MAC)$(EXE) -LINK = ln -sf -LINK_MAN = $(LINK) +LINK = ln -sf +LINK_MAN = $(LINK) -prefix = /usr -exec_prefix = $(prefix) -bindir = $(exec_prefix)/bin -datarootdir = $(prefix)/share -datadir = $(datarootdir) +prefix = /usr +exec_prefix = $(prefix) +bindir = $(exec_prefix)/bin +datarootdir = $(prefix)/share +datadir = $(datarootdir) -docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) -docdir = $(datarootdir)/doc/$(docsubdir) -localedir = $(datarootdir)/locale -mandir = $(datarootdir)/man -man1dir = $(mandir)/man1 -manext = .1 -man1ext = .1 +docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) +docdir = $(datarootdir)/doc/$(docsubdir) +localedir = $(datarootdir)/locale +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 +manext = .1 +man1ext = .1 ifdef ENABLE_NLS - POT = po/$(PACKAGE).pot - POFILES = $(wildcard po/??.po) $(wildcard po/??_??.po) - MOFILES = $(patsubst %.po,%.mo,$(POFILES)) - NLSSUFFIX = -nls + POT = po/$(PACKAGE).pot + POFILES = $(wildcard po/??.po) $(wildcard po/??_??.po) + MOFILES = $(patsubst %.po,%.mo,$(POFILES)) + NLSSUFFIX = -nls endif HTMLEXT = htm -# By default we generate only English text and html manuals. -DOCFILES = man/man1/$(PACKAGE).txt man/man1/$(PACKAGE).$(HTMLEXT) -INSTALL_OBJS_DOC = README.txt INSTALL.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES) +# English only documents. +INSTALL_OBJS_DOC = README.txt INSTALL.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt +# English manual +MANFILES_EN = man/man1/$(PACKAGE).1 +TXTFILES_EN = man/man1/$(PACKAGE).txt +HTMLFILES_EN = man/man1/$(PACKAGE).$(HTMLEXT) +PSFILES_EN = man/man1/$(PACKAGE).ps +PDFFILES_EN = man/man1/$(PACKAGE).pdf + +# International manuals ifdef ENABLE_NLS - MANPOTFILE = po-man/dos2unix-man.pot - MANPOFILES = $(wildcard po-man/*.po) - PODFILES = $(patsubst po-man/%.po,man/%/man1/dos2unix.pod,$(MANPOFILES)) + MANPOTFILE = po-man/dos2unix-man.pot + MANPOFILES = $(wildcard po-man/*.po) + MANPODFILES = $(patsubst po-man/%.po,man/%/man1/dos2unix.pod,$(MANPOFILES)) endif -PODFILES_ALL = man/man1/dos2unix.pod $(PODFILES) -MANFILES = $(patsubst %.pod,%.1,$(PODFILES)) -TXTFILES = $(patsubst %.pod,%.txt,$(PODFILES_ALL)) -HTMLFILES = $(patsubst %.pod,%.$(HTMLEXT),$(PODFILES_ALL)) -PSFILES = $(patsubst %.pod,%.ps,$(PODFILES_ALL)) -PDFFILES = $(patsubst %.pod,%.pdf,$(PODFILES_ALL)) +MANFILES = $(patsubst %.pod,%.1,$(MANPODFILES)) +TXTFILES = $(patsubst %.pod,%.txt,$(MANPODFILES)) +HTMLFILES = $(patsubst %.pod,%.$(HTMLEXT),$(MANPODFILES)) +PSFILES = $(patsubst %.pod,%.ps,$(MANPODFILES)) +PDFFILES = $(patsubst %.pod,%.pdf,$(MANPODFILES)) # On some systems (e.g. FreeBSD 4.10) GNU install is installed as `ginstall'. -INSTALL = install +INSTALL = install INSTALL_PROGRAM = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 @@ -117,197 +123,197 @@ INSTALL_DATA = $(INSTALL) -m 644 MKDIR = mkdir ifdef ENABLE_NLS - DOS2UNIX_NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(localedir)\" -DPACKAGE=\"$(PACKAGE)\" + DOS2UNIX_NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(localedir)\" -DPACKAGE=\"$(PACKAGE)\" endif -VERSIONSUFFIX = -bin +VERSIONSUFFIX = -bin # ......................................................... OS flags ... ifndef D2U_OS - d2u_os=$(shell uname -s) + d2u_os=$(shell uname -s) ifeq ($(findstring CYGWIN,$(d2u_os)),CYGWIN) - D2U_OS = cygwin + D2U_OS = cygwin endif ifndef D2U_OS ifeq ($(findstring MSYS,$(d2u_os)),MSYS) - D2U_OS = msys + D2U_OS = msys endif endif ifndef D2U_OS ifeq ($(findstring MINGW32,$(d2u_os)),MINGW32) - D2U_OS = mingw32 + D2U_OS = mingw32 endif endif ifndef D2U_OS ifeq ($(findstring MINGW64,$(d2u_os)),MINGW64) - D2U_OS = mingw64 + D2U_OS = mingw64 endif endif ifndef D2U_OS ifneq ($(DJGPP),) - D2U_OS = msdos + D2U_OS = msdos endif endif ifndef D2U_OS ifneq (, $(wildcard /opt/csw)) - D2U_OS = sun + D2U_OS = sun endif endif ifndef D2U_OS - D2U_OS=$(shell echo $(d2u_os) | tr [A-Z] [a-z]) + D2U_OS=$(shell echo $(d2u_os) | tr [A-Z] [a-z]) endif endif ifeq (cygwin,$(D2U_OS)) ifdef ENABLE_NLS - LIBS_EXTRA = -lintl -liconv -endif - LDFLAGS_EXTRA = -Wl,--enable-auto-import - EXE = .exe - # allow non-cygwin clients which do not understand cygwin - # symbolic links to launch applications... - LINK = ln -f - # but use symbolic links for man pages, since man client - # IS a cygwin app and DOES understand symlinks. - LINK_MAN = ln -fs - # Cygwin packaging standard avoids version numbers on - # documentation directories. - docsubdir = $(PACKAGE) - MACHINE := $(subst -pc-cygwin,,$(shell gcc -dumpmachine)) - VERSIONSUFFIX = -cygwin-$(MACHINE) + LIBS_EXTRA = -lintl -liconv +endif + LDFLAGS_EXTRA = -Wl,--enable-auto-import + EXE = .exe + # allow non-cygwin clients which do not understand cygwin + # symbolic links to launch applications... + LINK = ln -f + # but use symbolic links for man pages, since man client + # IS a cygwin app and DOES understand symlinks. + LINK_MAN = ln -fs + # Cygwin packaging standard avoids version numbers on + # documentation directories. + docsubdir = $(PACKAGE) + MACHINE := $(subst -pc-cygwin,,$(shell gcc -dumpmachine)) + VERSIONSUFFIX = -cygwin-$(MACHINE) endif ifeq (msys,$(D2U_OS)) - CC=gcc - EXE = .exe - MACHINE := $(subst -pc-msys,,$(shell gcc -dumpmachine)) + CC=gcc + EXE = .exe + MACHINE := $(subst -pc-msys,,$(shell gcc -dumpmachine)) # MSYS 1 does not support locales and no Unicode. ifeq ($(shell ./test/chk_loc.sh en_US.utf8),no) - UCS = - VERSIONSUFFIX = -msys1-$(MACHINE) + UCS = + VERSIONSUFFIX = -msys1-$(MACHINE) else - VERSIONSUFFIX = -msys2-$(MACHINE) + VERSIONSUFFIX = -msys2-$(MACHINE) endif ifdef ENABLE_NLS - LIBS_EXTRA = -lintl -liconv + LIBS_EXTRA = -lintl -liconv endif endif ifeq (mingw32,$(D2U_OS)) - CC=gcc - prefix=c:/usr/local - EXE = .exe - VERSIONSUFFIX = -win32 - LINK = cp -f - UNIFILE=1 - DIST_TARGET = dist-zip + CC=gcc + prefix=c:/usr/local + EXE = .exe + VERSIONSUFFIX = -win32 + LINK = cp -f + UNIFILE=1 + DIST_TARGET = dist-zip ifdef ENABLE_NLS - LIBS_EXTRA = -lintl -liconv - ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll + LIBS_EXTRA = -lintl -liconv + ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif ifeq ($(findstring w64-mingw32,$(shell gcc -dumpmachine)),w64-mingw32) # Mingw-w64 - CFLAGS_COMPILER = -DD2U_COMPILER=MINGW32_W64 + CFLAGS_COMPILER = -DD2U_COMPILER=MINGW32_W64 ifdef ENABLE_NLS - ZIPOBJ_EXTRA += bin/libgcc_s_dw2-1.dll bin/libwinpthread-1.dll + ZIPOBJ_EXTRA += bin/libgcc_s_dw2-1.dll bin/libwinpthread-1.dll endif - CRT_GLOB_OBJ = /mingw32/i686-w64-mingw32/lib/CRT_glob.o - LIBS_EXTRA += $(CRT_GLOB_OBJ) - CFLAGS_OS=-I/mingw32/include + CRT_GLOB_OBJ = /mingw32/i686-w64-mingw32/lib/CRT_glob.o + LIBS_EXTRA += $(CRT_GLOB_OBJ) + CFLAGS_OS=-I/mingw32/include else - CFLAGS_OS=-D_O_U16TEXT=0x20000 + CFLAGS_OS=-D_O_U16TEXT=0x20000 endif endif ifeq (mingw64,$(D2U_OS)) - CC=gcc - prefix=c:/usr/local64 - EXE = .exe - VERSIONSUFFIX = -win64 - LINK = cp -f - UNIFILE=1 - DIST_TARGET = dist-zip + CC=gcc + prefix=c:/usr/local64 + EXE = .exe + VERSIONSUFFIX = -win64 + LINK = cp -f + UNIFILE=1 + DIST_TARGET = dist-zip ifdef ENABLE_NLS - LIBS_EXTRA = -lintl -liconv - ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll + LIBS_EXTRA = -lintl -liconv + ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif - CRT_GLOB_OBJ = /mingw64/x86_64-w64-mingw32/lib/CRT_glob.o - LIBS_EXTRA += $(CRT_GLOB_OBJ) - CFLAGS_OS=-I/mingw64/include + CRT_GLOB_OBJ = /mingw64/x86_64-w64-mingw32/lib/CRT_glob.o + LIBS_EXTRA += $(CRT_GLOB_OBJ) + CFLAGS_OS=-I/mingw64/include endif ifeq (msdos,$(D2U_OS)) - prefix=c:/dos32 - EXE = .exe - VERSIONSUFFIX = pm - LINK_MAN = cp -f - docsubdir = dos2unix - UCS = - ZIPOBJ_EXTRA = bin/cwsdpmi.exe + prefix=c:/dos32 + EXE = .exe + VERSIONSUFFIX = pm + LINK_MAN = cp -f + docsubdir = dos2unix + UCS = + ZIPOBJ_EXTRA = bin/cwsdpmi.exe ifdef ENABLE_NLS - LIBS_EXTRA = -lintl -liconv + LIBS_EXTRA = -lintl -liconv endif endif ifeq (os/2,$(D2U_OS)) - prefix=c:/usr - EXE = .exe - VERSIONSUFFIX = -os2 - LINK_MAN = cp -f - UCS = - LDFLAGS_EXTRA = -Zargs-wild - DIST_TARGET = dist-zip + prefix=c:/usr + EXE = .exe + VERSIONSUFFIX = -os2 + LINK_MAN = cp -f + UCS = + LDFLAGS_EXTRA = -Zargs-wild + DIST_TARGET = dist-zip ifdef ENABLE_NLS - LIBS_EXTRA += -lintl -liconv + LIBS_EXTRA += -lintl -liconv endif endif ifeq (freemint,$(D2U_OS)) - prefix=/usr - EXE = - VERSIONSUFFIX = -freemint - UCS= - ENABLE_NLS= + prefix=/usr + EXE = + VERSIONSUFFIX = -freemint + UCS= + ENABLE_NLS= ifdef ENABLE_NLS - LIBS_EXTRA += -lintl -liconv + LIBS_EXTRA += -lintl -liconv endif - EXTRA_DEFS += -Dfreemint -D__OS=\"freemint\" + EXTRA_DEFS += -Dfreemint -D__OS=\"freemint\" endif ifeq (freebsd,$(D2U_OS)) ifdef ENABLE_NLS - CFLAGS_OS = -I/usr/local/include - LDFLAGS_EXTRA = -L/usr/local/lib - LIBS_EXTRA = -lintl + CFLAGS_OS = -I/usr/local/include + LDFLAGS_EXTRA = -L/usr/local/lib + LIBS_EXTRA = -lintl endif endif ifeq (darwin,$(D2U_OS)) ifdef ENABLE_NLS - CFLAGS_OS = -I/usr/local/include - LDFLAGS_EXTRA = -L/usr/local/lib - LIBS_EXTRA = -lintl + CFLAGS_OS = -I/usr/local/include + LDFLAGS_EXTRA = -L/usr/local/lib + LIBS_EXTRA = -lintl endif endif ifeq (sun,$(D2U_OS)) - # Running under SunOS/Solaris - LIBS_EXTRA = -lintl + # Running under SunOS/Solaris + LIBS_EXTRA = -lintl endif ifeq (hp-ux,$(D2U_OS)) - # Running under HP-UX - EXTRA_DEFS += -Dhpux -D_HPUX_SOURCE + # Running under HP-UX + EXTRA_DEFS += -Dhpux -D_HPUX_SOURCE endif @@ -316,51 +322,52 @@ endif # PostScript and PDF generation from UTF-8 manuals is not working, # or I don't know how to do it. -CFLAGS_USER = +CFLAGS_USER = ifeq ($(DEBUG), 1) -CFLAGS ?= -O0 +CFLAGS ?= -O0 else -CFLAGS ?= -O2 +CFLAGS ?= -O2 endif -CFLAGS += -Wall -Wextra -Wconversion $(RPM_OPT_FLAGS) $(CPPFLAGS) $(CFLAGS_USER) +CFLAGS += -Wall -Wextra -Wconversion $(RPM_OPT_FLAGS) $(CPPFLAGS) $(CFLAGS_USER) -EXTRA_CFLAGS = -DVER_REVISION=\"$(DOS2UNIX_VERSION)\" \ - -DVER_DATE=\"$(DOS2UNIX_DATE)\" \ - -DVER_AUTHOR=\"$(DOS2UNIX_AUTHOR)\" \ - -DDEBUG=$(DEBUGMSG) \ - $(CFLAGS_OS) \ - $(CFLAGS_COMPILER) +EXTRA_CFLAGS = -DVER_REVISION=\"$(DOS2UNIX_VERSION)\" \ + -DVER_DATE=\"$(DOS2UNIX_DATE)\" \ + -DVER_AUTHOR=\"$(DOS2UNIX_AUTHOR)\" \ + -DDEBUG=$(DEBUGMSG) \ + $(CFLAGS_OS) \ + $(CFLAGS_COMPILER) ifeq ($(DEBUG), 1) - EXTRA_CFLAGS += -g + EXTRA_CFLAGS += -g endif ifdef STATIC - EXTRA_CFLAGS += -static + EXTRA_CFLAGS += -static endif ifdef UCS - EXTRA_CFLAGS += -DD2U_UNICODE + EXTRA_CFLAGS += -DD2U_UNICODE endif ifdef UNIFILE - EXTRA_CFLAGS += -DD2U_UNIFILE + EXTRA_CFLAGS += -DD2U_UNIFILE endif ifdef LFS - EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 + EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 endif -LDFLAGS_USER = +LDFLAGS_USER = LDFLAGS = $(RPM_OPT_FLAGS) $(LDFLAGS_EXTRA) $(LDFLAGS_USER) LIBS = $(LIBS_EXTRA) -DEFS_USER = -DEFS = $(EXTRA_DEFS) $(DEFS_USER) +DEFS_USER = +DEFS = $(EXTRA_DEFS) $(DEFS_USER) # .......................................................... targets ... -all: $(BIN) $(MAC2UNIX_BIN) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) $(DOCFILES) $(MOFILES) man/man1/dos2unix.1 $(MANFILES) $(MANPOTFILE) +all: $(BIN) $(MAC2UNIX_BIN) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) doc \ + mofiles man status: @echo "D2U_OS = $(D2U_OS)" @@ -438,17 +445,17 @@ man/man1/dos2unix.pod : ; mofiles: $(MOFILES) -html: $(HTMLFILES) +html: $(HTMLFILES_EN) $(HTMLFILES) -txt: $(TXTFILES) +txt: $(TXTFILES_EN) $(TXTFILES) -ps: $(PSFILES) +ps: $(PSFILES_EN) $(PSFILES) -pdf: $(PDFFILES) +pdf: $(PDFFILES_EN) $(PDFFILES) -man: man/man1/dos2unix.1 $(MANFILES) $(MANPOTFILE) +man: $(MANFILES_EN) $(MANFILES) $(MANPOTFILE) -doc: $(DOCFILES) +doc: txt html tags: $(POT) @@ -525,10 +532,14 @@ endif check: test -install: all +install-bin: $(BIN) $(MAC2UNIX_BIN) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) $(MKDIR) -p -m 755 $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(UNIX2DOS_BIN) $(DESTDIR)$(bindir) +ifneq ($(DJGPP),) + cd $(DESTDIR)$(bindir); stubify -g $(MAC2UNIX_BIN) ; stubedit $(MAC2UNIX_BIN) runfile=$(BIN) + cd $(DESTDIR)$(bindir); stubify -g $(UNIX2MAC_BIN) ; stubedit $(UNIX2MAC_BIN) runfile=$(UNIX2DOS_BIN) +else ifeq ($(LINK),cp -f) $(INSTALL_PROGRAM) $(MAC2UNIX_BIN) $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(UNIX2MAC_BIN) $(DESTDIR)$(bindir) @@ -536,12 +547,16 @@ else cd $(DESTDIR)$(bindir); $(LINK) $(BIN) $(MAC2UNIX_BIN) cd $(DESTDIR)$(bindir); $(LINK) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) endif +endif + + +install-man: man $(MKDIR) -p -m 755 $(DESTDIR)$(man1dir) - $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir) + $(INSTALL_DATA) $(MANFILES_EN) $(DESTDIR)$(man1dir) ifeq ($(LINK_MAN),cp -f) - $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(MAC2UNIX).1 - $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(UNIX2DOS).1 - $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(UNIX2MAC).1 + $(INSTALL_DATA) $(MANFILES_EN) $(DESTDIR)$(man1dir)/$(MAC2UNIX).1 + $(INSTALL_DATA) $(MANFILES_EN) $(DESTDIR)$(man1dir)/$(UNIX2DOS).1 + $(INSTALL_DATA) $(MANFILES_EN) $(DESTDIR)$(man1dir)/$(UNIX2MAC).1 else cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(MAC2UNIX).1 cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(UNIX2DOS).1 @@ -553,33 +568,46 @@ ifdef ENABLE_NLS $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(MAC2UNIX).1 ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2DOS).1 ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2MAC).1 ;) +endif + +install-mo: mofiles +ifdef ENABLE_NLS @echo "-- install-mo" $(foreach mofile, $(MOFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES ;) $(foreach mofile, $(MOFILES), $(INSTALL_DATA) $(mofile) $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;) endif - # Run a new instance of 'make' otherwise the $$(wildcard ) function my not have been expanded, - # because the files may not have been there when make was started. - $(MAKE) install-doc - -install-doc: $(INSTALL_OBJS_DOC) +install-doc: doc @echo "-- install-doc" $(MKDIR) -p -m 755 $(DESTDIR)$(docdir) $(INSTALL_DATA) $(INSTALL_OBJS_DOC) $(DESTDIR)$(docdir) + $(INSTALL_DATA) $(TXTFILES_EN) $(DESTDIR)$(docdir) + $(INSTALL_DATA) $(HTMLFILES_EN) $(DESTDIR)$(docdir) +ifdef ENABLE_NLS + $(foreach txtfile, $(TXTFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) + $(foreach txtfile, $(TXTFILES), $(INSTALL_DATA) $(txtfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) + $(foreach htmlfile, $(HTMLFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) + $(foreach htmlfile, $(HTMLFILES), $(INSTALL_DATA) $(htmlfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) +endif + +# No dependency. Install pdf/ps only when they have been manually generated. +install-pdf: + @echo "-- install-pdf" + $(MKDIR) -p -m 755 $(DESTDIR)$(docdir) $(foreach pdffile, $(wildcard man/man1/*.pdf), $(INSTALL_DATA) $(pdffile) $(DESTDIR)$(docdir) ;) $(foreach psfile, $(wildcard man/man1/*.ps), $(INSTALL_DATA) $(psfile) $(DESTDIR)$(docdir) ;) ifdef ENABLE_NLS - # Install translated manuals when they have been generated. - $(foreach txtfile, $(wildcard man/*/man1/*.txt), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) - $(foreach txtfile, $(wildcard man/*/man1/*.txt), $(INSTALL_DATA) $(txtfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) - $(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) - $(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(INSTALL_DATA) $(htmlfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) $(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;) $(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(INSTALL_DATA) $(pdffile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;) $(foreach psfile, $(wildcard man/*/man1/*.ps), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;) $(foreach psfile, $(wildcard man/*/man1/*.ps), $(INSTALL_DATA) $(psfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;) endif +install: install-bin install-man install-mo install-doc + # Run a new instance of 'make' otherwise the $$(wildcard ) function my not have been expanded, + # because the files may not have been there when make was started. + $(MAKE) install-pdf + uninstall: @echo "-- target: uninstall" -rm -f $(DESTDIR)$(bindir)/$(BIN) @@ -649,23 +677,23 @@ maintainer-clean: distclean realclean: maintainer-clean -ZIPOBJ = bin/$(BIN) \ - bin/$(MAC2UNIX_BIN) \ - bin/$(UNIX2DOS_BIN) \ - bin/$(UNIX2MAC_BIN) \ - share/man/man1/$(PACKAGE).1 \ - share/man/man1/$(MAC2UNIX).1 \ - share/man/man1/$(UNIX2DOS).1 \ - share/man/man1/$(UNIX2MAC).1 \ - share/doc/$(docsubdir)/*.* \ - $(ZIPOBJ_EXTRA) +ZIPOBJ = bin/$(BIN) \ + bin/$(MAC2UNIX_BIN) \ + bin/$(UNIX2DOS_BIN) \ + bin/$(UNIX2MAC_BIN) \ + share/man/man1/$(PACKAGE).1 \ + share/man/man1/$(MAC2UNIX).1 \ + share/man/man1/$(UNIX2DOS).1 \ + share/man/man1/$(UNIX2MAC).1 \ + share/doc/$(docsubdir)/*.* \ + $(ZIPOBJ_EXTRA) ifdef ENABLE_NLS ZIPOBJ += share/locale/*/LC_MESSAGES/$(PACKAGE).mo ZIPOBJ += share/man/*/man1/$(PACKAGE).1 \ - share/man/*/man1/$(MAC2UNIX).1 \ - share/man/*/man1/$(UNIX2DOS).1 \ - share/man/*/man1/$(UNIX2MAC).1 + share/man/*/man1/$(MAC2UNIX).1 \ + share/man/*/man1/$(UNIX2DOS).1 \ + share/man/*/man1/$(UNIX2MAC).1 ZIPOBJ += share/doc/$(docsubdir)/*/* endif |