Makefile.in 3.75 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# Top-level lsh Makefile

@SET_MAKE@

srcdir = @srcdir@
VPATH = @srcdir@

PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@

AUTOCONF = autoconf

# The directories most targets should recurse into
BUILD_SUBDIRS = @BUILD_SUBDIRS@ src

SUBDIRS = argp nettle spki src

all check:
19
	set -e; for d in $(BUILD_SUBDIRS); do \
20 21
	  echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done

22
# Don't install any of the bundled libraries.
23
install uninstall:
24
	cd src && $(MAKE) $@
25 26 27 28 29 30 31 32 33

clean distclean mostlyclean maintainer-clean tags:
	set -e; for d in $(SUBDIRS); do \
	  echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done
	$(MAKE) $@-here

all-here check-here tags-here clean-here:
	true

34
distclean-here: clean-here
35 36
	-rm -f config.log config.status Makefile

37
maintainer-clean-here: distclean-here
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

bootstrap:
	set -e; for d in spki src; do \
	  echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done

# Configure-related rules, mostly copied from the autoconf manual. No
# $(srcdir) prefixes on the targets, though.

configure: configure.ac aclocal.m4
	cd $(srcdir) && $(AUTOCONF)

config.status: configure
	./config.status --recheck

Makefile: Makefile.in config.status
	./config.status $@

# Distribution
DISTFILES = .bootstrap aclocal.m4 configure.ac \
57
	    configure \
58 59 60 61
	    config.guess config.sub install-sh texinfo.tex \
	    Makefile.in \
	    ANNOUNCE AUTHORS FAQ README COPYING \
	    ChangeLog ChangeLog.1 ChangeLog.2 \
62
	    NEWS distribution-key.gpg
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

distdir = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
top_distdir = $(distdir)

# We should handle both absolute and relative $destdir.

distdir: $(DISTFILES)
	rm -rf "$(distdir)"
	mkdir "$(distdir)"
	set -e; for f in $(DISTFILES) ; do \
	  if [ -f "$$f" ] ; then cp "$$f" "$(distdir)" ; \
	  else cp "$(srcdir)/$$f" "$(distdir)" ; \
	  fi ; \
	done
	set -e; for d in $(SUBDIRS); do \
	  sd="$(distdir)/$$d" ; \
	  mkdir "$$sd" && $(MAKE) -C $$d distdir="`cd $$sd && pwd`" $@ ; \
	done

dist: distdir
	tar cf - $(distdir) | gzip -c >$(distdir).tar.gz	
	rm -rf $(distdir)

rm_distcheck = test ! -d distcheck-tmp \
	    || { find distcheck-tmp -type d ! -perm -200 -exec chmod u+w {} ';' \
                 && rm -fr distcheck-tmp; }; 

distcheck: dist
	$(rm_distcheck)
	mkdir distcheck-tmp
	gzip -d < $(distdir).tar.gz \
	  | { cd distcheck-tmp && tar xf - && chmod -R a-w $(distdir) ; }
	mkdir distcheck-tmp/build
	mkdir distcheck-tmp/install
	cd distcheck-tmp/build && ../$(distdir)/configure --prefix="`cd ../install && pwd`"
	cd distcheck-tmp/build && $(MAKE)
	cd distcheck-tmp/build && $(MAKE) check
	cd distcheck-tmp/build && $(MAKE) install
	cd distcheck-tmp/build && $(MAKE) uninstall
	cd distcheck-tmp && find install -type f -print > leftover-install-files
	@test `cat distcheck-tmp/leftover-install-files | wc -l` -le 1  \
	  || { echo "ERROR: files left after uninstall:" ; \
	       cat distcheck-tmp/leftover-install-files ; \
	       exit 1; }
	chmod -R a-w distcheck-tmp/install
	mkdir distcheck-tmp/destdir
	destdir="`cd distcheck-tmp/destdir && pwd`" \
	  && cd distcheck-tmp/build \
	  && $(MAKE) install DESTDIR="$$destdir" \
	  && $(MAKE) uninstall DESTDIR="$$destdir"
	cd distcheck-tmp && find destdir -type f -print > leftover-destdir-files
	@test `cat distcheck-tmp/leftover-destdir-files | wc -l` -le 1  \
	  || { echo "ERROR: destdir files left after uninstall:" ; \
	       cat distcheck-tmp/leftover-destdir-files ; \
	       exit 1; }	
	cd distcheck-tmp/build && $(MAKE) dist
	cd distcheck-tmp/build && rm *.gz
	cd distcheck-tmp/build && $(MAKE) distclean
	cd distcheck-tmp && find build -type f -print > leftover-build-files
	@test `cat distcheck-tmp/leftover-build-files | wc -l` -eq 0  \
	  || { echo "ERROR: files left in build directory after distclean:" ; \
	       cat distcheck-tmp/leftover-build-files ; \
	       exit 1; }
	$(rm_distcheck)