Makefile.comm revision 18099
1151497Sru# Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. 2151497Sru# Written by James Clark (jjc@jclark.com) 3151497Sru# 4151497Sru# This file is part of groff. 5151497Sru# 6151497Sru# groff is free software; you can redistribute it and/or modify it under 7151497Sru# the terms of the GNU General Public License as published by the Free 8151497Sru# Software Foundation; either version 2, or (at your option) any later 9151497Sru# version. 10151497Sru# 11151497Sru# groff is distributed in the hope that it will be useful, but WITHOUT ANY 12151497Sru# WARRANTY; without even the implied warranty of MERCHANTABILITY or 13151497Sru# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14151497Sru# for more details. 15151497Sru# 16151497Sru# You should have received a copy of the GNU General Public License along 17151497Sru# with groff; see the file COPYING. If not, write to the Free Software 18151497Sru# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19151497Sru# 20104862Sru# Makefile.comm 21151497Sru# 22151497SruSHELL=/bin/sh 23151497SruINCLUDES=-I. -I$(srcdir) -I../include -I$(srcdir)/../include 24151497SruALL_CCFLAGS=$(INCLUDES) $(CCDEFINES) $(CCFLAGS) $(CPPFLAGS) 25151497SruCOMPILE.cc=$(CCC) $(ALL_CCFLAGS) -c 26151497SruALL_CFLAGS=$(CDEFINES) $(CFLAGS) $(CPPFLAGS) 27151497SruCOMPILE.c=$(CC) $(ALL_CFLAGS) -c 28151497SruLINK.cc=$(CCC) $(CCFLAGS) $(LDFLAGS) 29151497SruLINK.c=$(CC) $(CFLAGS) $(LDFLAGS) 30151497SruTOP=.. 31151497SruLIBGROFF=$(TOP)/libgroff/libgroff.a 32151497SruLIBBIB=$(TOP)/libbib/libbib.a 33151497SruLIBDRIVER=$(TOP)/libdriver/libdriver.a 34151497SruLIBM=-lm 35151497SruMLIB= 36151497SruXLIBS= 37151497SruYTABH= 38151497SruYTABC= 39151497SruGRAM= 40151497SruLIBCLEAN= 41151497SruCLEANADD= 42151497SruMOSTLYCLEANFILES=$(MANCLEAN) $(PROG) $(OBJS) $(GENSRCS) $(GENHDRS) \ 43151497Sru depend.temp core y.output $(CLEANADD) 44151497SruCLEANFILES=$(LIBCLEAN) 45151497SruDISTCLEANFILES=TAGS Makefile 46151497SruREALCLEANFILES=$(YTABC) $(YTABH) 47151497SruNAMEPREFIX= 48151497SruHDRS= 49151497SruMANPAGES=$(MAN1) $(MAN5) $(MAN7) 50151497SruMANCLEAN=$(MANPAGES) 51151497Srufontsubdir=$(fontdir)/dev$(DEV) 52151497Sru 53151497Sruall install install_bin install_data TAGS depend distfiles uninstall_sub: 54151497Sru 55151497Sruinstall: install_bin install_data 56151497Sruuninstall: uninstall_sub 57151497Srupure: 58151497Sru 59151497Sru.PHONY: all clean distclean mostlyclean realclean extraclean depend distfiles 60151497Sru.PHONY: install install_bin install_data 61151497Sru.PHONY: uninstall uninstall_sub 62151497Sru.PHONY: pure 63151497Sru 64151497Srumostlyclean: 65151497Sru -rm -f $(MOSTLYCLEANFILES) 66151497Sru 67151497Sruclean: 68151497Sru -rm -f $(CLEANFILES) $(MOSTLYCLEANFILES) 69151497Sru 70151497Srudistclean: 71151497Sru -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES) 72151497Sru 73151497Srurealclean: 74151497Sru -rm -f $(REALCLEANFILES) $(DISTCLEANFILES) $(CLEANFILES) \ 75151497Sru $(MOSTLYCLEANFILES) 76151497Sru 77151497Sruextraclean: 78151497Sru -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES) \ 79151497Sru \#* *~ =* core junk grot old temp tmp tem 80151497Sru 81151497Sru.SUFFIXES: 82151497Sru.SUFFIXES: .o .cc .c .y .man .n 83151497Sru 84151497Sru.cc.o: 85151497Sru $(COMPILE.cc) $< 86151497Sru 87151497Sru.c.o: 88151497Sru $(COMPILE.c) $< 89151497Sru 90151497Sru.y.cc: 91151497Sru if test -n "$(YTABH)"; then \ 92151497Sru $(YACC) $(YACCFLAGS) -d $<; \ 93151497Sru else \ 94151497Sru $(YACC) $(YACCFLAGS) $<; \ 95151497Sru fi 96151497Sru mv y.tab.c $@ 97114402Sru# Avoid ending up with two versions of $(YTABH). 98151497Sru if test -n "$(YTABH)"; then \ 99151497Sru if test -f $(srcdir)/$(YTABH); then \ 100151497Sru rm -f $(YTABH); \ 101151497Sru mv y.tab.h $(srcdir)/$(YTABH); \ 102151497Sru else \ 103151497Sru mv y.tab.h $(YTABH); \ 104151497Sru fi; \ 105151497Sru fi 106151497Sru 107151497Sru.man.n: 108151497Sru @echo Making $@ from $< 109151497Sru @-rm -f $@ 110151497Sru @sed -e "s;@FONTDIR@;$(fontdir);g" \ 111151497Sru -e "s;@FONTPATH@;$(fontpath);g" \ 112151497Sru -e "s;@MACRODIR@;$(tmacdir);g" \ 113151497Sru -e "s;@MACROPATH@;$(tmacpath);g" \ 114151497Sru -e "s;@DEVICE@;$(DEVICE);g" \ 115151497Sru -e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \ 116151497Sru -e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \ 117151497Sru -e "s;@INDEX_SUFFIX@;$(indexext);g" \ 118151497Sru -e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \ 119151497Sru -e "s;@MAN1EXT@;$(man1ext);g" \ 120151497Sru -e "s;@MAN5EXT@;$(man5ext);g" \ 121151497Sru -e "s;@MAN7EXT@;$(man7ext);g" \ 122151497Sru -e "s;@TMAC_S_PREFIX@;$(tmac_s_prefix);g" \ 123151497Sru -e "s;@TMAC_M_PREFIX@;$(tmac_m_prefix);g" \ 124151497Sru -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \ 125151497Sru -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \ 126151497Sru -e "s;@VERSION@;`cat $(srcdir)/../VERSION`;g" \ 127151497Sru -e "s;@MDATE@;`$(SHELL) $(srcdir)/../mdate.sh $<`;g" \ 128151497Sru -e "s;@g@;$(g);g" \ 129151497Sru -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \ 130151497Sru $< >$@ 131151497Sru 132151497Sru.PHONY: install_man 133151497Sruinstall_man: 134151497Sru -test -d $(manroot) || mkdir $(manroot) 135151497Sru -test -d $(man1dir) || mkdir $(man1dir) 136151497Sru @-pages="$(MAN1)"; \ 137151497Sru for p in $$pages; do \ 138151497Sru prog=`basename $$p .n`; \ 139151497Sru target=$(man1dir)/$(NAMEPREFIX)$$prog.$(man1ext); \ 140151497Sru rm -f $$target; \ 141151497Sru echo $(INSTALL_DATA) $$p $$target; \ 142151497Sru $(INSTALL_DATA) $$p $$target; \ 143151497Sru done 144151497Sru -test -d $(man5dir) || mkdir $(man5dir) 145151497Sru @-pages="$(MAN5)"; \ 146151497Sru for p in $$pages; do \ 147151497Sru target=$(man5dir)/`basename $$p .n`.$(man5ext); \ 148151497Sru rm -f $$target; \ 149151497Sru echo $(INSTALL_DATA) $$p $$target; \ 150151497Sru $(INSTALL_DATA) $$p $$target; \ 151151497Sru done 152151497Sru -test -d $(man7dir) || mkdir $(man7dir) 153151497Sru @-pages="$(MAN7)"; \ 154151497Sru for p in $$pages; do \ 155151497Sru target=$(man7dir)/`basename $$p .n`.$(man7ext); \ 156151497Sru rm -f $$target; \ 157151497Sru echo $(INSTALL_DATA) $$p $$target; \ 158151497Sru $(INSTALL_DATA) $$p $$target; \ 159151497Sru done 160151497Sru 161151497Sru.PHONY: uninstall_man 162151497Sruuninstall_man: 163151497Sru @-pages="$(MAN1)"; \ 164151497Sru for p in $$pages; do \ 165151497Sru target=$(man1dir)/$(NAMEPREFIX)`basename $$p .n`.$(man1ext); \ 166151497Sru echo rm -f $$target; \ 167151497Sru rm -f $$target; \ 168151497Sru done 169151497Sru @-pages="$(MAN5)"; \ 170151497Sru for p in $$pages; do \ 171151497Sru target=$(man5dir)/`basename $$p .n`.$(man5ext); \ 172151497Sru echo rm -f $$target; \ 173151497Sru rm -f $$target; \ 174151497Sru done 175151497Sru @-pages="$(MAN7)"; \ 176151497Sru for p in $$pages; do \ 177151497Sru target=$(man7dir)/`basename $$p .n`.$(man7ext); \ 178151497Sru echo rm -f $$target; \ 179151497Sru rm -f $$target; \ 180151497Sru done 181151497Sru 182151497Sru.PHONY: install_prog 183151497Sruinstall_prog: 184151497Sru -test -d $(bindir) || mkdir $(bindir) 185151497Sru rm -f $(bindir)/$(NAMEPREFIX)$(PROG) 186151497Sru $(INSTALL_PROGRAM) $(PROG) $(bindir)/$(NAMEPREFIX)$(PROG) 187151497Sru 188151497Sru.PHONY: uninstall_prog 189151497Sruuninstall_prog: 190151497Sru -rm -f $(bindir)/$(NAMEPREFIX)$(PROG) 191151497Sru 192151497Sru.PHONY: install_dev 193151497Sruinstall_dev: 194151497Sru -test -d $(datadir) || mkdir $(datadir) 195151497Sru -test -d $(datasubdir) || mkdir $(datasubdir) 196151497Sru -test -d $(fontdir) || mkdir $(fontdir) 197151497Sru -test -d $(fontsubdir) || mkdir $(fontsubdir) 198151497Sru -if test -d $(srcdir)/generate; then \ 199151497Sru test -d $(fontsubdir)/generate || mkdir $(fontsubdir)/generate; \ 200151497Sru fi 201151497Sru -for f in $(DEVFILES); do \ 202151497Sru rm -f $(fontsubdir)/$$f; \ 203151497Sru if test -f $$f; then \ 20418099Spst $(INSTALL_DATA) $$f $(fontsubdir)/$$f; \ 205151497Sru else \ 20618099Spst $(INSTALL_DATA) $(srcdir)/$$f $(fontsubdir)/$$f; \ 20718099Spst fi; \ 20818099Spst done 20918099Spst 210151497Sru.PHONY: uninstall_dev 211151497Sruuninstall_dev: 212151497Sru -for f in $(DEVFILES); do rm -f $(fontsubdir)/$$f; done 213151497Sru -if test -d $(fontsubdir)/generate; then \ 214151497Sru rmdir $(fontsubdir)/generate; \ 215151497Sru fi 216151497Sru -rmdir $(fontsubdir) 217151497Sru 218151497Sru.PHONY: depend_src 219151497Srudepend_src: depend.temp 220151497Sru mv depend.temp Makefile.dep 221151497Sru 222151497Srudepend.temp: FORCE 223151497Sru > depend.temp; 224151497Sru test -z "$(CCSRCS)$(YTABC)" \ 225151497Sru || $(CCC) $(ALL_CCFLAGS) -MM $(CCSRCS) $(YTABC) >>depend.temp 226151497Sru test -z "$(CSRCS)" \ 227151497Sru || $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp 228151497Sru if test -n "$(YTABH)"; then \ 229151497Sru sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend.temp1; \ 230151497Sru mv depend.temp1 depend.temp; \ 231151497Sru fi 232151497Sru 233151497Sru.PHONY: TAGS_src 234151497SruTAGS_src: 235151497Sru $(ETAGS) $(ETAGSFLAGS) $(CCSRCS) $(CSRCS) 236151497Sru test -z "$(GRAM)$(HDRS)" \ 237151497Sru || $(ETAGS) $(ETAGSFLAGS) -a $(ETAGSCCFLAG) $(GRAM) $(HDRS) 238151497Sru 239151497SruMakefile: 240151497Sru -rm -f Makefile 241151497Sru echo srcdir=$(srcdir) >>Makefile 242151497Sru echo VPATH=$(VPATH) >>Makefile 243151497Sru cat $(MAKEFILEPARTS) /dev/null >>Makefile 244151497Sru 245151497SruFORCE: 246151497Sru 247151497Sru.NOEXPORT: 248151497Sru