| 1 |
# ASCEND TK Makefile.Rules |
| 2 |
# Mark Thomas |
| 3 |
# May 27, 1996 |
| 4 |
# $Date: 1998/05/21 17:48:05 $ |
| 5 |
# $Revision: 1.8 $ |
| 6 |
# $Author: mthomas $ |
| 7 |
# $Source: /afs/cs.cmu.edu/project/ascend/Repository/ascend4/TK/Makefile.Rules.in,v $ |
| 8 |
# |
| 9 |
|
| 10 |
# This file contains the Make Rules which all Makefiles in this |
| 11 |
# subdirectory tree use. |
| 12 |
# |
| 13 |
# The Makefiles in this subdirectory tree and this Makefile.Rules |
| 14 |
# file install the ASCEND specific tcl/tk code in the install |
| 15 |
# directory ASCEND_TK_DIR |
| 16 |
|
| 17 |
# Each Makefile.in in this directory tree should define two lists: |
| 18 |
# |
| 19 |
# INSTALL_SUBDIR_LIST -- lists the subdirectories of this directory |
| 20 |
# which contain files to be installed |
| 21 |
# |
| 22 |
# INSTALL_FILE_LIST -- lists the files that are to be installed |
| 23 |
# when ASCEND is installed. |
| 24 |
# |
| 25 |
# See Makefile.Template in this directory for a sample Makefile.in |
| 26 |
|
| 27 |
|
| 28 |
SHELL = /bin/sh |
| 29 |
@SET_MAKE@ |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
# dummy targets so make won't complain |
| 34 |
install install-binaries install-libraries install-models:: |
| 35 |
|
| 36 |
# this target traverses the directory tree and installs the files |
| 37 |
install-subtree: Makefile |
| 38 |
@if [ ! -d $(INSTALL_TARGET_DIR) ]; then \ |
| 39 |
echo Making directory $(INSTALL_TARGET_DIR) ; \ |
| 40 |
mkdir -p $(INSTALL_TARGET_DIR) ; \ |
| 41 |
fi |
| 42 |
@for i in $(INSTALL_FILE_LIST) /dev/null ; do \ |
| 43 |
if $(CMP) -s $(srcdir)/$$i $(INSTALL_TARGET_DIR)/$$i ; then \ |
| 44 |
echo "Skipping $$i (up to date)" ; \ |
| 45 |
elif [ $$i != "/dev/null" ]; then \ |
| 46 |
echo "Installing $$i --> $(INSTALL_TARGET_DIR)" ; \ |
| 47 |
$(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_TARGET_DIR) ; \ |
| 48 |
fi ; \ |
| 49 |
done |
| 50 |
@for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
| 51 |
if [ $$i != "/dev/null" ]; then \ |
| 52 |
(cd $$i ; $(MAKE) $@ RULES_FILE="../$(RULES_FILE)" \ |
| 53 |
INSTALL_TARGET_DIR="$(INSTALL_TARGET_DIR)/$$i" \ |
| 54 |
INSTALL_DATA="$(INSTALL_DATA)" CMP="$(CMP)" ) ; \ |
| 55 |
fi ; \ |
| 56 |
done |
| 57 |
|
| 58 |
# the reverse of above |
| 59 |
uninstall:: |
| 60 |
|
| 61 |
uninstall-subtree:: |
| 62 |
@for i in $(INSTALL_FILE_LIST) /dev/null ; do \ |
| 63 |
if test -f $(INSTALL_TARGET_DIR)/$$i ; then \ |
| 64 |
echo Removing $(INSTALL_TARGET_DIR)/$$i ; \ |
| 65 |
$(RM) $(INSTALL_TARGET_DIR)/$$i ; \ |
| 66 |
fi ; \ |
| 67 |
done |
| 68 |
@for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
| 69 |
if [ $$i != "/dev/null" ]; then \ |
| 70 |
(cd $$i ; $(MAKE) $@ RULES_FILE="../$(RULES_FILE)" \ |
| 71 |
INSTALL_TARGET_DIR="$(INSTALL_TARGET_DIR)/$$i" RM="$(RM)" ) ; \ |
| 72 |
fi ; \ |
| 73 |
done |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
# Warn when the Makefile is older than Makefile.in |
| 78 |
Makefile: $(srcdir)/Makefile.in |
| 79 |
@echo "" |
| 80 |
@echo "$(srcdir)/Makefile.in is newer than Makefile" |
| 81 |
@echo "Consider running 'configure' again or running 'make makes'" |
| 82 |
@echo "" |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
# A target to make a backup copy of you Makefile. Useful to do before |
| 87 |
# you rerun configure so you don't lose all the hacks you added. |
| 88 |
save-makes:: |
| 89 |
@-for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
| 90 |
if [ $$i != "/dev/null" ]; then \ |
| 91 |
(cd $$i ; $(MAKE) $@ CP="$(CP)" \ |
| 92 |
RULES_FILE="../$(RULES_FILE)"); \ |
| 93 |
fi ; \ |
| 94 |
done |
| 95 |
-$(CP) Makefile Makefile.SAVED |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
# Targets to remove generated files. `distclean' removes nearly |
| 100 |
# everything generated since you last ran `configure' |
| 101 |
clean:: |
| 102 |
|
| 103 |
distclean:: clean |
| 104 |
for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
| 105 |
if [ $$i != "/dev/null" ]; then \ |
| 106 |
(cd $$i ; $(MAKE) $@ RM="$(RM)" \ |
| 107 |
RULES_FILE="../$(RULES_FILE)"); \ |
| 108 |
fi ; \ |
| 109 |
done |
| 110 |
$(RM) *~ \#* *.bak TAGS |
| 111 |
$(RM) Makefile Makefile.Rules Makefile.SAVED Makefile.Rules.SAVED |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
# Targets to generate emacs style (TAGS) and vi style (tags) tables |
| 116 |
# for quick lookup of Tcl procedures |
| 117 |
TAGS:: |
| 118 |
-$(ETAGS) --append --output=$(TAGSFILE) --language=none \ |
| 119 |
--regex='/proc[ \t]+\([^ \t]+\)/\1/' \ |
| 120 |
$(srcdir)/*.tcl $(srcdir)/*.t |
| 121 |
-for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
| 122 |
if [ $$i != "/dev/null" ]; then \ |
| 123 |
(cd $$i ; $(MAKE) $@ TAGSFILE="../$(TAGSFILE)" ETAGS="$(ETAGS)" \ |
| 124 |
RULES_FILE="../$(RULES_FILE)"); \ |
| 125 |
fi ; \ |
| 126 |
done |
| 127 |
|
| 128 |
tags:: |
| 129 |
-$(CTAGS) --append --output=$(TAGSFILE) --language=none \ |
| 130 |
--regex='/proc[ \t]+\([^ \t]+\)/\1/' \ |
| 131 |
$(srcdir)/*.tcl $(srcdir)/*. |
| 132 |
-for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
| 133 |
if [ $$i != "/dev/null" ]; then \ |
| 134 |
(cd $$i ; $(MAKE) $@ TAGSFILE="../$(TAGSFILE)" CTAGS="$(CTAGS)" \ |
| 135 |
RULES_FILE="../$(RULES_FILE)"); \ |
| 136 |
fi ; \ |
| 137 |
done |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
# untested targets for generating documentation from the tcl source files |
| 142 |
.SUFFIXES: |
| 143 |
.SUFFIXES: .tcl .tch |
| 144 |
|
| 145 |
.tcl.tch: |
| 146 |
grep '^#' $< > $@ |
| 147 |
|
| 148 |
documentation: |
| 149 |
for i in `echo $(INSTALL_FILE_LIST) /dev/null | sed 's/tcl/tch/g'`; do\ |
| 150 |
case "$$i" in *\.tch) \ |
| 151 |
doc_file_list="$$doc_file_list $$i" ;; \ |
| 152 |
esac ; \ |
| 153 |
done ; \ |
| 154 |
if [ -n "$$doc_file_list" ] ; then \ |
| 155 |
$(MAKE) $$doc_file_list ; \ |
| 156 |
fi |
| 157 |
$(RM) FILE_INDEX.tch ALPHA_INDEX.tch |
| 158 |
-grep -n '^# proc ' *.tch > FILE_INDEX.tch |
| 159 |
-cat *.tch | grep '^# proc ' | sort > ALPHA_INDEX.tch |
| 160 |
for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
| 161 |
if [ $$i != "/dev/null" ]; then \ |
| 162 |
(cd $$i ; $(MAKE) $@ RM="$(RM)" \ |
| 163 |
RULES_FILE="../$(RULES_FILE)") ; \ |
| 164 |
fi ; \ |
| 165 |
done |
| 166 |
|
| 167 |
# Force emacs to treat this file as a Makefile |
| 168 |
# |
| 169 |
# Local Variables: *** |
| 170 |
# mode:Makefile *** |
| 171 |
# End: *** |