2003-06-30 21:51:41 +04:00
|
|
|
# Copyright (C) 1989-2000, 2002 Free Software Foundation, Inc.
|
2001-04-19 16:47:42 +04:00
|
|
|
# Written by James Clark (jjc@jclark.com)
|
|
|
|
#
|
|
|
|
# This file is part of groff.
|
|
|
|
#
|
|
|
|
# groff is free software; you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU General Public License as published by the Free
|
|
|
|
# Software Foundation; either version 2, or (at your option) any later
|
|
|
|
# version.
|
|
|
|
#
|
|
|
|
# groff is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with groff; see the file COPYING. If not, write to the Free Software
|
|
|
|
# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
|
|
|
# Makefile.comm
|
|
|
|
#
|
|
|
|
SHELL=/bin/sh
|
|
|
|
INCLUDES=-I. -I$(srcdir) \
|
|
|
|
-I$(top_builddir)/src/include -I$(top_srcdir)/src/include
|
|
|
|
ALL_CCFLAGS=$(INCLUDES) $(CCDEFINES) $(CCFLAGS) $(CPPFLAGS)
|
2003-06-30 21:51:41 +04:00
|
|
|
COMPILE.cpp=$(CCC) $(ALL_CCFLAGS) -c
|
2001-04-19 16:47:42 +04:00
|
|
|
ALL_CFLAGS=$(INCLUDES) $(CDEFINES) $(CFLAGS) $(CPPFLAGS)
|
2003-06-30 21:51:41 +04:00
|
|
|
COMPILE.c=$(CC) $(ALL_CFLAGS) -c
|
|
|
|
LINK.cpp=$(CCC) $(CCFLAGS) $(LDFLAGS)
|
2001-04-19 16:47:42 +04:00
|
|
|
LINK.c=$(CC) $(CFLAGS) $(LDFLAGS)
|
2003-06-30 21:51:41 +04:00
|
|
|
LIBGROFF=$(top_builddir)/src/libs/libgroff/libgroff.$(LIBEXT)
|
|
|
|
LIBBIB=$(top_builddir)/src/libs/libbib/libbib.$(LIBEXT)
|
|
|
|
LIBDRIVER=$(top_builddir)/src/libs/libdriver/libdriver.$(LIBEXT)
|
2001-04-19 16:47:42 +04:00
|
|
|
MLIB=
|
|
|
|
XLIBS=
|
|
|
|
YTABH=
|
|
|
|
YTABC=
|
|
|
|
GRAM=
|
|
|
|
LIBCLEAN=
|
|
|
|
CLEANADD=
|
2003-06-30 21:51:41 +04:00
|
|
|
CLEANDIRADD=
|
|
|
|
CLEANNOTSRCDIRADD=
|
2001-04-19 16:47:42 +04:00
|
|
|
MOSTLYCLEANFILES=$(MANCLEAN) $(PROG) $(OBJS) $(GENSRCS) $(GENHDRS) \
|
|
|
|
depend.temp core y.output $(CLEANADD)
|
|
|
|
CLEANFILES=$(LIBCLEAN)
|
|
|
|
DISTCLEANFILES=TAGS Makefile Makefile.dep
|
|
|
|
REALCLEANFILES=$(YTABC) $(YTABH)
|
|
|
|
NAMEPREFIX=
|
|
|
|
HDRS=
|
|
|
|
MANPAGES=$(MAN1) $(MAN5) $(MAN7)
|
|
|
|
MANCLEAN=$(MANPAGES)
|
|
|
|
fontsubdir=$(fontdir)/dev$(DEV)
|
|
|
|
|
|
|
|
all install install_bin install_data TAGS depend distfiles uninstall_sub:
|
|
|
|
|
|
|
|
install: prefix_must_exist install_bin install_data
|
|
|
|
uninstall: uninstall_sub
|
|
|
|
pure:
|
|
|
|
|
|
|
|
.PHONY: all clean distclean mostlyclean realclean extraclean depend distfiles
|
|
|
|
.PHONY: install install_bin install_data prefix_must_exist
|
|
|
|
.PHONY: uninstall uninstall_sub
|
|
|
|
.PHONY: pure
|
|
|
|
|
|
|
|
prefix_must_exist:
|
|
|
|
@test -d $(prefix) \
|
|
|
|
|| (echo ; \
|
|
|
|
echo The prefix directory \`$(prefix)\' doesn\'t exist; \
|
|
|
|
echo ; \
|
|
|
|
exit 1)
|
|
|
|
|
|
|
|
mostlyclean:
|
|
|
|
-rm -f $(MOSTLYCLEANFILES)
|
2003-06-30 21:51:41 +04:00
|
|
|
-rm -rf $(CLEANDIRADD)
|
|
|
|
-@if test `cd $(srcdir); pwd` = `pwd`; then \
|
|
|
|
:; \
|
|
|
|
else \
|
|
|
|
rm -f $(CLEANNOTSRCDIRADD); \
|
|
|
|
fi
|
2001-04-19 16:47:42 +04:00
|
|
|
|
2003-06-30 21:51:41 +04:00
|
|
|
clean: mostlyclean
|
|
|
|
-rm -f $(CLEANFILES)
|
2001-04-19 16:47:42 +04:00
|
|
|
|
2003-06-30 21:51:41 +04:00
|
|
|
distclean: clean
|
|
|
|
-rm -f $(DISTCLEANFILES)
|
|
|
|
-@if test `cd $(srcdir); pwd` = `pwd`; then \
|
|
|
|
:; \
|
|
|
|
else \
|
|
|
|
rm -f $(YTABC) $(YTABH); \
|
|
|
|
fi
|
2001-04-19 16:47:42 +04:00
|
|
|
|
2003-06-30 21:51:41 +04:00
|
|
|
realclean: distclean
|
|
|
|
-rm -f $(REALCLEANFILES)
|
2001-04-19 16:47:42 +04:00
|
|
|
|
2003-06-30 21:51:41 +04:00
|
|
|
extraclean: distclean
|
|
|
|
-rm -f \#* *~ =* core junk grot old temp tmp tem
|
2001-04-19 16:47:42 +04:00
|
|
|
|
|
|
|
.SUFFIXES:
|
2003-06-30 21:51:41 +04:00
|
|
|
.SUFFIXES: .o .obj .cpp .c .y .man .n
|
2001-04-19 16:47:42 +04:00
|
|
|
|
2003-06-30 21:51:41 +04:00
|
|
|
.cpp.o:
|
|
|
|
$(COMPILE.cpp) $<
|
2001-04-19 16:47:42 +04:00
|
|
|
|
|
|
|
.c.o:
|
|
|
|
$(COMPILE.c) $<
|
|
|
|
|
2003-06-30 21:51:41 +04:00
|
|
|
.cpp.obj:
|
|
|
|
$(COMPILE.cpp) $<
|
|
|
|
|
|
|
|
.c.obj:
|
|
|
|
$(COMPILE.c) $<
|
|
|
|
|
|
|
|
.y.cpp:
|
2001-04-19 16:47:42 +04:00
|
|
|
if test -n "$(YTABH)"; then \
|
|
|
|
$(YACC) $(YACCFLAGS) -d $<; \
|
|
|
|
else \
|
|
|
|
$(YACC) $(YACCFLAGS) $<; \
|
|
|
|
fi
|
|
|
|
-test -f y.tab.h && mv y.tab.h y_tab.h
|
|
|
|
-test -f y.tab.c && mv y.tab.c y_tab.c
|
2003-06-30 21:51:41 +04:00
|
|
|
mv y_tab.c $(YTABC)
|
|
|
|
if test -n "$(YTABH)"; then mv y_tab.h $(YTABH); fi
|
|
|
|
|
|
|
|
# The next rule is needed for make of Solaris 2.5.1 to override its
|
|
|
|
# built-in .y.o rule (which takes precedence over the .y.cpp rule above).
|
|
|
|
.y.o:
|
2001-04-19 16:47:42 +04:00
|
|
|
if test -n "$(YTABH)"; then \
|
2003-06-30 21:51:41 +04:00
|
|
|
$(YACC) $(YACCFLAGS) -d $<; \
|
|
|
|
else \
|
|
|
|
$(YACC) $(YACCFLAGS) $<; \
|
2001-04-19 16:47:42 +04:00
|
|
|
fi
|
2003-06-30 21:51:41 +04:00
|
|
|
-test -f y.tab.h && mv y.tab.h y_tab.h
|
|
|
|
-test -f y.tab.c && mv y.tab.c y_tab.c
|
|
|
|
mv y_tab.c $(YTABC)
|
|
|
|
if test -n "$(YTABH)"; then mv y_tab.h $(YTABH); fi
|
|
|
|
$(COMPILE.cpp) $(YTABC)
|
2001-04-19 16:47:42 +04:00
|
|
|
|
|
|
|
.man.n:
|
|
|
|
@echo Making $@ from $<
|
|
|
|
@-rm -f $@
|
2003-06-30 21:51:41 +04:00
|
|
|
@sed -e "s|@BINDIR@|$(bindir)|g" \
|
|
|
|
-e "s|@FONTDIR@|$(fontdir)|g" \
|
|
|
|
-e "s|@LOCALFONTDIR@|$(localfontdir)|g" \
|
|
|
|
-e "s|@LEGACYFONTDIR@|$(legacyfontdir)|g" \
|
2001-04-19 16:47:42 +04:00
|
|
|
-e "s|@MACRODIR@|$(tmacdir)|g" \
|
2003-06-30 21:51:41 +04:00
|
|
|
-e "s|@SYSTEMMACRODIR@|$(systemtmacdir)|g" \
|
|
|
|
-e "s|@LOCALMACRODIR@|$(localtmacdir)|g" \
|
|
|
|
-e "s|@DOCDIR@|$(docdir)|g" \
|
|
|
|
-e "s|@EXAMPLEDIR@|$(exampledir)|g" \
|
|
|
|
-e "s|@HTMLDOCDIR@|$(htmldocdir)|g" \
|
2001-04-19 16:47:42 +04:00
|
|
|
-e "s|@DEVICE@|$(DEVICE)|g" \
|
|
|
|
-e "s|@DEFAULT_INDEX@|$(indexdir)/$(indexname)|g" \
|
|
|
|
-e "s|@DEFAULT_INDEX_NAME@|$(indexname)|g" \
|
|
|
|
-e "s|@INDEX_SUFFIX@|$(indexext)|g" \
|
|
|
|
-e "s|@COMMON_WORDS_FILE@|$(common_words_file)|g" \
|
|
|
|
-e "s|@MAN1EXT@|$(man1ext)|g" \
|
|
|
|
-e "s|@MAN5EXT@|$(man5ext)|g" \
|
|
|
|
-e "s|@MAN7EXT@|$(man7ext)|g" \
|
|
|
|
-e "s|@TMAC_S_PREFIX@|$(tmac_s_prefix)|g" \
|
|
|
|
-e "s|@TMAC_M_PREFIX@|$(tmac_m_prefix)|g" \
|
|
|
|
-e "s|@TMAC_AN_PREFIX@|$(tmac_an_prefix)|g" \
|
|
|
|
-e "s|@TMAC_MDIR@|$(tmacdir)/mm|g" \
|
|
|
|
-e "s|@BROKEN_SPOOLER_FLAGS@|$(BROKEN_SPOOLER_FLAGS)|g" \
|
|
|
|
-e "s|@VERSION@|$(version)$(revision)|g" \
|
|
|
|
-e "s|@MDATE@|`$(SHELL) $(top_srcdir)/mdate.sh $<`|g" \
|
|
|
|
-e "s|@g@|$(g)|g" \
|
|
|
|
-e "s!@G@!`echo $(g) | tr [a-z] [A-Z]`!g" \
|
|
|
|
$< >$@
|
|
|
|
|
|
|
|
.PHONY: install_man
|
|
|
|
install_man:
|
|
|
|
-test -d $(manroot) || $(mkinstalldirs) $(manroot)
|
|
|
|
-test -d $(man1dir) || $(mkinstalldirs) $(man1dir)
|
|
|
|
@-pages="$(MAN1)"; \
|
|
|
|
for p in $$pages; do \
|
|
|
|
prog=`basename $$p .n`; \
|
|
|
|
target=$(man1dir)/$(NAMEPREFIX)$$prog.$(man1ext); \
|
|
|
|
rm -f $$target; \
|
|
|
|
echo $(INSTALL_DATA) $$p $$target; \
|
|
|
|
$(INSTALL_DATA) $$p $$target; \
|
|
|
|
done
|
|
|
|
-test -d $(man5dir) || $(mkinstalldirs) $(man5dir)
|
|
|
|
@-pages="$(MAN5)"; \
|
|
|
|
for p in $$pages; do \
|
|
|
|
target=$(man5dir)/`basename $$p .n`.$(man5ext); \
|
|
|
|
rm -f $$target; \
|
|
|
|
echo $(INSTALL_DATA) $$p $$target; \
|
|
|
|
$(INSTALL_DATA) $$p $$target; \
|
|
|
|
done
|
|
|
|
-test -d $(man7dir) || $(mkinstalldirs) $(man7dir)
|
|
|
|
@-pages="$(MAN7)"; \
|
|
|
|
for p in $$pages; do \
|
|
|
|
target=$(man7dir)/`basename $$p .n`.$(man7ext); \
|
|
|
|
rm -f $$target; \
|
|
|
|
echo $(INSTALL_DATA) $$p $$target; \
|
|
|
|
$(INSTALL_DATA) $$p $$target; \
|
|
|
|
done
|
|
|
|
|
|
|
|
.PHONY: uninstall_man
|
|
|
|
uninstall_man:
|
|
|
|
@-pages="$(MAN1)"; \
|
|
|
|
for p in $$pages; do \
|
|
|
|
target=$(man1dir)/$(NAMEPREFIX)`basename $$p .n`.$(man1ext); \
|
|
|
|
echo rm -f $$target; \
|
|
|
|
rm -f $$target; \
|
|
|
|
done
|
|
|
|
@-pages="$(MAN5)"; \
|
|
|
|
for p in $$pages; do \
|
|
|
|
target=$(man5dir)/`basename $$p .n`.$(man5ext); \
|
|
|
|
echo rm -f $$target; \
|
|
|
|
rm -f $$target; \
|
|
|
|
done
|
|
|
|
@-pages="$(MAN7)"; \
|
|
|
|
for p in $$pages; do \
|
|
|
|
target=$(man7dir)/`basename $$p .n`.$(man7ext); \
|
|
|
|
echo rm -f $$target; \
|
|
|
|
rm -f $$target; \
|
|
|
|
done
|
|
|
|
|
|
|
|
.PHONY: install_prog
|
|
|
|
install_prog:
|
|
|
|
-test -d $(bindir) || $(mkinstalldirs) $(bindir)
|
|
|
|
rm -f $(bindir)/$(NAMEPREFIX)$(PROG)
|
|
|
|
$(INSTALL_PROGRAM) $(PROG) $(bindir)/$(NAMEPREFIX)$(PROG)
|
|
|
|
|
|
|
|
.PHONY: uninstall_prog
|
|
|
|
uninstall_prog:
|
|
|
|
-rm -f $(bindir)/$(NAMEPREFIX)$(PROG)
|
|
|
|
|
|
|
|
.PHONY: install_dev
|
|
|
|
install_dev:
|
|
|
|
-test -d $(datadir) || $(mkinstalldirs) $(datadir)
|
2003-06-30 21:51:41 +04:00
|
|
|
-test -d $(dataprogramdir) || $(mkinstalldirs) $(dataprogramdir)
|
2001-04-19 16:47:42 +04:00
|
|
|
-test -d $(datasubdir) || $(mkinstalldirs) $(datasubdir)
|
|
|
|
-test -d $(fontdir) || $(mkinstalldirs) $(fontdir)
|
|
|
|
-test -d $(fontsubdir) || $(mkinstalldirs) $(fontsubdir)
|
|
|
|
-if test -d $(srcdir)/generate; then \
|
|
|
|
test -d $(fontsubdir)/generate || \
|
|
|
|
$(mkinstalldirs) $(fontsubdir)/generate; \
|
|
|
|
fi
|
|
|
|
-for f in $(DEVFILES); do \
|
|
|
|
rm -f $(fontsubdir)/$$f; \
|
|
|
|
if test -f $$f; then \
|
|
|
|
$(INSTALL_DATA) $$f $(fontsubdir)/$$f; \
|
|
|
|
else \
|
|
|
|
$(INSTALL_DATA) $(srcdir)/$$f $(fontsubdir)/$$f; \
|
|
|
|
fi; \
|
|
|
|
done
|
2003-06-30 21:51:41 +04:00
|
|
|
-for f in $(DEVSCRIPTS); do \
|
|
|
|
rm -f $(fontsubdir)/$$f; \
|
|
|
|
if test -f $$f; then \
|
|
|
|
$(INSTALL_SCRIPT) $$f $(fontsubdir)/$$f; \
|
|
|
|
else \
|
|
|
|
$(INSTALL_SCRIPT) $(srcdir)/$$f $(fontsubdir)/$$f; \
|
|
|
|
fi; \
|
|
|
|
done
|
2001-04-19 16:47:42 +04:00
|
|
|
|
|
|
|
.PHONY: uninstall_dev
|
|
|
|
uninstall_dev:
|
2003-06-30 21:51:41 +04:00
|
|
|
-for f in $(DEVFILES) $(DEVSCRIPTS); do rm -f $(fontsubdir)/$$f; done
|
2001-04-19 16:47:42 +04:00
|
|
|
-if test -d $(fontsubdir)/generate; then \
|
|
|
|
rmdir $(fontsubdir)/generate; \
|
|
|
|
fi
|
|
|
|
-rmdir $(fontsubdir)
|
|
|
|
|
|
|
|
.PHONY: depend_src
|
|
|
|
depend_src: depend.temp
|
|
|
|
mv depend.temp Makefile.dep
|
|
|
|
|
|
|
|
depend.temp: FORCE
|
|
|
|
> depend.temp;
|
2003-06-30 21:51:41 +04:00
|
|
|
if test -f "$(srcdir)/$(YTABC)"; then \
|
|
|
|
ytabc="$(srcdir)/$(YTABC)"; \
|
|
|
|
else \
|
|
|
|
ytabc="$(YTABC)"; \
|
|
|
|
fi; \
|
|
|
|
test -z "$(CCSRCS)$(YTABC)" \
|
|
|
|
|| $(CCC) $(ALL_CCFLAGS) -MM $(CCSRCS) $$ytabc >>depend.temp
|
2001-04-19 16:47:42 +04:00
|
|
|
test -z "$(CSRCS)" \
|
|
|
|
|| $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp
|
|
|
|
if test -n "$(YTABH)"; then \
|
|
|
|
sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend1.temp; \
|
|
|
|
mv depend1.temp depend.temp; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
.PHONY: TAGS_src
|
|
|
|
TAGS_src:
|
|
|
|
$(ETAGS) $(ETAGSFLAGS) $(CCSRCS) $(CSRCS)
|
|
|
|
test -z "$(GRAM)$(HDRS)" \
|
|
|
|
|| $(ETAGS) $(ETAGSFLAGS) -a $(ETAGSCCFLAG) $(GRAM) $(HDRS)
|
|
|
|
|
2003-06-30 21:51:41 +04:00
|
|
|
# This rule is only considered for the subdir_Makefile target.
|
2001-04-19 16:47:42 +04:00
|
|
|
Makefile:
|
|
|
|
-rm -f Makefile
|
|
|
|
echo srcdir=$(srcdir) >>Makefile
|
|
|
|
echo VPATH=$(VPATH) >>Makefile
|
|
|
|
cat $(MAKEFILEPARTS) /dev/null >>Makefile
|
|
|
|
|
|
|
|
FORCE:
|
|
|
|
|
|
|
|
.NOEXPORT:
|