Makefile.comm revision 55839
1# Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. 2# Written by James Clark (jjc@jclark.com) 3# 4# This file is part of groff. 5# 6# groff is free software; you can redistribute it and/or modify it under 7# the terms of the GNU General Public License as published by the Free 8# Software Foundation; either version 2, or (at your option) any later 9# version. 10# 11# groff is distributed in the hope that it will be useful, but WITHOUT ANY 12# WARRANTY; without even the implied warranty of MERCHANTABILITY or 13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14# for more details. 15# 16# You should have received a copy of the GNU General Public License along 17# with groff; see the file COPYING. If not, write to the Free Software 18# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19# 20# Makefile.comm 21# 22SHELL=/bin/sh 23INCLUDES=-I. -I$(srcdir) -I../include -I$(srcdir)/../include 24ALL_CCFLAGS=$(INCLUDES) $(CCDEFINES) $(CCFLAGS) $(CPPFLAGS) 25COMPILE.cc=$(CCC) $(ALL_CCFLAGS) -c 26ALL_CFLAGS=$(CDEFINES) $(CFLAGS) $(CPPFLAGS) 27COMPILE.c=$(CC) $(ALL_CFLAGS) -c 28LINK.cc=$(CCC) $(CCFLAGS) $(LDFLAGS) 29LINK.c=$(CC) $(CFLAGS) $(LDFLAGS) 30TOP=.. 31LIBGROFF=$(TOP)/libgroff/libgroff.a 32LIBBIB=$(TOP)/libbib/libbib.a 33LIBDRIVER=$(TOP)/libdriver/libdriver.a 34MLIB= 35XLIBS= 36YTABH= 37YTABC= 38GRAM= 39LIBCLEAN= 40CLEANADD= 41MOSTLYCLEANFILES=$(MANCLEAN) $(PROG) $(OBJS) $(GENSRCS) $(GENHDRS) \ 42 depend.temp core y.output $(CLEANADD) 43CLEANFILES=$(LIBCLEAN) 44DISTCLEANFILES=TAGS Makefile 45REALCLEANFILES=$(YTABC) $(YTABH) 46NAMEPREFIX= 47HDRS= 48MANPAGES=$(MAN1) $(MAN5) $(MAN7) 49MANCLEAN=$(MANPAGES) 50fontsubdir=$(fontdir)/dev$(DEV) 51 52all install install_bin install_data TAGS depend distfiles uninstall_sub: 53 54install: install_bin install_data 55uninstall: uninstall_sub 56pure: 57 58.PHONY: all clean distclean mostlyclean realclean extraclean depend distfiles 59.PHONY: install install_bin install_data 60.PHONY: uninstall uninstall_sub 61.PHONY: pure 62 63mostlyclean: 64 -rm -f $(MOSTLYCLEANFILES) 65 66clean: 67 -rm -f $(CLEANFILES) $(MOSTLYCLEANFILES) 68 69distclean: 70 -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES) 71 72realclean: 73 -rm -f $(REALCLEANFILES) $(DISTCLEANFILES) $(CLEANFILES) \ 74 $(MOSTLYCLEANFILES) 75 76extraclean: 77 -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES) \ 78 \#* *~ =* core junk grot old temp tmp tem 79 80.SUFFIXES: 81.SUFFIXES: .o .cc .c .y .man .n 82 83.cc.o: 84 $(COMPILE.cc) $< 85 86.c.o: 87 $(COMPILE.c) $< 88 89.y.cc: 90 if test -n "$(YTABH)"; then \ 91 $(YACC) $(YACCFLAGS) -d $<; \ 92 else \ 93 $(YACC) $(YACCFLAGS) $<; \ 94 fi 95 mv y.tab.c $@ 96# Avoid ending up with two versions of $(YTABH). 97 if test -n "$(YTABH)"; then \ 98 if test -f $(srcdir)/$(YTABH); then \ 99 rm -f $(YTABH); \ 100 mv y.tab.h $(srcdir)/$(YTABH); \ 101 else \ 102 mv y.tab.h $(YTABH); \ 103 fi; \ 104 fi 105 106.man.n: 107 @echo Making $@ from $< 108 @-rm -f $@ 109 @sed -e "s;@FONTDIR@;$(fontdir);g" \ 110 -e "s;@FONTPATH@;$(fontpath);g" \ 111 -e "s;@MACRODIR@;$(tmacdir);g" \ 112 -e "s;@MACROPATH@;$(tmacpath);g" \ 113 -e "s;@DEVICE@;$(DEVICE);g" \ 114 -e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \ 115 -e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \ 116 -e "s;@INDEX_SUFFIX@;$(indexext);g" \ 117 -e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \ 118 -e "s;@MAN1EXT@;$(man1ext);g" \ 119 -e "s;@MAN5EXT@;$(man5ext);g" \ 120 -e "s;@MAN7EXT@;$(man7ext);g" \ 121 -e "s;@TMAC_S_PREFIX@;$(tmac_s_prefix);g" \ 122 -e "s;@TMAC_M_PREFIX@;$(tmac_m_prefix);g" \ 123 -e "s;@TMAC_AN_PREFIX@;$(tmac_an_prefix);g" \ 124 -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \ 125 -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \ 126 -e "s;@VERSION@;`cat $(srcdir)/../VERSION`;g" \ 127 -e "s;@MDATE@;`$(SHELL) $(srcdir)/../mdate.sh $<`;g" \ 128 -e "s;@g@;$(g);g" \ 129 -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \ 130 $< >$@ 131 132.PHONY: install_man 133install_man: 134 -test -d $(manroot) || mkdir $(manroot) 135 -test -d $(man1dir) || mkdir $(man1dir) 136 @-pages="$(MAN1)"; \ 137 for p in $$pages; do \ 138 prog=`basename $$p .n`; \ 139 target=$(man1dir)/$(NAMEPREFIX)$$prog.$(man1ext); \ 140 rm -f $$target; \ 141 echo $(INSTALL_DATA) $$p $$target; \ 142 $(INSTALL_DATA) $$p $$target; \ 143 done 144 -test -d $(man5dir) || mkdir $(man5dir) 145 @-pages="$(MAN5)"; \ 146 for p in $$pages; do \ 147 target=$(man5dir)/`basename $$p .n`.$(man5ext); \ 148 rm -f $$target; \ 149 echo $(INSTALL_DATA) $$p $$target; \ 150 $(INSTALL_DATA) $$p $$target; \ 151 done 152 -test -d $(man7dir) || mkdir $(man7dir) 153 @-pages="$(MAN7)"; \ 154 for p in $$pages; do \ 155 target=$(man7dir)/`basename $$p .n`.$(man7ext); \ 156 rm -f $$target; \ 157 echo $(INSTALL_DATA) $$p $$target; \ 158 $(INSTALL_DATA) $$p $$target; \ 159 done 160 161.PHONY: uninstall_man 162uninstall_man: 163 @-pages="$(MAN1)"; \ 164 for p in $$pages; do \ 165 target=$(man1dir)/$(NAMEPREFIX)`basename $$p .n`.$(man1ext); \ 166 echo rm -f $$target; \ 167 rm -f $$target; \ 168 done 169 @-pages="$(MAN5)"; \ 170 for p in $$pages; do \ 171 target=$(man5dir)/`basename $$p .n`.$(man5ext); \ 172 echo rm -f $$target; \ 173 rm -f $$target; \ 174 done 175 @-pages="$(MAN7)"; \ 176 for p in $$pages; do \ 177 target=$(man7dir)/`basename $$p .n`.$(man7ext); \ 178 echo rm -f $$target; \ 179 rm -f $$target; \ 180 done 181 182.PHONY: install_prog 183install_prog: 184 -test -d $(bindir) || mkdir $(bindir) 185 rm -f $(bindir)/$(NAMEPREFIX)$(PROG) 186 $(INSTALL_PROGRAM) $(PROG) $(bindir)/$(NAMEPREFIX)$(PROG) 187 188.PHONY: uninstall_prog 189uninstall_prog: 190 -rm -f $(bindir)/$(NAMEPREFIX)$(PROG) 191 192.PHONY: install_dev 193install_dev: 194 -test -d $(datadir) || mkdir $(datadir) 195 -test -d $(datasubdir) || mkdir $(datasubdir) 196 -test -d $(fontdir) || mkdir $(fontdir) 197 -test -d $(fontsubdir) || mkdir $(fontsubdir) 198 -if test -d $(srcdir)/generate; then \ 199 test -d $(fontsubdir)/generate || mkdir $(fontsubdir)/generate; \ 200 fi 201 -for f in $(DEVFILES); do \ 202 rm -f $(fontsubdir)/$$f; \ 203 if test -f $$f; then \ 204 $(INSTALL_DATA) $$f $(fontsubdir)/$$f; \ 205 else \ 206 $(INSTALL_DATA) $(srcdir)/$$f $(fontsubdir)/$$f; \ 207 fi; \ 208 done 209 210.PHONY: uninstall_dev 211uninstall_dev: 212 -for f in $(DEVFILES); do rm -f $(fontsubdir)/$$f; done 213 -if test -d $(fontsubdir)/generate; then \ 214 rmdir $(fontsubdir)/generate; \ 215 fi 216 -rmdir $(fontsubdir) 217 218.PHONY: depend_src 219depend_src: depend.temp 220 mv depend.temp Makefile.dep 221 222depend.temp: FORCE 223 > depend.temp; 224 test -z "$(CCSRCS)$(YTABC)" \ 225 || $(CCC) $(ALL_CCFLAGS) -MM $(CCSRCS) $(YTABC) >>depend.temp 226 test -z "$(CSRCS)" \ 227 || $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp 228 if test -n "$(YTABH)"; then \ 229 sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend.temp1; \ 230 mv depend.temp1 depend.temp; \ 231 fi 232 233.PHONY: TAGS_src 234TAGS_src: 235 $(ETAGS) $(ETAGSFLAGS) $(CCSRCS) $(CSRCS) 236 test -z "$(GRAM)$(HDRS)" \ 237 || $(ETAGS) $(ETAGSFLAGS) -a $(ETAGSCCFLAG) $(GRAM) $(HDRS) 238 239Makefile: 240 -rm -f Makefile 241 echo srcdir=$(srcdir) >>Makefile 242 echo VPATH=$(VPATH) >>Makefile 243 cat $(MAKEFILEPARTS) /dev/null >>Makefile 244 245FORCE: 246 247.NOEXPORT: 248