1 # Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
2 # Written by James Clark (jjc@jclark.com)
4 # This file is part of groff.
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
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
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, 675 Mass Ave, Cambridge, MA 02139, USA.
23 INCLUDES=-I. -I$(srcdir) -I../include -I$(srcdir)/../include
24 ALL_CCFLAGS=$(INCLUDES) $(CCDEFINES) $(CCFLAGS) $(CPPFLAGS)
25 COMPILE.cc=$(CCC) $(ALL_CCFLAGS) -c
26 ALL_CFLAGS=$(CDEFINES) $(CFLAGS) $(CPPFLAGS)
27 COMPILE.c=$(CC) $(ALL_CFLAGS) -c
28 LINK.cc=$(CCC) $(CCFLAGS) $(LDFLAGS)
29 LINK.c=$(CC) $(CFLAGS) $(LDFLAGS)
31 LIBGROFF=$(TOP)/libgroff/libgroff.a
32 LIBBIB=$(TOP)/libbib/libbib.a
33 LIBDRIVER=$(TOP)/libdriver/libdriver.a
42 MOSTLYCLEANFILES=$(MANCLEAN) $(PROG) $(OBJS) $(GENSRCS) $(GENHDRS) \
43 depend.temp core $(CLEANADD)
44 CLEANFILES=$(LIBCLEAN)
45 DISTCLEANFILES=TAGS Makefile
46 REALCLEANFILES=$(YTABC) $(YTABH) Makefile.dep
49 MANPAGES=$(MAN1) $(MAN5) $(MAN7)
51 fontsubdir=$(fontdir)/dev$(DEV)
53 all install install_bin install_data TAGS depend distfiles:
55 install: install_bin install_data
57 .PHONY: all clean distclean mostlyclean realclean extraclean depend distfiles
58 .PHONY: install install_bin install_data
61 -rm -f $(MOSTLYCLEANFILES)
64 -rm -f $(CLEANFILES) $(MOSTLYCLEANFILES)
67 -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES)
70 -rm -f $(REALCLEANFILES) $(DISTCLEANFILES) $(CLEANFILES) \
74 -rm -f $(DISTCLEANFILES) $(CLEANFILES) $(MOSTLYCLEANFILES) \
75 \#* *~ core junk grot old temp tmp tem
78 .SUFFIXES: .o .cc .c .y .man .n
87 if test -n "$(YTABH)"; then \
88 $(YACC) $(YACCFLAGS) -d $<; \
90 $(YACC) $(YACCFLAGS) $<; \
93 test -z "$(YTABH)" || mv y.tab.h $(YTABH)
96 @echo Making $@ from $<
98 @sed -e "s;@HYPHENFILE@;$(hyphenfile);g" \
99 -e "s;@FONTDIR@;$(fontdir);g" \
100 -e "s;@FONTPATH@;$(fontpath);g" \
101 -e "s;@MACRODIR@;$(tmacdir);g" \
102 -e "s;@MACROPATH@;$(tmacpath);g" \
103 -e "s;@DEVICE@;$(DEVICE);g" \
104 -e "s;@DEFAULT_INDEX@;$(indexdir)/$(indexname);g" \
105 -e "s;@DEFAULT_INDEX_NAME@;$(indexname);g" \
106 -e "s;@INDEX_SUFFIX@;$(indexext);g" \
107 -e "s;@COMMON_WORDS_FILE@;$(common_words_file);g" \
108 -e "s;@MAN1EXT@;$(man1ext);g" \
109 -e "s;@MAN5EXT@;$(man5ext);g" \
110 -e "s;@MAN7EXT@;$(man7ext);g" \
111 -e "s;@TMAC_S@;$(tmac_s);g" \
112 -e "s;@TMAC_M@;$(tmac_m);g" \
113 -e "s;@TMAC_MDIR@;$(macrodir)/mm;g" \
114 -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \
115 -e "s;@VERSION@;`cat $(srcdir)/../VERSION`;g" \
116 -e "s;@MDATE@;`$(SHELL) $(srcdir)/../mdate.sh $<`;g" \
118 -e "s;@G@;`echo $(g) | tr [a-z] [A-Z]`;g" \
123 -test -d $(manroot) || mkdir $(manroot)
124 -test -d $(man1dir) || mkdir $(man1dir)
126 for p in $$pages; do \
127 prog=`basename $$p .n`; \
128 target=$(man1dir)/$(NAMEPREFIX)$$prog.$(man1ext); \
130 echo $(INSTALL_DATA) $$p $$target; \
131 $(INSTALL_DATA) $$p $$target; \
133 -test -d $(man5dir) || mkdir $(man5dir)
135 for p in $$pages; do \
136 target=$(man5dir)/`basename $$p .n`.$(man5ext); \
138 echo $(INSTALL_DATA) $$p $$target; \
139 $(INSTALL_DATA) $$p $$target; \
141 -test -d $(man7dir) || mkdir $(man7dir)
143 for p in $$pages; do \
144 target=$(man7dir)/`basename $$p .n`.$(man7ext); \
146 echo $(INSTALL_DATA) $$p $$target; \
147 $(INSTALL_DATA) $$p $$target; \
152 -test -d $(bindir) || mkdir $(bindir)
153 rm -f $(bindir)/$(NAMEPREFIX)$(PROG)
154 $(INSTALL_PROGRAM) $(PROG) $(bindir)/$(NAMEPREFIX)$(PROG)
158 -test -d $(datadir) || mkdir $(datadir)
159 -test -d $(datasubdir) || mkdir $(datasubdir)
160 -test -d $(fontdir) || mkdir $(fontdir)
161 -test -d $(fontsubdir) || mkdir $(fontsubdir)
162 -if test -d $(srcdir)/generate; then \
163 test -d $(fontsubdir)/generate || mkdir $(fontsubdir)/generate; \
165 -for f in $(DEVFILES); do \
166 rm -f $(fontsubdir)/$$f; \
167 if test -f $$f; then \
168 $(INSTALL_DATA) $$f $(fontsubdir)/$$f; \
170 $(INSTALL_DATA) $(srcdir)/$$f $(fontsubdir)/$$f; \
175 depend_src: depend.temp
176 mv depend.temp Makefile.dep
180 test -z "$(CCSRCS)$(YTABC)" \
181 || $(CCC) $(ALL_CCFLAGS) -MM $(CCSRCS) $(YTABC) >>depend.temp
183 || $(CC) $(ALL_CFLAGS) -MM $(CSRCS) >>depend.temp
184 if test -n "$(YTABH)"; then \
185 sed -e 's|$(YTABH)|$(YTABC)|g' depend.temp >depend.temp1; \
186 mv depend.temp1 depend.temp; \
191 $(ETAGS) $(ETAGSFLAGS) $(CCSRCS) $(CSRCS)
192 test -z "$(GRAM)$(HDRS)" \
193 || $(ETAGS) $(ETAGSFLAGS) -a $(ETAGSCCFLAG) $(GRAM) $(HDRS)
197 echo srcdir=$(srcdir) >>Makefile
198 echo VPATH=$(VPATH) >>Makefile
199 cat $(MAKEFILEPARTS) /dev/null >>Makefile