diff options
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 230 |
1 files changed, 168 insertions, 62 deletions
diff --git a/Makefile.in b/Makefile.in index c699c11..3c9f2f7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,14 +19,19 @@ package_name = @package_name@ package_version= @package_version@ +package_library = @package_library@ srcdir = @srcdir@ prefix = @prefix@ bindir = @bindir@ libdir = @libdir@ +pkglibdir = @pkglibdir@ +# FIXME: libopkhelper is deprecated. Migrate code and remove this variable. +libopkhelper = @libopkhelper@ datadir = @datadir@ mandir = @mandir@ -libopkhelper = @libopkhelper@ +man1dir = @man1dir@ +localedir = @localedir@ libopkbuild_1 = @libopkbuild_1@ DESTDIR = / @@ -34,75 +39,176 @@ DESTDIR = / sh = @sh@ archtab = @archtab@ -MACROS = \ - 'DESTDIR=$(DESTDIR)' \ - 'prefix=$(prefix)' \ - 'bindir=$(bindir)' \ - 'libdir=$(libdir)' \ - 'datadir=$(datadir)' \ - 'mandir=$(mandir)' \ - 'libopkhelper=$(libopkhelper)' \ - 'libopkbuild_1=$(libopkbuild_1)' \ - 'archtab=$(archtab)' +pkglibbuildsystemdir = $(pkglibdir)/buildsystem + +include $(srcdir)/src/local.mk +include $(srcdir)/lib/local.mk +include $(srcdir)/lib/buildsystem/local.mk +include $(srcdir)/man/local.mk +include $(srcdir)/locale/local.mk + +bin = $(bin_srcs:.sh=) +pkglib = $(pkglib_srcs:.sh=.sm) +pkglibbuildsystem = $(pkglibbuildsystem_srcs:.sh=.sm) +man1 = $(man1_srcs:.1in=.1) +locale = $(locale_srcs:.sh=.ms) distdir = $(package_name)-$(package_version) -distfiles = configure Makefile.in COPYING.2 COPYING.3 \ - README INSTALL ChangeLog TODO +distfiles = \ + configure \ + Makefile.in \ + COPYING.2 \ + COPYING.3 \ + README \ + INSTALL \ + ChangeLog \ + TODO \ + src/local.mk \ + lib/local.mk \ + man/local.mk \ + locale/local.mk \ + $(bin_srcs) \ + $(pkglib_srcs) \ + $(pkglibbuildsystem_srcs) \ + $(man1_srcs) \ + $(locale_srcs) + +# FIXME: libopkhelper is deprecated. Migrate code and remove this variable. +script = \ + s&@@PACKAGE_NAME@@&$(package_name)&;\ + s&@@PACKAGE_VERSION@@&$(package_version)&;\ + s&@@PACKAGE_DESCRIPTION@@&$(package_description)&;\ + s&@@PKGLIBDIR@@&$(pkglibdir)&;\ + s&@@LIBOPKHELPER@@&$(libopkhelper)&;\ + s&@@LOCALEDIR@@&$(localedir)&;\ + s&@@SH@@&$(sh)&; .SUFFIXES: +.SUFFIXES: .sh .sm .1in .1 .ms + +.sh: + @printf ' SED %s\n' '$*' + @sed '$(script)' '$(srcdir)/$*.sh' >'$*' + +.sh.sm: + @printf ' SED %s\n' '$*.sm' + @sed '$(script)' '$(srcdir)/$*.sh' >'$*.sm' + +.1in.1: + @printf ' SED %s\n' '$*.1' + @abmon='Nul Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec '; \ + date=$$(LC_TIME=POSIX ls -l '$(srcdir)/$*.1in' | sed 's/ / /g' | \ + cut -d ' ' -f 6-8); \ + md="$${date% *}"; \ + m="$$(echo $${abmon% $${md% *} *} | wc -w)"; \ + d="$${md#* }"; \ + [ $${m} -lt 10 ] && m="0$${m}"; \ + [ $${d} -lt 10 ] && d="0$${d}"; \ + y="$${date##* }"; \ + [ "$${y%:*}" != "$${y}" ] && y=$$(date '+%Y'); \ + sed "$(script) s&@@DATE@@&$${y}-$${m}-$${d}&;" \ + '$(srcdir)/$*.1in' >'$*.1' + +.sh.ms: + @printf ' CP %s\n' '$*.ms' + @obj='$*'; mkdir -p "$${obj%/*}" + @cp '$(srcdir)/$*.sh' '$*.ms' + +all: all-exec all-data +all-exec: all-bin all-pkglib all-pkglibbuildsystem +all-bin: $(bin) +all-pkglib: $(pkglib) +all-pkglibbuildsystem: $(pkglibbuildsystem) +all-data: all-man1 all-locale +all-man1: $(man1) +all-locale: $(locale) + +clean_cmds = \ + set -e; \ + for f in $${files}; do \ + printf ' RM %s\n' "$${f}"; \ + rm -f "$${f}"; \ + done +clean: clean-exec clean-data +clean-exec: clean-bin clean-pkglib clean-pkglibbuildsystem +clean-bin: + @files='$(bin)'; $(clean_cmds) +clean-pkglib: + @files='$(pkglib)'; $(clean_cmds) +clean-pkglibbuildsystem: + @files='$(pkglibbuildsystem)'; $(clean_cmds) +clean-data: clean-man1 clean-locale +clean-man1: + @files='$(man1)'; $(clean_cmds) +clean-locale: + @files='$(locale)'; $(clean_cmds) + +install_cmds = \ + set -e; \ + mkdir -p "$(DESTDIR)/$${dir}"; \ + for f in $${files}; do \ + printf ' INSTALL %s\n' "$${f}"; \ + ff="$$(basename "$${f}")"; \ + cp "$${f}" "$(DESTDIR)/$${dir}/$${ff}"; \ + chmod "$${mode}" "$(DESTDIR)/$${dir}/$${ff}"; \ + done +install: all install-exec install-data +install-exec: all-exec install-bin install-pkglib install-pkglibbuildsystem +install-bin: + @files='$(bin)'; dir='$(bindir)'; mode='755'; $(install_cmds) +install-pkglib: + @files='$(pkglib)'; dir='$(pkglibdir)'; mode='644'; $(install_cmds) +install-pkglibbuildsystem: + @files='$(pkglibbuildsystem)'; dir='$(pkglibbuildsystemdir)'; \ + mode='644'; $(install_cmds) +install-data: all-data install-man1 install-locale +install-man1: + @files='$(man1)'; dir='$(man1dir)'; mode='644'; $(install_cmds) +install-locale: + @mkdir -p '$(DESTDIR)/$(localedir)' + @set -e; for f in $(locale); do \ + printf ' INSTALL %s\n' "$${f}"; \ + ff="$$(printf '%s' "$${f}" | sed 's|^[^/]*/||')"; \ + [ "x$${ff%/?*}" != "x$${ff}" ] && \ + mkdir -p "$(DESTDIR)/$(localedir)/$${ff%/?*}"; \ + cp "$${f}" "$(DESTDIR)/$(localedir)/$${ff}"; \ + chmod 644 "$(DESTDIR)/$(localedir)/$${ff}"; \ + done -all: - @printf 'Making executable files...\n' - @cd src && $(MAKE) $(MACROS) all - @printf 'Making library files...\n' - @cd lib && $(MAKE) $(MACROS) all - @cd lib/buildsystem && $(MAKE) $(MACROS) all - @printf 'Making locales...\n' - @cd locale && $(MAKE) $(MACROS) all - @printf 'Making manual pages...\n' - @cd man && $(MAKE) $(MACROS) all - -clean: - @printf 'Cleaning executable files...\n' - @cd src && $(MAKE) $(MACROS) clean - @printf 'Cleaning library files...\n' - @cd lib && $(MAKE) $(MACROS) clean - @cd lib/buildsystem && $(MAKE) $(MACROS) clean - @printf 'Cleaning locales...\n' - @cd locale && $(MAKE) $(MACROS) clean - @printf 'Cleaning manual pages...\n' - @cd man && $(MAKE) $(MACROS) clean - -install: all - @printf 'Installing executable files...\n' - @cd src && $(MAKE) $(MACROS) install - @printf 'Installing library files...\n' - @cd lib && $(MAKE) $(MACROS) install - @cd lib/buildsystem && $(MAKE) $(MACROS) install - @printf 'Installing locales...\n' - @cd locale && $(MAKE) $(MACROS) install - @printf 'Installing manual pages...\n' - @cd man && $(MAKE) $(MACROS) install - -uninstall: - @printf 'Uninstalling executable files...\n' - @cd src && $(MAKE) $(MACROS) uninstall - @printf 'Uninstalling library files...\n' - @cd lib/buildsystem && $(MAKE) $(MACROS) uninstall - @cd lib && $(MAKE) $(MACROS) uninstall - @printf 'Uninstalling locales...\n' - @cd locale && $(MAKE) $(MACROS) uninstall - @printf 'Uninstalling manual pages...\n' - @cd man && $(MAKE) $(MACROS) uninstall +uninstall_cmds = \ + set -e; \ + for f in $${files}; do \ + printf ' RM %s\n' "$${f}"; \ + ff="$$(basename "$${f}")"; \ + rm -f "$(DESTDIR)/$${dir}/$${ff}"; \ + done +uninstall: uninstall-exec uninstall-data +uninstall-exec: uninstall-bin uninstall-pkglibbuildsystem uninstall-pkglib +uninstall-bin: + @files='$(bin)'; dir='$(bindir)'; $(uninstall_cmds) +uninstall-pkglib: + @files='$(pkglib)'; dir='$(pkglibdir)'; $(uninstall_cmds) + @rmdir '$(DESTDIR)/$(pkglibdir)' +uninstall-pkglibbuildsystem: + @files='$(pkglibbuildsystem)'; dir='$(pkglibbuildsystemdir)'; \ + $(uninstall_cmds) + @rmdir '$(DESTDIR)/$(pkglibbuildsystemdir)' +uninstall-data: uninstall-man1 uninstall-locale +uninstall-man1: + @files='$(man1)'; dir='$(man1dir)'; $(uninstall_cmds) +uninstall-locale: + @set -e; for f in $(locale); do \ + printf ' RM %s\n' "$${f}"; \ + ff="$$(printf '%s' "$${f}" | sed 's|^[^/]*/||')"; \ + rm -f "$(DESTDIR)/$(localedir)/$${ff}"; \ + done $(distdir): @mkdir -p '$(distdir)' - @cp -pR $(distfiles) '$(distdir)' - @cd src && $(MAKE) '../$(distdir)/src' - @cd lib && $(MAKE) '../$(distdir)/lib' - @cd lib/buildsystem && $(MAKE) '../../$(distdir)/lib/buildsystem' - @cd locale && $(MAKE) '../$(distdir)/locale' - @cd man && $(MAKE) '../$(distdir)/man' + @set -e; for f in $(distfiles); do \ + mkdir -p "$(distdir)/$$(dirname $${f})"; \ + cp -p "$${f}" "$(distdir)/$${f}"; \ + done dist dist-gzip: $(distdir) @tar -cf - '$(distdir)' | gzip -9c > '$(distdir).tar.gz' |