1# Makefile for man
2# [need allow_null_glob_expansion=true]
3# The parts behind % are removed when no message catalogs should be installed
4
5all:	Makefile conf_script source manpages %messages
6	@echo; echo 'You can now do "make install"'
7
8# On a machine with time before distribution time
9# it may be necessary to touch all distributed files
10
11Makefile: Makefile.in configure
12	@echo "Please run configure first"
13	exit 1
14
15conf_script:	configure
16	@echo "Please run configure first"
17	exit 1
18
19src/Makefile:	conf_script src/Makefile.in
20	cd src; ../conf_script Makefile
21
22man2html/Makefile:	conf_script man2html/Makefile.in
23	cd man2html; ../conf_script Makefile			
24
25man/Makefile:	conf_script man/Makefile.in
26	cd man; ../conf_script Makefile
27
28msgs/Makefile:	conf_script msgs/Makefile.in
29	cd msgs; ../conf_script Makefile
30
31makefiles: src/Makefile man2html/Makefile man/Makefile msgs/Makefile
32
33source:	src/Makefile
34	cd src; $(MAKE)
35
36manhtml: man2html/Makefile source
37	cd man2html; $(MAKE)
38
39manpages: man/Makefile
40	cd man; $(MAKE) subdirs
41
42%messages: gencat/gencat msgs/Makefile source
43%	cd msgs; $(MAKE)
44
45%gencat/gencat:
46%	cd gencat; $(MAKE)
47
48install: src/Makefile man/Makefile %msgs/Makefile
49	cd src; $(MAKE) install
50	cd man; $(MAKE) installsubdirs
51%	cd msgs; $(MAKE) install
52	@echo; echo 'Done.'
53	@echo 'In case you want to browse man pages using a www browser,'
54	@echo '"cd man2html", read README, and perhaps "make install-scripts".'
55#	@echo; echo 'Done. In case you want to mount /usr read-only, please'
56#	@echo 'install a symlink /usr/man/whatis -> /var/catman/whatis, or so.'
57
58clean: src/Makefile man/Makefile msgs/Makefile man2html/Makefile
59	cd src; $(MAKE) clean
60	cd man2html; $(MAKE) clean
61	cd man; $(MAKE) cleansubdirs
62	cd msgs; $(MAKE) clean
63	cd gencat; $(MAKE) clean
64	rm -f core *~
65
66spotless distclean reallyclean: clean
67	cd src; $(MAKE) spotless
68	cd man2html; $(MAKE) spotless
69	cd man; $(MAKE) spotlesssubdirs
70	cd msgs; $(MAKE) spotless
71	cd gencat; $(MAKE) clean
72	rm -f conf_script Makefile
73
74DISTR = COPYING README README.HP README.RedHat README.GNU-WIN32 INSTALL \
75	Makefile.in configure src man2html man msgs gencat catopen misc
76