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 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 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 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 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 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 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 suif-install $$target $(BINDIR) 775 ; \
311 install-scripts: $(SCRIPTS) install-bin-base
313 for target in $(SCRIPTS); do \
314 suif-install $$target $(SCRIPTDIR) 775 ; \
318 install-lib: $(LIBNAME_SET) install-bin-base
319 ifeq ($(INSTALL_SHARED_LIB),true)
320 suif-install $(SHARED_LIBNAME) $(SODIR) 444
322 ifeq ($(INSTALL_STATIC_LIB),true)
323 suif-install $(STATIC_LIBNAME) $(LIBDIR) 444
324 ifeq ($(MACHINE),sparc-sun-sunos4)
325 ranlib $(LIBDIR)/$(STATIC_LIBNAME)
328 rm -f $(AUTOINITDIR)/$(TARGET)
330 touch $(AUTOINITDIR)/$(TARGET)
333 install-bin-base: $(ALLTCLSRCS)
335 ifneq (,$(strip $(ALLTCLSRCS)))
336 for target in $(ALLTCLSRCS); do \
337 suif-install $$target $(TCLDIR) 444 ; \
343 ifneq (,$(strip $(TARGET_EXECUTABLES)))
344 for target in $(TARGET_EXECUTABLES); do \
345 rm -f $(BINDIR)/$$target ; \
348 rm -f $(LIBDIR)/$(STATIC_LIBNAME)
349 rm -f $(SODIR)/$(SHARED_LIBNAME)
351 rm -f $(AUTOINITDIR)/$(TARGET)
354 install-bin-recursive:
356 suif-recursive-make install-bin-all
360 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-bin
361 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-bin-recursive
364 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) deinstall-src
365 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-src-dir
366 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-src
367 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-recursive-src
373 install-local-src: $(REALSRCS)
375 install-recursive-src:
377 suif-recursive-make install-src
381 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-incl
382 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-recursive-incl
384 install-local-incl: $(EXPORTS)
386 ifneq (,$(strip $(ALLHEADERS)))
387 if test ! -d $(INCLDIR)/$(PACKAGE_NAME) ; then \
388 mkdir $(INCLDIR)/$(PACKAGE_NAME) ; \
390 chmod 775 $(INCLDIR)/$(PACKAGE_NAME) ; \
391 suif-install-env ALLHEADERS $(INCLDIR)/$(PACKAGE_NAME) 444
393 rm -rf $(INCLDIR)/$(PACKAGE_NAME)
394 mkdir $(INCLDIR)/$(PACKAGE_NAME)
395 chmod 775 $(INCLDIR)/$(PACKAGE_NAME)
397 for i in $(EXPORTS) ; do \
398 suif-install $$i $(INCLDIR) 444 ; \
402 deinstall-local-incl:
404 rm -rf $(INCLDIR)/$(PACKAGE_NAME)
405 for i in $(EXPORTS) ; do \
406 rm -f $(INCLDIR)/$$i ; \
410 install-recursive-incl:
412 suif-recursive-make install-incl
416 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-local-info
417 @$(MAKE) --no-print-directory $(MAKEPARFLAGS) install-recursive-info
419 install-local-info: $(STAMP_DOC_TARGETS) $(MANPAGES) $(ALLGIFSRCS)
422 for i in $(INFOS) ; do \
423 for j in $$i.info* ; do \
424 suif-install $$j $(INFODIR) 444 ; \
429 for i in $(INFOS) ; do \
430 suif-install $$i.ps $(DOCDIR) 444 ; \
434 ifneq (,$(strip $(ALLGIFSRCS)))
435 for i in $(ALLGIFSRCS) ; do \
436 suif-install $$i $(HTMLDIR) 444 ; \
439 for i in $(INFOS) ; do \
440 for j in $$i*.html ; do \
441 suif-install $$j $(HTMLDIR) 444 ; \
448 for i in $(MANPAGES) ; do \
449 MANSUFFIX=`echo $$i | sed 's/.*\.//'` ; \
450 MANSUFDIR=$(MANDIR)/man$$MANSUFFIX ; \
451 if test ! -d $$MANSUFDIR; then \
453 chmod 775 $$MANSUFDIR; \
456 suif-install $$i $$MANSUFDIR 444 ; \
460 for i in $(MANPAGES) ; do \
461 if test ! -f $(HTMLDIR)/man_$$i.html || \
462 newer $$i $(HTMLDIR)/man_$$i.html; then \
463 rm -f $(HTMLDIR)/man_$$i.html ; \
464 nroff -man $$i | rman -n $$i -f HTML -r \
465 "man_%s.%s.html" -l "Man page for %s" > \
466 $(HTMLDIR)/man_$$i.html ; \
472 deinstall-local-info:
474 for i in $(INFOS) ; do \
475 rm -f $(INFODIR)/$$i.info* ; \
477 for i in $(INFOS) ; do \
478 rm -f $(DOCDIR)/$$i.ps ; \
480 for i in $(ALLGIFSRCS) ; do \
481 rm -f $(HTMLDIR)/$$i ; \
483 for i in $(INFOS) ; do \
484 rm -f $(HTMLDIR)/$$i*.html ; \
488 for i in $(MANPAGES) ; do \
489 rm -f $(MANDIR)/$$i ; \
491 for i in $(MANPAGES) ; do \
492 rm -f $(HTMLDIR)/man_$$i.html ; \
496 install-recursive-info:
498 suif-recursive-make install-info
501 preinstall-check: $(ALLVERDATAFILE)
502 ifneq (,$(strip $(ALLVERDATAFILE)))
503 @if test -f $(BINDIR)/ververver ; then \
504 ververver -check $(PACKAGE_NAME) $(ALLVERDATAFILE) \
514 ifneq (,$(strip $(ALLVERDATAFILE)))
515 @ververver -install $(PACKAGE_NAME) $(ALLVERDATAFILE) \
520 ifneq (,$(strip $(ALLVERDATAFILE)))
521 @if test -f $(BINDIR)/ververver ; then \
522 ververver -deinstall $(PACKAGE_NAME) \
523 $(ALLVERDATAFILE) $(VERDATADIR) ; \
534 rm -f core $(OBJS) $(TARGET) $(STATIC_LIBNAME)
535 rm -f $(SHARED_LIBNAME) $(ALLTMPSRCS)
538 rm -f prog_ver.cc prog_ver.o
539 rm -f lib_ver.cc lib_ver.o
540 rm -f start_sty.cc start_sty.o
541 rm -f register_lib.cc register_lib.o
546 rm -f stamp-library-closure
547 ifneq ($(PACKAGE_NAME),suif1)
551 for i in $(INFOS) ; do \
552 rm -f $$i.cp $$i.fn $$i.ky $$i.pg $$i.tp $$i.vr ; \
553 rm -f $$i.cps $$i.fns $$i.kys $$i.pgs $$i.tps ; \
554 rm -f $$i.vrs $$i.toc $$i.info* $$i*.html ; \
555 rm -f $$i.dvi $$i.ps $$i.aux $$i.log ; \
563 suif-recursive-make clean
567 # NOTE: I had to separate out the components of REALSRCS here because
568 # otherwise some libraries, such as libsuif, cause lines that are too
569 # long and the attempted ``make clean'' fails.
575 suif-recursive-make clean-rcs-links
578 stamp-depend: Makefile $(ALLCSRCS) $(ALLCXXSRCS) $(ALLHEADERS)
581 depend: Makefile.deps
583 Makefile.deps: Makefile stamp-depend
585 @echo > Makefile.deps
586 ifneq ($(strip $(ALLCXXSRCS)),)
587 @echo '# Dependencies for C++ files' >> Makefile.deps
588 @echo >> Makefile.deps
589 $(CXX) $(DEPSFLAG) $(CXXFLAGS) $(ALLCXXSRCS) >> Makefile.deps
590 @echo >> Makefile.deps
592 ifneq ($(strip $(ALLCSRCS)),)
593 @echo '# Dependencies for C files' >> Makefile.deps
594 @echo >> Makefile.deps
595 $(CC) $(DEPSFLAG) $(CFLAGS) $(ALLCSRCS) >> Makefile.deps
596 @echo >> Makefile.deps
600 @echo $(SUB_PACKAGES)
607 ifneq ($(PACKAGE_NAME),suif1)
610 ln -s $(INCLDIR)/suif_logo.epsf .
614 @REALSRCS='$(REALSRCS)' build_dir_setup_links
618 suif-recursive-make directory-structure