1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 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
|
#
# Variables
# Variables established by Configure
CHMOD = /bin/chmod
CP = /bin/cp
DEST = $(DESTDIR)/usr/local/bin
ECHO = /bin/echo
FORMATTER = /bin/troff
FORMATTER_OPTS =
LN = /bin/ln
MAKE = /usr/ccs/bin/make
MAN = $(DESTDIR)/usr/man/mann
MANEXT = .n
CATMAN = none
CATMANEXT =
RM = /bin/rm -f
TBL = /bin/tbl
MANROFF =
MANROFF_OPTS =
MV = /bin/mv
TEST = test
SUFFIX =
PACKED =
PACKER =
# Other variables
SHELL = /bin/sh
# List of installed man pages
MAN_LIST = $(MAN)/filter$(MANEXT)
CATMAN_LIST = $(CATMAN)/filter$(CATMANEXT)$(SUFFIX)
# List of formatted pages for catman
FORMATTED_PAGES_LIST = catman/filter$(CATMANEXT)$(SUFFIX)
REMOTE_MAN_LIST = $(REMOTE)$(MAN)/filter$(MANEXT)
# List of formatted guides
FORMATTED_LIST = Filter.fmtd
# Targets
all:
@if $(TEST) '$(CATMAN)' != none; then $(MAKE) $(MFLAGS) formatted_pages ; else true ; fi
# The following are no-ops
lint:
clean:
formatted_pages: catman $(FORMATTED_PAGES_LIST)
catman:
mkdir catman
install:
@if $(TEST) '$(MAN)' != none; then $(MAKE) $(MFLAGS) install_man ; else true ; fi
@if $(TEST) '$(CATMAN)' != none; then $(MAKE) $(MFLAGS) install_catman ; else true ; fi
install_man: $(MAN_LIST)
install_catman: $(CATMAN_LIST)
uninstall:
@if $(TEST) '$(MAN)' != none; then \
$(RM) $(MAN_LIST) ; \
else \
true ; \
fi
@if $(TEST) '$(CATMAN)' != none; then \
$(RM) $(CATMAN_LIST) ; \
else \
true ; \
fi
# Dependencies and rules for installing man pages and lib files
# taken from a remote system
# This is the only target that gets installed even if not out-of-date
# with respect the files from which it is installed.
rmt-install: rmt-defined
$(CP) $(REMOTE_MAN_LIST) $(MAN)
$(CHMOD) u=rw,go=r $(MAN_LIST)
rmt-defined:
@(if [ "$(REMOTE)" = "" ];\
then\
$(ECHO) "You need to define 'REMOTE' as the remote file system";\
$(ECHO) "for this particular command. The easiest way to do this";\
$(ECHO) "to type:";\
$(ECHO) " make REMOTE=<remote file system> rmt-install";\
exit 1;\
fi);
# Dependencies and rules for installing man pages and lib files
$(MAN)/filter$(MANEXT): filter.1
$(CP) $? $@
$(CHMOD) u=rw,go=r $@
# Dependencies and rules for installing catman
$(CATMAN)/filter$(CATMANEXT)$(SUFFIX): catman/filter$(CATMANEXT)$(SUFFIX)
$(CP) $? $@
$(CHMOD) u=rw,go=r $@
# Dependencies and rules for making catman pages
catman/filter$(CATMANEXT)$(SUFFIX): filter.1
$(MANROFF) $(MANROFF_OPTS) -man $? > catman/filter$(CATMANEXT)
@if $(TEST) "$(PACKED)" = y ; then \
$(RM) $@ ; \
$(PACKER) catman/filter$(CATMANEXT) ; \
else \
true ; \
fi
# Dependencies and rules for formatting guides
documentation: $(FORMATTED_LIST)
Filter.fmtd: Filter.guid
$(TBL) $? | $(FORMATTER) $(FORMATTER_OPTS) tmac.n - > $@
|