1 |
# A Global Rules file for building ASCEND, MS VC++5.0 version |
2 |
# by Mark Thomas |
3 |
# July 1997 |
4 |
# |
5 |
# $Revision: 1.2 $ |
6 |
# $Date: 1997/09/08 20:13:22 $ |
7 |
# $Author: ballan $ |
8 |
# $Source: /afs/cs.cmu.edu/project/ascend/Repository/ascend4/Makefile.Rules.vc,v $ |
9 |
# |
10 |
# |
11 |
# This file is combines the make rules required to build ASCEND into a |
12 |
# common location to make it easier to propagate changes. This file |
13 |
# expects/accepts the following variables: |
14 |
# EXECUTABLE: The name of an executable to build |
15 |
# PURIFIED_EXEC: The name of a Purified(tm) executable to build |
16 |
# QUANTIFIED_EXEC: The name of a Quantified(tm) executable to build |
17 |
# |
18 |
# EXEC_OBJS: The objects files required to build $(EXECUTABLE) |
19 |
# EXEC_SRCS: The source files that are used to build $(EXEC_OBJS) |
20 |
# EXEC_LIBS: The libraries that $(EXEC_OBJS) must be linked |
21 |
# against in order to build $(EXECUTABLE) |
22 |
# |
23 |
# |
24 |
# LIBRARY: The name of a library to build |
25 |
# |
26 |
# LIB_OBJS: The object files required to build $(LIBRARY) |
27 |
# LIB_SRCS: The source files hat are used to build $(LIB_OBJS) |
28 |
# |
29 |
# |
30 |
# DIR_SPECIFIC_DEFS: Defines (-D flags) that should be used when |
31 |
# compiling source files in the current directory |
32 |
# DIR_SPECIFIC_INCS: Includes (-I flags) that should be used when |
33 |
# compiling source files in the current directory |
34 |
# |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
ARCHIVE = $(builddir)\archive |
40 |
|
41 |
|
42 |
|
43 |
.SUFFIXES: |
44 |
.SUFFIXES: .c .f .i .obj |
45 |
.c.obj: |
46 |
$(CC) $(CC_SWITCHES) -c $< |
47 |
.c.i: |
48 |
$(CPP) $(CC_SWITCHES) $< > $@ |
49 |
.f.obj: |
50 |
$(F77) $(F77_SWITCHES) -c $< |
51 |
|
52 |
|
53 |
|
54 |
$(EXECUTABLE) _dummy1:: $(EXEC_OBJS) |
55 |
$(RM) $@ |
56 |
set LIB=$(VCTOOLS)\lib |
57 |
$(LD) $(LD_FLAGS) $(EXEC_LIBS) -out:$@ $(EXEC_OBJS) |
58 |
|
59 |
$(PURIFIED_EXEC) _dummy2:: $(EXEC_OBJS) |
60 |
$(RM) $@ |
61 |
$(PURIFY) $(PURIFY_OPTS) $(CC) -o $@ $(LD_FLAGS) \ |
62 |
$(EXEC_OBJS) $(EXEC_LIBS) |
63 |
|
64 |
$(QUANTIFIED_EXEC) _dummy3:: $(EXEC_OBJS) |
65 |
$(RM) $@ |
66 |
$(PURIFY) $(PURIFY_OPTS) $(CC) -o $@ $(LD_FLAGS) \ |
67 |
$(EXEC_OBJS) $(EXEC_LIBS) |
68 |
|
69 |
$(LIBRARY) _dummy4:: $(ARCHIVE)\$(LIBRARY) |
70 |
|
71 |
$(ARCHIVE)\$(LIBRARY) _dummy5:: $(LIB_OBJS) |
72 |
$(RM) $@ |
73 |
$(AR) -nologo -out:$@ $(LIB_OBJS) |
74 |
|
75 |
|
76 |
|
77 |
# Targets to install ASCEND. Need to be reworked. |
78 |
|
79 |
install: install-binaries install-scripts install-libraries install-man |
80 |
|
81 |
install-make-dirs: |
82 |
for i in $(INSTALL_MAKE_DIRS) /dev/null ; do \ |
83 |
if [ ! $$i = /dev/null ]; then \ |
84 |
test -d $$i || mkdir $$i ; \ |
85 |
fi ; \ |
86 |
done |
87 |
|
88 |
install-binaries: $(INSTALL_EXEC_LIST) |
89 |
|
90 |
install-scripts: $(INSTALL_SCRIPT_LIST) |
91 |
|
92 |
install-libraries: $(INSTALL_LIBRARY_LIST) |
93 |
|
94 |
install-man: $(INSTALL_MAN_LIST) |
95 |
|
96 |
$(TARGET_DIR)\$(INSTALLED_TIME): $(ASC_TK_FILES) $(MODEL_FILES) $(HELP_FILES) |
97 |
@for i in $? /dev/null ; do \ |
98 |
if [ $$i != "/dev/null" ]; then \ |
99 |
echo Installing `echo $$i | sed 's,^.*/,,'` "--> $(TARGET_DIR)"; \ |
100 |
$(INSTALL_DATA) $$i $(TARGET_DIR) ; \ |
101 |
fi ; \ |
102 |
done |
103 |
@echo 'Remove this file to force a reinstall of all files in this dir'\ |
104 |
> $@ |
105 |
|
106 |
|
107 |
|
108 |
# A target to make a backup copy of you Makefile. Useful to do before |
109 |
# you rerun configure so you don't lose all the hacks you added. |
110 |
|
111 |
save-makes:: |
112 |
-$(CP) Makefile Makefile.SAVED |
113 |
|
114 |
|
115 |
|
116 |
# Targets to remove generated files. `distclean' removes nearly |
117 |
# everything generated since you last ran `configure' |
118 |
|
119 |
clean:: |
120 |
-@for i in $(ASC_TK_SUBDIRS) $(MODEL_SUBDIRS) $(HELP_SUBDIRS) \ |
121 |
/dev/null ; do \ |
122 |
if [ $$i != "/dev/null" ]; then \ |
123 |
(cd $$i ; $(MAKE) -f Makefile.vc clean RM="$(RM)" \ |
124 |
RULES_FILE="../$(RULES_FILE)"); \ |
125 |
fi ; \ |
126 |
done |
127 |
-$(RM) $(ARCHIVE)\$(LIBRARY) $(EXECUTABLE) *.obj *.i core a.out \ |
128 |
$(PURIFIED_EXEC) $(QUANTIFIED_EXEC) y.output y.tab.c y.tab.h |
129 |
|
130 |
mostlyclean reallyclean:: |
131 |
@$(ECHO) Obsolete target. Please use make clean or make distclean. |
132 |
$(MAKE) -f Makefile.vc clean |
133 |
|
134 |
distclean:: clean |
135 |
-@for i in $(ASC_TK_SUBDIRS) $(MODEL_SUBDIRS) $(HELP_SUBDIRS) \ |
136 |
/dev/null ; do \ |
137 |
if [ $$i != "/dev/null" ]; then \ |
138 |
(cd $$i ; $(MAKE) -f Makefile.vc distclean RM="$(RM)" \ |
139 |
RULES_FILE="../$(RULES_FILE)"); \ |
140 |
fi ; \ |
141 |
done |
142 |
-$(RM) Makefile Makefile.SAVED TAGS tags *~ \#* *.bak |
143 |
|
144 |
|
145 |
|
146 |
# Targets to generate emacs style (TAGS) and vi style (tags) tables |
147 |
# for quick lookup of function definitions and Tcl procedures |
148 |
|
149 |
TAGS:: |
150 |
$(RM) $@ |
151 |
-$(ETAGS) --include=../compiler/TAGS --include=../solver/TAGS \ |
152 |
--include=../interface/TAGS --include=../packages/TAGS \ |
153 |
--include=../utilities/TAGS --include=../general/TAGS \ |
154 |
--language=c *.c *.h *.l *.y |
155 |
-$(ETAGS) --append --language=none \ |
156 |
--regex=/proc[ \t]+\([^ \t]+\)/\1/ *.tcl *.t |
157 |
|
158 |
tags:: |
159 |
$(RM) $@ |
160 |
-$(CTAGS) --defines --typedefs-and-c++ --language=c *.h *.c *.l *.y |
161 |
-$(CTAGS) --append --language=none \ |
162 |
--regex=/proc[ \t]+\([^ \t]+\)/\1/ *.tcl *.t |
163 |
|
164 |
|
165 |
|
166 |
# Targets to generate or remove dependency information. `nodepend' |
167 |
# removes dependency information, `depend' generates dependency |
168 |
# information, and `depend-nosys' generates dependency information but |
169 |
# leaves out dependencies on system header files. |
170 |
|
171 |
nodepend: $(LIB_SRCS) $(EXEC_SRCS) |
172 |
$(DEPEND_RM) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? |
173 |
|
174 |
depend-nosys depend-no-sys: $(LIB_SRCS) $(EXEC_SRCS) |
175 |
$(DEPEND_NOSYS) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? |
176 |
|
177 |
depend: $(LIB_SRCS) $(EXEC_SRCS) |
178 |
$(DEPEND) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? |