1 |
aw0a |
1 |
# ASCEND Models Makefile.Rules |
2 |
|
|
# Mark Thomas |
3 |
|
|
# May 27, 1996 |
4 |
|
|
# $Date: 1998/05/21 17:49:44 $ |
5 |
|
|
# $Revision: 1.9 $ |
6 |
|
|
# $Author: mthomas $ |
7 |
|
|
# $Source: /afs/cs.cmu.edu/project/ascend/Repository/models/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 modeling libraries and examples into |
15 |
|
|
# the install directory MODELS_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 |
ben.allan |
624 |
QUIET_INSTALL=@QUIET_INSTALL@ |
31 |
aw0a |
1 |
|
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 |
ben.allan |
624 |
if test "x$(QUIET_INSTALL)" = "x0" ; then \ |
45 |
|
|
echo "Skipping $$i (up to date)" ; \ |
46 |
|
|
fi ; \ |
47 |
aw0a |
1 |
elif [ $$i != "/dev/null" ]; then \ |
48 |
ben.allan |
624 |
if test -f $(INSTALL_TARGET_DIR)/$$i ; then \ |
49 |
|
|
echo "Updating $$i --> $(INSTALL_TARGET_DIR)" ; \ |
50 |
|
|
else \ |
51 |
|
|
echo "Installing $$i --> $(INSTALL_TARGET_DIR)" ; \ |
52 |
|
|
fi; \ |
53 |
aw0a |
1 |
$(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_TARGET_DIR) ; \ |
54 |
|
|
fi ; \ |
55 |
|
|
done |
56 |
|
|
@for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
57 |
|
|
if [ $$i != "/dev/null" ]; then \ |
58 |
|
|
(cd $$i ; $(MAKE) $@ RULES_FILE="../$(RULES_FILE)" \ |
59 |
|
|
INSTALL_TARGET_DIR="$(INSTALL_TARGET_DIR)/$$i" \ |
60 |
|
|
INSTALL_DATA="$(INSTALL_DATA)" CMP="$(CMP)" ) ; \ |
61 |
|
|
fi ; \ |
62 |
|
|
done |
63 |
|
|
|
64 |
|
|
# the reverse of above |
65 |
|
|
uninstall:: |
66 |
|
|
|
67 |
|
|
uninstall-subtree:: |
68 |
|
|
@for i in $(INSTALL_FILE_LIST) /dev/null ; do \ |
69 |
|
|
if test -f $(INSTALL_TARGET_DIR)/$$i ; then \ |
70 |
|
|
echo Removing $(INSTALL_TARGET_DIR)/$$i ; \ |
71 |
|
|
$(RM) $(INSTALL_TARGET_DIR)/$$i ; \ |
72 |
|
|
fi ; \ |
73 |
|
|
done |
74 |
|
|
@for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
75 |
|
|
if [ $$i != "/dev/null" ]; then \ |
76 |
|
|
(cd $$i ; $(MAKE) $@ RULES_FILE="../$(RULES_FILE)" \ |
77 |
|
|
INSTALL_TARGET_DIR="$(INSTALL_TARGET_DIR)/$$i" RM="$(RM)" ) ; \ |
78 |
|
|
fi ; \ |
79 |
|
|
done |
80 |
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
# Warn when the Makefile is older than Makefile.in |
84 |
|
|
Makefile: $(srcdir)/Makefile.in |
85 |
|
|
@echo "" |
86 |
|
|
@echo "$(srcdir)/Makefile.in is newer than Makefile" |
87 |
|
|
@echo "Consider running 'configure' again or running 'make makes'" |
88 |
|
|
@echo "" |
89 |
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
# A target to make a backup copy of you Makefile. Useful to do before |
93 |
|
|
# you rerun configure so you don't lose all the hacks you added. |
94 |
|
|
save-makes:: |
95 |
|
|
@-for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
96 |
|
|
if [ $$i != "/dev/null" ]; then \ |
97 |
|
|
(cd $$i ; $(MAKE) $@ CP="$(CP)" \ |
98 |
|
|
RULES_FILE="../$(RULES_FILE)"); \ |
99 |
|
|
fi ; \ |
100 |
|
|
done |
101 |
|
|
-$(CP) Makefile Makefile.SAVED |
102 |
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
|
|
# Targets to remove generated files. `distclean' removes nearly |
106 |
|
|
# everything generated since you last ran `configure' |
107 |
|
|
clean:: |
108 |
|
|
|
109 |
|
|
distclean:: clean |
110 |
|
|
for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
111 |
|
|
if [ $$i != "/dev/null" ]; then \ |
112 |
|
|
(cd $$i ; $(MAKE) $@ RM="$(RM)" \ |
113 |
|
|
RULES_FILE="../$(RULES_FILE)"); \ |
114 |
|
|
fi ; \ |
115 |
|
|
done |
116 |
|
|
$(RM) *~ \#* *.bak TAGS |
117 |
|
|
$(RM) Makefile Makefile.Rules Makefile.SAVED Makefile.Rules.SAVED |
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
# Targets to generate emacs style (TAGS) and vi style (tags) tables |
122 |
|
|
# for quick lookup of ASCEND models and atoms |
123 |
|
|
TAGS:: |
124 |
|
|
-$(ETAGS) --append --output=$(TAGSFILE) --language=none \ |
125 |
|
|
--regex='/[ \t]*\(UNIVERSAL[ \t]+\)?ATOM[ \t]+\([A-Za-z_]+\)/\2/' \ |
126 |
|
|
--regex='/[ \t]*\(UNIVERSAL[ \t]+\)?MODEL[ \t]+\([A-Za-z_]+\)/\2/' \ |
127 |
|
|
--regex='/[ \t]*\(CONSTANT\|DEFINITION\)[ \t]+\([A-Za-z_]+\)/\2/' \ |
128 |
|
|
$(srcdir)/*.a4l $(srcdir)/*.a4c |
129 |
|
|
|
130 |
|
|
# We don't want to recurse in the models tree; otherwise we'll get old code |
131 |
|
|
# -for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
132 |
|
|
# if [ $$i != "/dev/null" ]; then \ |
133 |
|
|
# (cd $$i ; $(MAKE) $@ TAGSFILE="../$(TAGSFILE)" ETAGS="$(ETAGS)" \ |
134 |
|
|
# RULES_FILE="../$(RULES_FILE)"); \ |
135 |
|
|
# fi ; \ |
136 |
|
|
# done |
137 |
|
|
|
138 |
|
|
tags:: |
139 |
|
|
-$(CTAGS) --append --output=$(TAGSFILE) --language=none \ |
140 |
|
|
--regex='/[ \t]*\(UNIVERSAL[ \t]+\)?ATOM[ \t]+\([A-Za-z_]+\)/\2/' \ |
141 |
|
|
--regex='/[ \t]*\(UNIVERSAL[ \t]+\)?MODEL[ \t]+\([A-Za-z_]+\)/\2/' \ |
142 |
|
|
--regex='/[ \t]*\(CONSTANT\|DEFINITION\)[ \t]+\([A-Za-z_]+\)/\2/' \ |
143 |
|
|
$(srcdir)/*.a4l $(srcdir)/*.a4c |
144 |
|
|
|
145 |
|
|
# We don't want to recurse in the models tree; otherwise we'll get old code |
146 |
|
|
# -for i in $(INSTALL_SUBDIR_LIST) /dev/null ; do \ |
147 |
|
|
# if [ $$i != "/dev/null" ]; then \ |
148 |
|
|
# (cd $$i ; $(MAKE) $@ TAGSFILE="../$(TAGSFILE)" CTAGS="$(CTAGS)" \ |
149 |
|
|
# RULES_FILE="../$(RULES_FILE)"); \ |
150 |
|
|
# fi ; \ |
151 |
|
|
# done |
152 |
|
|
|
153 |
|
|
# Force emacs to treat this file as a Makefile |
154 |
|
|
# |
155 |
|
|
# Local Variables: *** |
156 |
|
|
# mode:Makefile *** |
157 |
|
|
# End: *** |