| 1 |
# A Global Rules file for building ASCEND |
| 2 |
# by Mark Thomas |
| 3 |
# July 1997 |
| 4 |
# |
| 5 |
# $Revision: 1.8 $ |
| 6 |
# $Date: 1998/04/28 12:49:56 $ |
| 7 |
# $Author: mthomas $ |
| 8 |
# $Source: /afs/cs.cmu.edu/project/ascend/Repository/ascend4/Makefile.Rules.in,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 |
SHELL = /bin/sh |
| 38 |
@SET_MAKE@ |
| 39 |
ARCHIVE = $(builddir)/archive |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
.SUFFIXES: |
| 44 |
.SUFFIXES: .c .f .i .o .flo .rflo .ps |
| 45 |
|
| 46 |
# build object from C |
| 47 |
.c.o: |
| 48 |
$(CC) $(CC_SWITCHES) -c $< -o $@ |
| 49 |
# build C preprocessed file from C to track down errors |
| 50 |
.c.i: |
| 51 |
$(CPP) $(CC_SWITCHES) $< > $@ |
| 52 |
# build object from FORTRAN |
| 53 |
.f.o: |
| 54 |
$(F77) $(F77_SWITCHES) -c $< -o $@ |
| 55 |
|
| 56 |
# make nested C function reference listings, of dubious value. |
| 57 |
.c.flo: |
| 58 |
$(CFLOW) $(CFLFLAGS) $< $(CPRCOM) > $@ |
| 59 |
# makes reverse indexed C function listings |
| 60 |
.c.rflo: |
| 61 |
$(CFLOW) $(RCFLFLAGS) $< $(CPRCOM) > $@ |
| 62 |
# make a ps file graph of the internal references of a C file. |
| 63 |
.c.ps: |
| 64 |
$(CFLOW) $(RCFLFLAGS) $< $(CPSCOM) > $@ |
| 65 |
$(MV) $@ TMP.$@ |
| 66 |
$(DOT) $(DOTFLAGS) -o $@ TMP.$@ |
| 67 |
$(RM) TMP.$@ |
| 68 |
|
| 69 |
|
| 70 |
$(EXECUTABLE) _dummy1:: Makefile $(EXEC_OBJS) |
| 71 |
$(RM) $@ |
| 72 |
$(CC) -o $@ $(LD_FLAGS) $(EXEC_OBJS) $(EXEC_LIBS) |
| 73 |
|
| 74 |
$(PURIFIED_EXEC) _dummy2:: Makefile $(EXEC_OBJS) |
| 75 |
$(RM) $@ |
| 76 |
$(PURIFY) $(PURIFY_OPTS) $(CC) -o $@ $(LD_FLAGS) \ |
| 77 |
$(EXEC_OBJS) $(EXEC_LIBS) |
| 78 |
|
| 79 |
$(QUANTIFIED_EXEC) _dummy3:: Makefile $(EXEC_OBJS) |
| 80 |
$(RM) $@ |
| 81 |
$(QUANTIFY) $(QUANTIFY_OPTS) $(CC) -o $@ $(LD_FLAGS) \ |
| 82 |
$(EXEC_OBJS) $(EXEC_LIBS) |
| 83 |
|
| 84 |
$(LIBRARY) _dummy4:: $(ARCHIVE)/$(LIBRARY) |
| 85 |
|
| 86 |
$(ARCHIVE)/$(LIBRARY) _dummy5:: Makefile $(LIB_OBJS) |
| 87 |
$(RM) $@ |
| 88 |
$(AR) cr $@ $(LIB_OBJS) |
| 89 |
$(RANLIB) $@ |
| 90 |
|
| 91 |
# Warn when the Makefile is older than Makefile.in |
| 92 |
Makefile: $(srcdir)/Makefile.in |
| 93 |
@echo "" |
| 94 |
@echo "$(srcdir)/Makefile.in is newer than Makefile" |
| 95 |
@echo "Consider running 'configure' again or running 'make makes'" |
| 96 |
@echo "" |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
# Targets to install ASCEND. Need to be reworked. |
| 101 |
|
| 102 |
install: install-binaries install-scripts install-libraries install-man |
| 103 |
|
| 104 |
install-make-dirs: |
| 105 |
@for i in $(INSTALL_MAKE_DIRS) /dev/null ; do \ |
| 106 |
if test $$i != /dev/null -a ! -d $$i ; then \ |
| 107 |
echo Making directory $$i ; \ |
| 108 |
mkdir -p $$i ; \ |
| 109 |
fi ; \ |
| 110 |
done |
| 111 |
|
| 112 |
install-binaries:: |
| 113 |
|
| 114 |
install-scripts:: |
| 115 |
|
| 116 |
install-libraries:: |
| 117 |
|
| 118 |
install-man:: |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
# A target to make a backup copy of you Makefile. Useful to do before |
| 123 |
# you rerun configure so you don't lose all the hacks you added. |
| 124 |
|
| 125 |
save-makes:: |
| 126 |
-$(CP) Makefile Makefile.SAVED |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
# Targets to remove generated files. `distclean' removes nearly |
| 131 |
# everything generated since you last ran `configure' |
| 132 |
|
| 133 |
clean:: |
| 134 |
-$(RM) $(ARCHIVE)/$(LIBRARY) $(EXECUTABLE) *.o *.i core a.out \ |
| 135 |
$(PURIFIED_EXEC) $(QUANTIFIED_EXEC) y.output y.tab.c y.tab.h |
| 136 |
|
| 137 |
distclean:: clean |
| 138 |
-$(RM) Makefile Makefile.SAVED TAGS tags *~ \#* *.bak |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
# Targets to generate emacs style (TAGS) and vi style (tags) tables |
| 143 |
# for quick lookup of function definitions and Tcl procedures |
| 144 |
|
| 145 |
TAGS:: |
| 146 |
$(RM) $@ |
| 147 |
-$(ETAGS) --include=../compiler/TAGS --include=../solver/TAGS \ |
| 148 |
--include=../interface/TAGS --include=../packages/TAGS \ |
| 149 |
--include=../utilities/TAGS --include=../general/TAGS \ |
| 150 |
--language=c *.c *.h *.l *.y |
| 151 |
|
| 152 |
tags:: |
| 153 |
$(RM) $@ |
| 154 |
-$(CTAGS) --defines --typedefs-and-c++ --language=c *.h *.c *.l *.y |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
# Targets to generate or remove dependency information. `nodepend' |
| 159 |
# removes dependency information, `depend' generates dependency |
| 160 |
# information, and `depend-nosys' generates dependency information but |
| 161 |
# leaves out dependencies on system header files. |
| 162 |
|
| 163 |
nodepend: $(LIB_SRCS) $(EXEC_SRCS) |
| 164 |
$(DEPEND_RM) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? |
| 165 |
|
| 166 |
depend-nosys depend-no-sys: $(LIB_SRCS) $(EXEC_SRCS) |
| 167 |
$(DEPEND_NOSYS) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? |
| 168 |
|
| 169 |
depend: $(LIB_SRCS) $(EXEC_SRCS) |
| 170 |
$(DEPEND) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? |
| 171 |
|
| 172 |
|
| 173 |
# Force emacs to treat this file as a Makefile |
| 174 |
# |
| 175 |
# Local Variables: *** |
| 176 |
# mode:Makefile *** |
| 177 |
# End: *** |