1 # read the standard variable definitions
3 include $(SUIFHOME)/Makefile.defs
5 # comment these out and/or pass them in from the environment to not
6 # build the documentation on your machine:
13 # similar for this one for the shared TCL libraries and scripts:
19 # To save time on some systems, set CATSOURCE to catted.cc and
20 # set BUILD_CATTED_LIBRARIES in Makefile, to cat all .cc files together
21 # and compile as one unit.
25 OBJS := $(subst .cc,.o,$(CATSOURCE))
28 $(CATSOURCE): $(OLD_SRCS)
30 fgrep '#pragma implementation' $(OLD_SRCS) | \
31 sed -e 's/^[^:]*://' > $(CATSOURCE)
32 cat $(OLD_SRCS) | fgrep -v '#pragma implementation' \
35 ifdef BUILD_CATTED_LIBRARIES
36 USE_SUIF_STRIPPED_HEADERS =
38 USE_SUIF_STRIPPED_HEADERS = -DSUIF_STRIPPED_HEADERS
41 REALSRCS = $(YSRCS) $(DSRCS) $(HEADERS) $(CSRCS) $(SRCS) \
42 $(INFOSRCS) $(MANPAGES) $(GIFSRCS) $(VERDATAFILE) $(TCLSRCS) \
44 ALLTMPSRCS = $(TMP_YSRCS) $(TMP_DSRCS) $(TMP_HEADERS) $(TMP_CSRCS) \
45 $(TMP_SRCS) $(TMP_INFOSRCS) $(TMP_MANPAGES) $(TMP_GIFSRCS) \
46 $(TMP_VERDATAFILE) $(TMP_TCLSRCS) \
48 ALLSRCS = $(REALSRCS) $(ALLTMPSRCS)
49 ALLCSRCS = $(CSRCS) $(TMP_CSRCS)
50 ALLCXXSRCS = $(SRCS) $(TMP_SRCS)
51 ALLHEADERS = $(HEADERS) $(AUXILIARY_HEADERS) $(TMP_HEADERS)
52 ALLGIFSRCS = $(GIFSRCS) $(TMP_GIFSRCS)
53 ALLVERDATAFILE = $(VERDATAFILE) $(TMP_VERDATAFILE)
54 ALLTCLSRCS = $(TCLSRCS) $(TMP_TCLSRCS)
56 # note: ALLHEADERS exported so we can suif-install-env it
57 # it is cleared in suif-recursive-make
58 unexport REALSRCS ALLTMPSRCS ALLSRCS ALLCSRCS ALLCXXSRCS
59 unexport ALLGIFSRCS ALLVERDATAFILE ALLTCLSRCS
61 # Why put $(LIBNAME_SET) under .PHONY? Because at the top of
62 # Makefile.rules vpath is set to include the library binary directory,
63 # but we don't want it to find local targets there and not build them
64 # locally. Makefile.rules attempts to solve this problem by only
65 # adding the vpath constructs if LIBS is defined, so it won't be
66 # invoked on pure libraries. But this isn't sufficient for sharlit
67 # and nsharlit because they define both a program and a library. So
68 # we use .PHONY to make sure the local libraries are always rebuilt.
70 .PHONY: $(TARGET) $(LIBNAME_SET) pure prog_ver.cc lib_ver.cc \
71 start_sty.cc register_lib.cc lib prog info install \
72 install-keep-src show-install reinstall reinstall-keep-src \
73 show-reinstall reinstall-bin show-reinstall-bin \
74 real-reinstall real-reinstall-keep-src deinstall \
75 install-local-ver install-ver install-prog install-scripts \
76 install-lib install-bin-base deinstall-bin \
77 install-bin-recursive install-bin-all deinstall-src \
78 install-src-dir install-local-src install-recursive-src \
79 install-src install-incl install-local-incl \
80 deinstall-local-incl install-recursive-incl install-info \
81 install-local-info deinstall-local-info \
82 install-recursive-info preinstall-check install-verdata \
83 deinstall-verdata source clean clean-src clean-rcs-links \
84 depend sub-packages recursive build-dir directory-structure
90 include $(SUIFHOME)/Makefile.rules
93 STAMP_INFO_TARGET = stamp-info
96 STAMP_PS_TARGET = stamp-ps
99 STAMP_HTML_TARGET = stamp-html
101 STAMP_DOC_TARGETS = $(STAMP_INFO_TARGET) $(STAMP_PS_TARGET) \
104 unexport STAMP_INFO_TARGET STAMP_PS_TARGET STAMP_HTML_TARGET STAMP_DOC_TARGETS
106 %.o : %.c $(REALSRCS) $(TMP_HEADERS) $(TMP_CSRCS) Makefile.deps FORCE
107 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
109 %.o : %.cc $(REALSRCS) $(TMP_HEADERS) $(TMP_SRCS) Makefile.deps FORCE
110 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
112 $(TARGET): $(OBJS) Makefile.deps
113 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
115 pure: $(OBJS) Makefile.deps
116 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
118 $(STATIC_LIBNAME): $(OBJS) Makefile.deps
119 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
121 $(SHARED_LIBNAME): $(OBJS) Makefile.deps
122 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
124 prog_ver.cc: $(TMP_HEADERS) $(TMP_SRCS) $(TMP_CSRCS) $(OBJS) Makefile.deps
125 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
127 lib_ver.cc: $(TMP_HEADERS) $(TMP_SRCS) $(TMP_CSRCS) $(OBJS) Makefile.deps
128 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
130 start_sty.cc: $(TMP_HEADERS) $(TMP_SRCS) $(TMP_CSRCS) Makefile.deps Makefile
131 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
133 register_lib.cc: $(TMP_HEADERS) $(TMP_SRCS) $(TMP_CSRCS) Makefile.deps Makefile
134 @$(MAKE) --no-print-directory -f $(SUIFHOME)/Makefile.sub $@
138 prog: $(TARGET_EXECUTABLES)
146 all-docs: stamp-info stamp-ps stamp-html
148 stamp-info: $(INFOSRCS)
150 for i in $(INFOS) ; do \
151 makeinfo $$i.texi ; \
157 stamp-ps: $(INFOSRCS) suif_logo.epsf
158 for i in $(INFOS) ; do \
159 if test ! -f $$i.ps || \
160 newer $$i.texi $$i.ps ; then \
162 texindex $$i.cp $$i.fn $$i.ky $$i.pg $$i.tp $$i.vr ; \
164 dvips -o $$i.ps $$i.dvi ; \
169 stamp-ps: $(INFOSRCS)
173 stamp-html: $(INFOSRCS)
175 for i in $(INFOS) ; do \
176 texi2html -split_node -menu $$i.texi ; \
182 $(MAKE) --no-print-directory
185 @$(MAKE) --no-print-directory preinstall-check
186 @$(MAKE) --no-print-directory deinstall-src 1>> $(LOGFILE) 2>&1
187 @$(MAKE) --no-print-directory install-src-dir 1>> $(LOGFILE) \
190 @SILENT_RECURSIVE_MAKE=yes $(BINDIR)/suif-recursive-make $@ 2> \
193 @if $(MAKE) --no-print-directory SUB_PACKAGES= \
194 install-keep-src 1>> $(LOGFILE) 2>&1; then \
195 echo $(PACKAGE_FULL_NAME)" ... OK"; \
197 echo $(PACKAGE_FULL_NAME)" ... FAILED -- see" \
198 $(PACKAGE_FULL_NAME)/$(LOGFILE); \
200 @$(MAKE) --no-print-directory install-verdata 1>> $(LOGFILE) \
204 @$(MAKE) --no-print-directory install-ver
205 @$(MAKE) --no-print-directory reinstall
208 @$(MAKE) --no-print-directory install-ver
209 @$(MAKE) --no-print-directory reinstall-keep-src
212 @$(MAKE) --no-print-directory deinstall-verdata 1> $(LOGFILE) \
214 @$(MAKE) --no-print-directory preinstall-check
215 @$(MAKE) --no-print-directory deinstall-src 1>> $(LOGFILE) 2>&1
216 @$(MAKE) --no-print-directory install-src-dir 1>> $(LOGFILE) \
219 @SILENT_RECURSIVE_MAKE=yes $(BINDIR)/suif-recursive-make $@ 2> \
222 @if $(MAKE) --no-print-directory SUB_PACKAGES= \
223 reinstall-keep-src 1>> $(LOGFILE) 2>&1; then \
224 echo $(PACKAGE_FULL_NAME)" ... OK"; \
226 echo $(PACKAGE_FULL_NAME)" ... FAILED -- see" \
227 $(PACKAGE_FULL_NAME)/$(LOGFILE); \
229 @$(MAKE) --no-print-directory install-verdata 1>> $(LOGFILE) \
233 $(MAKE) --no-print-directory real-reinstall ; \
236 $(MAKE) --no-print-directory real-reinstall-keep-src
238 show-reinstall-keep-src:
240 @SILENT_RECURSIVE_MAKE=yes $(BINDIR)/suif-recursive-make $@ 2> \
245 @if $(MAKE) --no-print-directory SUB_PACKAGES= \
246 reinstall-keep-src 1>> $(LOGFILE) 2>&1; then \
247 echo $(PACKAGE_FULL_NAME)" ... OK"; \
249 echo $(PACKAGE_FULL_NAME)" ... FAILED -- see" \
250 $(PACKAGE_FULL_NAME)/$(LOGFILE); \
255 @SILENT_RECURSIVE_MAKE=yes $(BINDIR)/suif-recursive-make $@ 2> \
258 @if $(MAKE) --no-print-directory SUB_PACKAGES= reinstall-bin \
259 1> $(LOGFILE) 2>&1; then \
260 echo $(PACKAGE_FULL_NAME)" ... OK"; \
262 echo $(PACKAGE_FULL_NAME)" ... FAILED -- see" \
263 $(PACKAGE_FULL_NAME)/$(LOGFILE); \
267 $(MAKE) --no-print-directory install-bin-all
270 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-verdata
271 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) preinstall-check
272 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-src
273 @$(MAKE) --no-print-directory real-reinstall-keep-src
274 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-verdata
276 real-reinstall-keep-src:
277 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-bin
278 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-src-dir
279 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-src
280 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-incl
281 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-info
283 $(BINDIR)/suif-recursive-make real-reinstall-keep-src
287 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-verdata
288 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-src
289 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-bin
290 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-local-incl
291 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-local-info
293 $(BINDIR)/suif-recursive-make deinstall
298 install-ver: install-local-ver
299 @if test ! ""$(SUPER_PACKAGES_PATH) = "" ; then \
300 owner_package=`echo $(SUPER_PACKAGES_PATH) | \
306 install-prog: $(TARGET_EXECUTABLES) install-bin-base
307 for target in $(TARGET_EXECUTABLES); do \
308 if test -f $$target$(EXEEXT); then \
309 $(BINDIR)/install-sh -C -m 775 $$target$(EXEEXT) $(BINDIR) ; \
311 $(BINDIR)/install-sh -C -m 775 $$target $(BINDIR) ; \
315 install-scripts: $(SCRIPTS) install-bin-base
317 for target in $(SCRIPTS); do \
318 $(BINDIR)/install-sh -C -m 775 $$target $(SCRIPTDIR) ; \
322 install-lib: $(LIBNAME_SET) install-bin-base
323 ifeq ($(INSTALL_SHARED_LIB),true)
324 $(BINDIR)/install-sh -C -m 444 $(SHARED_LIBNAME) $(SODIR)
326 ifeq ($(INSTALL_STATIC_LIB),true)
327 $(BINDIR)/install-sh -C -m 444 $(STATIC_LIBNAME) $(LIBDIR)
328 ifeq ($(MACHINE),sparc-sun-sunos4)
329 ranlib $(LIBDIR)/$(STATIC_LIBNAME)
332 rm -f $(AUTOINITDIR)/$(TARGET)
334 touch $(AUTOINITDIR)/$(TARGET)
337 install-bin-base: $(ALLTCLSRCS)
339 ifneq (,$(strip $(ALLTCLSRCS)))
340 for target in $(ALLTCLSRCS); do \
341 $(BINDIR)/install-sh -C -m 444 $$target $(TCLDIR) ; \
347 ifneq (,$(strip $(TARGET_EXECUTABLES)))
348 for target in $(TARGET_EXECUTABLES); do \
349 rm -f $(BINDIR)/$$target ; \
352 rm -f $(LIBDIR)/$(STATIC_LIBNAME)
353 rm -f $(SODIR)/$(SHARED_LIBNAME)
355 rm -f $(AUTOINITDIR)/$(TARGET)
358 install-bin-recursive:
360 $(BINDIR)/suif-recursive-make install-bin-all
364 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-bin
365 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-bin-recursive
368 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-src
369 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-src-dir
370 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-src
371 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-recursive-src
377 install-local-src: $(REALSRCS)
379 install-recursive-src:
381 $(BINDIR)/suif-recursive-make install-src
385 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-incl
386 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-recursive-incl
388 install-local-incl: $(EXPORTS)
390 ifneq (,$(strip $(ALLHEADERS)))
391 if test ! -d $(INCLDIR)/$(PACKAGE_NAME) ; then \
392 mkdir $(INCLDIR)/$(PACKAGE_NAME) ; \
394 chmod 775 $(INCLDIR)/$(PACKAGE_NAME) ; \
395 $(BINDIR)/install-sh -C -m 444 $(ALLHEADERS) $(INCLDIR)/$(PACKAGE_NAME)
397 rm -rf $(INCLDIR)/$(PACKAGE_NAME)
398 mkdir $(INCLDIR)/$(PACKAGE_NAME)
399 chmod 775 $(INCLDIR)/$(PACKAGE_NAME)
401 for i in $(EXPORTS) ; do \
402 $(BINDIR)/install-sh -C -m 444 $$i $(INCLDIR) ; \
406 deinstall-local-incl:
408 rm -rf $(INCLDIR)/$(PACKAGE_NAME)
409 for i in $(EXPORTS) ; do \
410 rm -f $(INCLDIR)/$$i ; \
414 install-recursive-incl:
416 $(BINDIR)/suif-recursive-make install-incl
420 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-info
421 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-recursive-info
423 install-local-info: $(STAMP_DOC_TARGETS) $(MANPAGES) $(ALLGIFSRCS)
426 for i in $(INFOS) ; do \
427 for j in $$i.info* ; do \
428 $(BINDIR)/install-sh -C -m 444 $$j $(INFODIR) ; \
433 for i in $(INFOS) ; do \
434 $(BINDIR)/install-sh -C -m 444 $$i.ps $(DOCDIR) ; \
438 ifneq (,$(strip $(ALLGIFSRCS)))
439 for i in $(ALLGIFSRCS) ; do \
440 $(BINDIR)/install-sh -C -m 444 $$i $(HTMLDIR) ; \
443 for i in $(INFOS) ; do \
444 for j in $$i*.html ; do \
445 $(BINDIR)/install-sh -C -m 444 $$j $(HTMLDIR) ; \
452 for i in $(MANPAGES) ; do \
453 MANSUFFIX=`echo $$i | sed 's/.*\.//'` ; \
454 MANSUFDIR=$(MANDIR)/man$$MANSUFFIX ; \
455 if test ! -d $$MANSUFDIR; then \
457 chmod 775 $$MANSUFDIR; \
460 $(BINDIR)/install-sh -C -m 444 $$i $$MANSUFDIR ; \
464 for i in $(MANPAGES) ; do \
465 if test ! -f $(HTMLDIR)/man_$$i.html || \
466 newer $$i $(HTMLDIR)/man_$$i.html; then \
467 rm -f $(HTMLDIR)/man_$$i.html ; \
468 nroff -man $$i | rman -n $$i -f HTML -r \
469 "man_%s.%s.html" -l "Man page for %s" > \
470 $(HTMLDIR)/man_$$i.html ; \
476 deinstall-local-info:
478 for i in $(INFOS) ; do \
479 rm -f $(INFODIR)/$$i.info* ; \
481 for i in $(INFOS) ; do \
482 rm -f $(DOCDIR)/$$i.ps ; \
484 for i in $(ALLGIFSRCS) ; do \
485 rm -f $(HTMLDIR)/$$i ; \
487 for i in $(INFOS) ; do \
488 rm -f $(HTMLDIR)/$$i*.html ; \
492 for i in $(MANPAGES) ; do \
493 rm -f $(MANDIR)/$$i ; \
495 for i in $(MANPAGES) ; do \
496 rm -f $(HTMLDIR)/man_$$i.html ; \
500 install-recursive-info:
502 $(BINDIR)/suif-recursive-make install-info
505 preinstall-check: $(ALLVERDATAFILE)
506 ifneq (,$(strip $(ALLVERDATAFILE)))
507 @if test -f $(BINDIR)/ververver ; then \
508 $(BINDIR)/ververver -check $(PACKAGE_NAME) $(ALLVERDATAFILE) \
518 ifneq (,$(strip $(ALLVERDATAFILE)))
519 @$(BINDIR)/ververver -install $(PACKAGE_NAME) $(ALLVERDATAFILE) \
524 ifneq (,$(strip $(ALLVERDATAFILE)))
525 @if test -f $(BINDIR)/ververver ; then \
526 $(BINDIR)/ververver -deinstall $(PACKAGE_NAME) \
527 $(ALLVERDATAFILE) $(VERDATADIR) ; \
538 rm -f core $(OBJS) $(TARGET) $(STATIC_LIBNAME)
539 rm -f $(SHARED_LIBNAME) $(ALLTMPSRCS)
542 rm -f prog_ver.cc prog_ver.o
543 rm -f lib_ver.cc lib_ver.o
544 rm -f start_sty.cc start_sty.o
545 rm -f register_lib.cc register_lib.o
550 rm -f stamp-library-closure
551 ifneq ($(PACKAGE_NAME),suif1)
555 for i in $(INFOS) ; do \
556 rm -f $$i.cp $$i.fn $$i.ky $$i.pg $$i.tp $$i.vr ; \
557 rm -f $$i.cps $$i.fns $$i.kys $$i.pgs $$i.tps ; \
558 rm -f $$i.vrs $$i.toc $$i.info* $$i*.html ; \
559 rm -f $$i.dvi $$i.ps $$i.aux $$i.log ; \
567 $(BINDIR)/suif-recursive-make clean
571 # NOTE: I had to separate out the components of REALSRCS here because
572 # otherwise some libraries, such as libsuif, cause lines that are too
573 # long and the attempted ``make clean'' fails.
579 $(BINDIR)/suif-recursive-make clean-rcs-links
582 stamp-depend: Makefile $(ALLCSRCS) $(ALLCXXSRCS) $(ALLHEADERS)
585 depend: Makefile.deps
587 Makefile.deps: Makefile stamp-depend
589 @echo > Makefile.deps
590 ifneq ($(strip $(ALLCXXSRCS)),)
591 @echo '# Dependencies for C++ files' >> Makefile.deps
592 @echo >> Makefile.deps
593 $(CXX) $(DEPSFLAG) $(CXXFLAGS) $(ALLCXXSRCS) >> Makefile.deps
594 @echo >> Makefile.deps
596 ifneq ($(strip $(ALLCSRCS)),)
597 @echo '# Dependencies for C files' >> Makefile.deps
598 @echo >> Makefile.deps
599 $(CC) $(DEPSFLAG) $(CFLAGS) $(ALLCSRCS) >> Makefile.deps
600 @echo >> Makefile.deps
604 @echo $(SUB_PACKAGES)
608 $(BINDIR)/suif-recursive-make
611 ifneq ($(PACKAGE_NAME),suif1)
614 ln -s $(INCLDIR)/suif_logo.epsf .
618 @REALSRCS='$(REALSRCS)' build_dir_setup_links
622 $(BINDIR)/suif-recursive-make directory-structure