Makefile.comm revision 69626
169626Sru# Copyright (C) 1989-2000 Free Software Foundation, Inc. 218099Spst# Written by James Clark (jjc@jclark.com) 318099Spst# 418099Spst# This file is part of groff. 518099Spst# 618099Spst# groff is free software; you can redistribute it and/or modify it under 718099Spst# the terms of the GNU General Public License as published by the Free 818099Spst# Software Foundation; either version 2, or (at your option) any later 918099Spst# version. 1018099Spst# 1118099Spst# groff is distributed in the hope that it will be useful, but WITHOUT ANY 1218099Spst# WARRANTY; without even the implied warranty of MERCHANTABILITY or 1318099Spst# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1418099Spst# for more details. 1518099Spst# 1618099Spst# You should have received a copy of the GNU General Public License along 1718099Spst# with groff; see the file COPYING. If not, write to the Free Software 1818099Spst# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1918099Spst# 2018099Spst# Makefile.comm 2118099Spst# 2218099SpstSHELL=/bin/sh 2369626SruINCLUDES=-I. -I$(srcdir) \ 2469626Sru -I$(top_builddir)/src/include -I$(top_srcdir)/src/include 2518099SpstALL_CCFLAGS=$(INCLUDES) $(CCDEFINES) $(CCFLAGS) $(CPPFLAGS) 2618099SpstCOMPILE.cc=$(CCC) $(ALL_CCFLAGS) -c 2769626SruALL_CFLAGS=$(INCLUDES) $(CDEFINES) $(CFLAGS) $(CPPFLAGS) 2818099SpstCOMPILE.c=$(CC) $(ALL_CFLAGS) -c 2918099SpstLINK.cc=$(CCC) $(CCFLAGS) $(LDFLAGS) 3018099SpstLINK.c=$(CC) $(CFLAGS) $(LDFLAGS) 3169626SruLIBGROFF=$(top_builddir)/src/libs/libgroff/libgroff.a 3269626SruLIBBIB=$(top_builddir)/src/libs/libbib/libbib.a 3369626SruLIBDRIVER=$(top_builddir)/src/libs/libdriver/libdriver.a 3418099SpstMLIB= 3518099SpstXLIBS= 3618099SpstYTABH= 3718099SpstYTABC= 3818099SpstGRAM= 3918099SpstLIBCLEAN= 4018099SpstCLEANADD= 4118099SpstMOSTLYCLEANFILES=$(MANCLEAN) $(PROG) $(OBJS) $(GENSRCS) $(GENHDRS) \ 4218099Spst depend.temp core y.output $(CLEANADD) 4318099SpstCLEANFILES=$(LIBCLEAN) 4469626SruDISTCLEANFILES=TAGS Makefile Makefile.dep 4518099SpstREALCLEANFILES=$(YTABC) $(YTABH) 4618099SpstNAMEPREFIX= 4718099SpstHDRS= 4818099SpstMANPAGES=$(MAN1) $(MAN5) $(MAN7) 4918099SpstMANCLEAN=$(MANPAGES) 5018099Spstfontsubdir=$(fontdir)/dev$(DEV) 5118099Spst 5218099Spstall install install_bin install_data TAGS depend distfiles uninstall_sub: 5318099Spst 5469626Sruinstall: prefix_must_exist install_bin install_data 5518099Spstuninstall: uninstall_sub 5618099Spstpure: 5718099Spst 5818099Spst.PHONY: all clean distclean mostlyclean realclean extraclean depend distfiles 5969626Sru.PHONY: install install_bin install_data prefix_must_exist 6018099Spst.PHONY: uninstall uninstall_sub 6118099Spst.PHONY: pure 6218099Spst 6369626Sruprefix_must_exist: 6469626Sru @test -d $(prefix) \ 6569626Sru || (echo ; \ 6669626Sru echo The prefix directory \`$(prefix)\' doesn\'t exist; \ 6769626Sru echo ; \ 6869626Sru exit 1) 6969626Sru 7018099Spstmostlyclean: 7118099Spst -rm -f $(MOSTLYCLEANFILES) 7218099Spst 7318099Spstclean: 7418099Spst -rm -f $(CLEANFILES) $(MOSTLYCLEANFILES) 7518099Spst 7618099Spstdistclean: 7718099Spst -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES) 7818099Spst 7918099Spstrealclean: 8018099Spst -rm -f $(REALCLEANFILES) $(DISTCLEANFILES) $(CLEANFILES) \ 8118099Spst $(MOSTLYCLEANFILES) 8218099Spst 8318099Spstextraclean: 8418099Spst -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES) \ 8518099Spst \#* *~ =* core junk grot old temp tmp tem 8618099Spst 8718099Spst.SUFFIXES: 8818099Spst.SUFFIXES: .o .cc .c .y .man .n 8918099Spst 9018099Spst.cc.o: 9118099Spst $(COMPILE.cc) $< 9218099Spst 9318099Spst.c.o: 9418099Spst $(COMPILE.c) $< 9518099Spst 9618099Spst.y.cc: 9718099Spst if test -n "$(YTABH)"; then \ 9818099Spst $(YACC) $(YACCFLAGS) -d $<; \ 9918099Spst else \ 10018099Spst $(YACC) $(YACCFLAGS) $<; \ 10118099Spst fi 10269626Sru -test -f y.tab.h && mv y.tab.h y_tab.h 10369626Sru -test -f y.tab.c && mv y.tab.c y_tab.c 10469626Sru mv y_tab.c $@ 10518099Spst# Avoid ending up with two versions of $(YTABH). 10618099Spst if test -n "$(YTABH)"; then \ 10718099Spst if test -f $(srcdir)/$(YTABH); then \ 10818099Spst rm -f $(YTABH); \ 10969626Sru mv y_tab.h $(srcdir)/$(YTABH); \ 11018099Spst else \ 11169626Sru mv y_tab.h $(YTABH); \ 11218099Spst fi; \ 11318099Spst fi 11418099Spst 11569626Sruversion=`cat $(top_srcdir)/VERSION` 11669626Sru# No additional number for the groff archive if revision is zero 11769626Srurevision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION` 11869626Sru 11918099Spst.man.n: 12018099Spst @echo Making $@ from $< 12118099Spst @-rm -f $@ 12269626Sru @sed -e "s|@FONTDIR@|$(fontdir)|g" \ 12369626Sru -e "s|@FONTPATH@|$(fontpath)|g" \ 12469626Sru -e "s|@MACRODIR@|$(tmacdir)|g" \ 12569626Sru -e "s|@MACROPATH@|$(tmacpath)|g" \ 12669626Sru -e "s|@DEVICE@|$(DEVICE)|g" \ 12769626Sru -e "s|@DEFAULT_INDEX@|$(indexdir)/$(indexname)|g" \ 12869626Sru -e "s|@DEFAULT_INDEX_NAME@|$(indexname)|g" \ 12969626Sru -e "s|@INDEX_SUFFIX@|$(indexext)|g" \ 13069626Sru -e "s|@COMMON_WORDS_FILE@|$(common_words_file)|g" \ 13169626Sru -e "s|@MAN1EXT@|$(man1ext)|g" \ 13269626Sru -e "s|@MAN5EXT@|$(man5ext)|g" \ 13369626Sru -e "s|@MAN7EXT@|$(man7ext)|g" \ 13469626Sru -e "s|@TMAC_S_PREFIX@|$(tmac_s_prefix)|g" \ 13569626Sru -e "s|@TMAC_M_PREFIX@|$(tmac_m_prefix)|g" \ 13669626Sru -e "s|@TMAC_AN_PREFIX@|$(tmac_an_prefix)|g" \ 13769626Sru -e "s|@TMAC_MDIR@|$(tmacdir)/mm|g" \ 13869626Sru -e "s|@BROKEN_SPOOLER_FLAGS@|$(BROKEN_SPOOLER_FLAGS)|g" \ 13969626Sru -e "s|@VERSION@|$(version)$(revision)|g" \ 14069626Sru -e "s|@MDATE@|`$(SHELL) $(top_srcdir)/mdate.sh $<`|g" \ 14169626Sru -e "s|@g@|$(g)|g" \ 14269626Sru -e "s!@G@!`echo $(g) | tr [a-z] [A-Z]`!g" \ 14318099Spst $< >$@ 14418099Spst 14518099Spst.PHONY: install_man 14618099Spstinstall_man: 14769626Sru -test -d $(manroot) || $(mkinstalldirs) $(manroot) 14869626Sru -test -d $(man1dir) || $(mkinstalldirs) $(man1dir) 14918099Spst @-pages="$(MAN1)"; \ 15018099Spst for p in $$pages; do \ 15118099Spst prog=`basename $$p .n`; \ 15218099Spst target=$(man1dir)/$(NAMEPREFIX)$$prog.$(man1ext); \ 15318099Spst rm -f $$target; \ 15418099Spst echo $(INSTALL_DATA) $$p $$target; \ 15518099Spst $(INSTALL_DATA) $$p $$target; \ 15618099Spst done 15769626Sru -test -d $(man5dir) || $(mkinstalldirs) $(man5dir) 15818099Spst @-pages="$(MAN5)"; \ 15918099Spst for p in $$pages; do \ 16018099Spst target=$(man5dir)/`basename $$p .n`.$(man5ext); \ 16118099Spst rm -f $$target; \ 16218099Spst echo $(INSTALL_DATA) $$p $$target; \ 16318099Spst $(INSTALL_DATA) $$p $$target; \ 16418099Spst done 16569626Sru -test -d $(man7dir) || $(mkinstalldirs) $(man7dir) 16618099Spst @-pages="$(MAN7)"; \ 16718099Spst for p in $$pages; do \ 16818099Spst target=$(man7dir)/`basename $$p .n`.$(man7ext); \ 16918099Spst rm -f $$target; \ 17018099Spst echo $(INSTALL_DATA) $$p $$target; \ 17118099Spst $(INSTALL_DATA) $$p $$target; \ 17218099Spst done 17318099Spst 17418099Spst.PHONY: uninstall_man 17518099Spstuninstall_man: 17618099Spst @-pages="$(MAN1)"; \ 17718099Spst for p in $$pages; do \ 17818099Spst target=$(man1dir)/$(NAMEPREFIX)`basename $$p .n`.$(man1ext); \ 17918099Spst echo rm -f $$target; \ 18018099Spst rm -f $$target; \ 18118099Spst done 18218099Spst @-pages="$(MAN5)"; \ 18318099Spst for p in $$pages; do \ 18418099Spst target=$(man5dir)/`basename $$p .n`.$(man5ext); \ 18518099Spst echo rm -f $$target; \ 18618099Spst rm -f $$target; \ 18718099Spst done 18818099Spst @-pages="$(MAN7)"; \ 18918099Spst for p in $$pages; do \ 19018099Spst target=$(man7dir)/`basename $$p .n`.$(man7ext); \ 19118099Spst echo rm -f $$target; \ 19218099Spst rm -f $$target; \ 19318099Spst done 19418099Spst 19518099Spst.PHONY: install_prog 19618099Spstinstall_prog: 19769626Sru -test -d $(bindir) || $(mkinstalldirs) $(bindir) 19818099Spst rm -f $(bindir)/$(NAMEPREFIX)$(PROG) 19918099Spst $(INSTALL_PROGRAM) $(PROG) $(bindir)/$(NAMEPREFIX)$(PROG) 20018099Spst 20118099Spst.PHONY: uninstall_prog 20218099Spstuninstall_prog: 20318099Spst -rm -f $(bindir)/$(NAMEPREFIX)$(PROG) 20418099Spst 20518099Spst.PHONY: install_dev 20618099Spstinstall_dev: 20769626Sru -test -d $(datadir) || $(mkinstalldirs) $(datadir) 20869626Sru -test -d $(datasubdir) || $(mkinstalldirs) $(datasubdir) 20969626Sru -test -d $(fontdir) || $(mkinstalldirs) $(fontdir) 21069626Sru -test -d $(fontsubdir) || $(mkinstalldirs) $(fontsubdir) 21118099Spst -if test -d $(srcdir)/generate; then \ 21269626Sru test -d $(fontsubdir)/generate || \ 21369626Sru $(mkinstalldirs) $(fontsubdir)/generate; \ 21418099Spst fi 21518099Spst -for f in $(DEVFILES); do \ 21618099Spst rm -f $(fontsubdir)/$$f; \ 21718099Spst if test -f $$f; then \ 21818099Spst $(INSTALL_DATA) $$f $(fontsubdir)/$$f; \ 21918099Spst else \ 22018099Spst $(INSTALL_DATA) $(srcdir)/$$f $(fontsubdir)/$$f; \ 22118099Spst fi; \ 22218099Spst done 22318099Spst 22418099Spst.PHONY: uninstall_dev 22518099Spstuninstall_dev: 22618099Spst -for f in $(DEVFILES); do rm -f $(fontsubdir)/$$f; done 22718099Spst -if test -d $(fontsubdir)/generate; then \ 22818099Spst rmdir $(fontsubdir)/generate; \ 22918099Spst fi 23018099Spst -rmdir $(fontsubdir) 23118099Spst 23218099Spst.PHONY: depend_src 23318099Spstdepend_src: depend.temp 23418099Spst mv depend.temp Makefile.dep 23518099Spst 23618099Spstdepend.temp: FORCE 23718099Spst > depend.temp; 23818099Spst test -z "$(CCSRCS)$(YTABC)" \ 23918099Spst || $(CCC) $(ALL_CCFLAGS) -MM $(CCSRCS) $(YTABC) >>depend.temp 24018099Spst test -z "$(CSRCS)" \ 24118099Spst || $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp 24218099Spst if test -n "$(YTABH)"; then \ 24369626Sru sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend1.temp; \ 24469626Sru mv depend1.temp depend.temp; \ 24518099Spst fi 24618099Spst 24718099Spst.PHONY: TAGS_src 24818099SpstTAGS_src: 24918099Spst $(ETAGS) $(ETAGSFLAGS) $(CCSRCS) $(CSRCS) 25018099Spst test -z "$(GRAM)$(HDRS)" \ 25118099Spst || $(ETAGS) $(ETAGSFLAGS) -a $(ETAGSCCFLAG) $(GRAM) $(HDRS) 25218099Spst 25318099SpstMakefile: 25418099Spst -rm -f Makefile 25518099Spst echo srcdir=$(srcdir) >>Makefile 25618099Spst echo VPATH=$(VPATH) >>Makefile 25718099Spst cat $(MAKEFILEPARTS) /dev/null >>Makefile 25818099Spst 25918099SpstFORCE: 26018099Spst 26118099Spst.NOEXPORT: 262