xref: /netbsd-src/crypto/external/bsd/netpgp/dist/Makefile.in (revision c8da0e5fefd3800856b306200a18b2315c7fbb9f)
1# $Id: Makefile.in,v 1.1.1.1 2009/04/23 06:31:56 agc Exp $
2
3@SET_MAKE@
4SHELL = @SHELL@
5VPATH=@srcdir@
6
7PACKAGE_NAME= @PACKAGE_NAME@
8PACKAGE_VERSION= @PACKAGE_VERSION@
9
10srcdir = @srcdir@
11VPATH = @srcdir@
12prefix = @prefix@
13exec_prefix = @exec_prefix@
14
15bindir = @bindir@
16mandir = @mandir@
17top_builddir = .
18
19AUTOCONF = @AUTOCONF@
20AUTOHEADER = @AUTOHEADER@
21mkinstalldirs = $(SHELL) $(srcdir)/mkinstalldirs
22install_sh = $(SHELL) $(srcdir)/install-sh
23
24INSTALL = @INSTALL@
25INSTALL_PROGRAM = @INSTALL_PROGRAM@
26INSTALL_DATA = @INSTALL_DATA@
27INSTALL_SCRIPT = @INSTALL_SCRIPT@
28INSTALL_HEADER = $(INSTALL_DATA)
29transform = @program_transform_name@
30host_alias = @host_alias@
31host_triplet = @host@
32CANONICAL_HOST = @CANONICAL_HOST@
33
34CC = @CC@
35CCLD= $(CC)
36LIBS= @LIBS@
37CPPFLAGS= @CPPFLAGS@
38DEFS= @DEFS@ -I. -I@srcdir@ -DHOST=\"$(CANONICAL_HOST)\" -DVERSION=\"$(PACKAGE_VERSION)\"
39CFLAGS= @CFLAGS@
40LDFLAGS= @LDFLAGS@
41
42LINK= $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
43COMPILE= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS)
44
45all: lib bin
46
47lib:
48	cd src/lib && ${MAKE}
49
50bin:
51	cd src/bin && ${MAKE}
52
53install: all
54	cd src/lib && ${MAKE} install
55	cd src/bin && ${MAKE} install
56
57clean:
58	cd src/lib && ${MAKE} clean
59	cd src/bin && ${MAKE} clean
60
61GZIP_ENV= --best
62TAR= tar
63distdir= $(PACKAGE_NAME)-$(PACKAGE_VERSION)
64
65distdir: $(DISTFILES)
66	-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
67	mkdir $(distdir)
68	@for file in $(DISTFILES); do \
69		if test -f $$file; then d=.; else d=$(srcdir); fi; \
70		dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
71		if test "$$dir" != "$$file" && test "$$dir" != "."; then \
72			$(mkinstalldirs) "$(distdir)/$$dir"; \
73		fi; \
74		if test -d $$d/$$file; then \
75			cp -pR $$d/$$file $(distdir) \
76			|| exit 1; \
77		else \
78			test -f $(distdir)/$$file \
79			|| cp -p $$d/$$file $(distdir)/$$file \
80			|| exit 1; \
81		fi; \
82	done
83	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
84	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
85	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
86	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
87	|| chmod -R a+r $(distdir)
88
89dist: distdir
90	$(TAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
91	-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
92
93distcheck: dist
94	-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
95	GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(TAR) xf -
96	chmod -R a-w $(distdir); chmod a+w $(distdir)
97	mkdir $(distdir)/=build
98	mkdir $(distdir)/=inst
99	chmod a-w $(distdir)
100	dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
101	  && cd $(distdir)/=build \
102	  && ../configure --srcdir=.. --prefix=$$dc_install_base \
103	  && $(MAKE) \
104	  && $(MAKE) check \
105	  && $(MAKE) install \
106	  && $(MAKE) uninstall \
107	  && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
108	     || (echo "Error: files left after uninstall" 1>&2; \
109	         exit 1) ) \
110	  && $(MAKE) dist \
111	  && $(MAKE) distclean \
112	  && rm -f $(distdir).tar.gz \
113	  && (test `find . -type f -print | wc -l` -eq 0 \
114	     || (echo "Error: files left after distclean" 1>&2; \
115	         exit 1) )
116	-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
117	@echo "$(distdir).tar.gz is ready for distribution" | \
118	  sed 'h;s/./=/g;p;x;p;x'
119