1#
2# Makefile for top level of zsh distribution
3#
4# Copyright (c) 1995-1997 Richard Coleman
5# All rights reserved.
6#
7# Permission is hereby granted, without written agreement and without
8# license or royalty fees, to use, copy, modify, and distribute this
9# software and to distribute modified versions of this software for any
10# purpose, provided that the above copyright notice and the following
11# two paragraphs appear in all copies of this software.
12#
13# In no event shall Richard Coleman or the Zsh Development Group be liable
14# to any party for direct, indirect, special, incidental, or consequential
15# damages arising out of the use of this software and its documentation,
16# even if Richard Coleman and the Zsh Development Group have been advised of
17# the possibility of such damage.
18#
19# Richard Coleman and the Zsh Development Group specifically disclaim any
20# warranties, including, but not limited to, the implied warranties of
21# merchantability and fitness for a particular purpose.  The software
22# provided hereunder is on an "as is" basis, and Richard Coleman and the
23# Zsh Development Group have no obligation to provide maintenance,
24# support, updates, enhancements, or modifications.
25#
26
27subdir = .
28dir_top = .
29SUBDIRS = Doc Etc Src Test
30
31@VERSION_MK@
32
33# source/build directories
34VPATH           = @srcdir@
35sdir            = @srcdir@
36sdir_top        = @top_srcdir@
37INSTALL         = @INSTALL@
38
39@DEFS_MK@
40
41# ========== DEPENDENCIES FOR BUILDING ==========
42
43# default target
44all: config.h config.modules
45	@for subdir in Src Doc; do \
46	  (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
47	done
48
49# prepare module configuration
50prep:
51	@cd Src && $(MAKE) $(MAKEDEFS) $@
52
53META-FAQ: FORCE
54	@cd Doc && $(MAKE) $(MAKEDEFS) ../META-FAQ
55
56dvi ps html info pdf:
57	@cd Doc && $(MAKE) $(MAKEDEFS) $@
58
59# ========== DEPENDENCIES FOR INSTALLING ==========
60
61# install stripped
62install-strip:
63	$(MAKE) install STRIPFLAGS=""
64
65# install/uninstall most things
66install: install.bin install.modules install.fns install.man
67uninstall: uninstall.bin uninstall.modules uninstall.fns uninstall.man
68
69# install/uninstall just the binary
70install.bin uninstall.bin:
71	@cd Src && $(MAKE) $(MAKEDEFS) $@
72
73# install/uninstall just the modules
74install.modules uninstall.modules:
75	@cd Src && $(MAKE) $(MAKEDEFS) $@
76
77# install/uninstall just the man pages
78install.man uninstall.man:
79	@cd Doc && $(MAKE) $(MAKEDEFS) $@
80
81# install/uninstall just the shell functions
82install.fns:
83	if test x$(fndir) != x && test x$(fndir) != xno; then \
84	  test x$(sitefndir) != xno && \
85	    $(SHELL) $(sdir_top)/mkinstalldirs $(DESTDIR)$(sitefndir); \
86	  sdir_top="$(sdir_top)" fndir="$(fndir)" dir_top="$(dir_top)" \
87	  scriptdir="$(scriptdir)" \
88	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
89	  INSTALL_DATA="$(INSTALL_DATA)" \
90	  INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
91	  DESTDIR="$(DESTDIR)" VERSION="$(VERSION)" \
92	  $(SHELL) $(sdir_top)/Config/installfns.sh || exit 1; \
93	fi; \
94	exit 0
95
96uninstall.fns:
97	if test x$(fndir) != x && test x$(fndir) != xno; then \
98	  fndir="$(fndir)" dir_top="$(dir_top)" \
99	  scriptdir="$(scriptdir)" \
100	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
101	  DESTDIR="$(DESTDIR)" VERSION="$(VERSION)" \
102	  $(SHELL) $(sdir_top)/Config/uninstallfns.sh || exit 1; \
103	fi; \
104	exit 0
105
106# install/uninstall just the info pages
107install.info uninstall.info:
108	@cd Doc && $(MAKE) $(MAKEDEFS) $@
109
110# install/uninstall just the HTML manual
111install.html uninstall.html:
112	@cd Doc && $(MAKE) $(MAKEDEFS) $@
113
114# ========== DEPENDENCIES FOR TESTING ==========
115check test:
116	cd Test ; $(MAKE) check
117
118# ========== DEPENDENCIES FOR CLEANUP ==========
119
120@CLEAN_MK@
121
122distclean-here:
123	rm -f Makefile config.h config.status config.log config.cache config.modules config.modules.sh stamp-h Config/defs.mk
124	rm -rf autom4te.cache
125
126realclean-here:
127	cd $(sdir) && rm -f config.h.in stamp-h.in configure
128
129# ========== DEPENDENCIES FOR MAINTENANCE ==========
130
131@CONFIG_MK@
132
133config: config.h
134
135config.status: $(sdir)/configure
136	$(SHELL) ./config.status --recheck
137
138$(sdir)/configure: $(sdir)/aclocal.m4 $(sdir)/aczsh.m4 $(sdir)/configure.ac
139
140config.h: stamp-h
141stamp-h: $(sdir)/config.h.in config.status
142	cd $(dir_top) && $(SHELL) ./config.status config.h $@
143
144config.modules: $(sdir)/config.h.in config.status config.modules.sh
145	cd $(dir_top) && $(SHELL) ./config.status $@ && \
146	$(SHELL) ./config.modules.sh
147
148$(sdir)/config.h.in: $(sdir)/stamp-h.in
149$(sdir)/stamp-h.in: $(sdir)/configure.ac \
150		$(sdir)/aclocal.m4 $(sdir)/aczsh.m4
151	echo > $(sdir)/stamp-h.in
152
153# ========== DEPENDENCIES FOR DISTRIBUTION ==========
154
155DISTNAME = zsh-$(VERSION)
156
157targz-src: $(DISTNAME).tar.gz
158$(DISTNAME).tar.gz: FORCE
159	@$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) SRC \
160	    $(MAKE) $(MAKEDEFS)
161	tar cf - $(DISTNAME) | gzip -9 > $@
162	rm -rf $(DISTNAME)
163
164targz-doc: $(DISTNAME)-doc.tar.gz
165$(DISTNAME)-doc.tar.gz: FORCE
166	@$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) DOC \
167	    $(MAKE) $(MAKEDEFS)
168	tar cf - $(DISTNAME) | gzip -9 > $@
169	rm -rf $(DISTNAME)
170
171FORCE:
172