summaryrefslogtreecommitdiffstats
path: root/contrib/groff/Makefile.comm
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/groff/Makefile.comm')
-rw-r--r--contrib/groff/Makefile.comm106
1 files changed, 60 insertions, 46 deletions
diff --git a/contrib/groff/Makefile.comm b/contrib/groff/Makefile.comm
index 01f6dd3..b6cb4eb 100644
--- a/contrib/groff/Makefile.comm
+++ b/contrib/groff/Makefile.comm
@@ -1,4 +1,4 @@
-# Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+# Copyright (C) 1989-2000 Free Software Foundation, Inc.
# Written by James Clark (jjc@jclark.com)
#
# This file is part of groff.
@@ -20,17 +20,17 @@
# Makefile.comm
#
SHELL=/bin/sh
-INCLUDES=-I. -I$(srcdir) -I../include -I$(srcdir)/../include
+INCLUDES=-I. -I$(srcdir) \
+ -I$(top_builddir)/src/include -I$(top_srcdir)/src/include
ALL_CCFLAGS=$(INCLUDES) $(CCDEFINES) $(CCFLAGS) $(CPPFLAGS)
COMPILE.cc=$(CCC) $(ALL_CCFLAGS) -c
-ALL_CFLAGS=$(CDEFINES) $(CFLAGS) $(CPPFLAGS)
+ALL_CFLAGS=$(INCLUDES) $(CDEFINES) $(CFLAGS) $(CPPFLAGS)
COMPILE.c=$(CC) $(ALL_CFLAGS) -c
LINK.cc=$(CCC) $(CCFLAGS) $(LDFLAGS)
LINK.c=$(CC) $(CFLAGS) $(LDFLAGS)
-TOP=..
-LIBGROFF=$(TOP)/libgroff/libgroff.a
-LIBBIB=$(TOP)/libbib/libbib.a
-LIBDRIVER=$(TOP)/libdriver/libdriver.a
+LIBGROFF=$(top_builddir)/src/libs/libgroff/libgroff.a
+LIBBIB=$(top_builddir)/src/libs/libbib/libbib.a
+LIBDRIVER=$(top_builddir)/src/libs/libdriver/libdriver.a
MLIB=
XLIBS=
YTABH=
@@ -41,7 +41,7 @@ CLEANADD=
MOSTLYCLEANFILES=$(MANCLEAN) $(PROG) $(OBJS) $(GENSRCS) $(GENHDRS) \
depend.temp core y.output $(CLEANADD)
CLEANFILES=$(LIBCLEAN)
-DISTCLEANFILES=TAGS Makefile
+DISTCLEANFILES=TAGS Makefile Makefile.dep
REALCLEANFILES=$(YTABC) $(YTABH)
NAMEPREFIX=
HDRS=
@@ -51,15 +51,22 @@ fontsubdir=$(fontdir)/dev$(DEV)
all install install_bin install_data TAGS depend distfiles uninstall_sub:
-install: install_bin install_data
+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
+.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)
@@ -92,47 +99,53 @@ extraclean:
else \
$(YACC) $(YACCFLAGS) $<; \
fi
- mv y.tab.c $@
+ -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 $@
# Avoid ending up with two versions of $(YTABH).
if test -n "$(YTABH)"; then \
if test -f $(srcdir)/$(YTABH); then \
rm -f $(YTABH); \
- mv y.tab.h $(srcdir)/$(YTABH); \
+ mv y_tab.h $(srcdir)/$(YTABH); \
else \
- mv y.tab.h $(YTABH); \
+ mv y_tab.h $(YTABH); \
fi; \
fi
+version=`cat $(top_srcdir)/VERSION`
+# No additional number for the groff archive if revision is zero
+revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' $(top_srcdir)/REVISION`
+
.man.n:
@echo Making $@ from $<
@-rm -f $@
- @sed -e "s;@FONTDIR@;$(fontdir);g" \
- -e "s;@FONTPATH@;$(fontpath);g" \
- -e "s;@MACRODIR@;$(tmacdir);g" \
- -e "s;@MACROPATH@;$(tmacpath);g" \
- -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@;`cat $(srcdir)/../VERSION`;g" \
- -e "s;@MDATE@;`$(SHELL) $(srcdir)/../mdate.sh $<`;g" \
- -e "s;@g@;$(g);g" \
- -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \
+ @sed -e "s|@FONTDIR@|$(fontdir)|g" \
+ -e "s|@FONTPATH@|$(fontpath)|g" \
+ -e "s|@MACRODIR@|$(tmacdir)|g" \
+ -e "s|@MACROPATH@|$(tmacpath)|g" \
+ -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) || mkdir $(manroot)
- -test -d $(man1dir) || mkdir $(man1dir)
+ -test -d $(manroot) || $(mkinstalldirs) $(manroot)
+ -test -d $(man1dir) || $(mkinstalldirs) $(man1dir)
@-pages="$(MAN1)"; \
for p in $$pages; do \
prog=`basename $$p .n`; \
@@ -141,7 +154,7 @@ install_man:
echo $(INSTALL_DATA) $$p $$target; \
$(INSTALL_DATA) $$p $$target; \
done
- -test -d $(man5dir) || mkdir $(man5dir)
+ -test -d $(man5dir) || $(mkinstalldirs) $(man5dir)
@-pages="$(MAN5)"; \
for p in $$pages; do \
target=$(man5dir)/`basename $$p .n`.$(man5ext); \
@@ -149,7 +162,7 @@ install_man:
echo $(INSTALL_DATA) $$p $$target; \
$(INSTALL_DATA) $$p $$target; \
done
- -test -d $(man7dir) || mkdir $(man7dir)
+ -test -d $(man7dir) || $(mkinstalldirs) $(man7dir)
@-pages="$(MAN7)"; \
for p in $$pages; do \
target=$(man7dir)/`basename $$p .n`.$(man7ext); \
@@ -181,7 +194,7 @@ uninstall_man:
.PHONY: install_prog
install_prog:
- -test -d $(bindir) || mkdir $(bindir)
+ -test -d $(bindir) || $(mkinstalldirs) $(bindir)
rm -f $(bindir)/$(NAMEPREFIX)$(PROG)
$(INSTALL_PROGRAM) $(PROG) $(bindir)/$(NAMEPREFIX)$(PROG)
@@ -191,12 +204,13 @@ uninstall_prog:
.PHONY: install_dev
install_dev:
- -test -d $(datadir) || mkdir $(datadir)
- -test -d $(datasubdir) || mkdir $(datasubdir)
- -test -d $(fontdir) || mkdir $(fontdir)
- -test -d $(fontsubdir) || mkdir $(fontsubdir)
+ -test -d $(datadir) || $(mkinstalldirs) $(datadir)
+ -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 || mkdir $(fontsubdir)/generate; \
+ test -d $(fontsubdir)/generate || \
+ $(mkinstalldirs) $(fontsubdir)/generate; \
fi
-for f in $(DEVFILES); do \
rm -f $(fontsubdir)/$$f; \
@@ -226,8 +240,8 @@ depend.temp: FORCE
test -z "$(CSRCS)" \
|| $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp
if test -n "$(YTABH)"; then \
- sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend.temp1; \
- mv depend.temp1 depend.temp; \
+ sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend1.temp; \
+ mv depend1.temp depend.temp; \
fi
.PHONY: TAGS_src
OpenPOWER on IntegriCloud