# A Global Rules file for building ASCEND # by Mark Thomas # July 1997 # # $Revision: 1.8 $ # $Date: 1998/04/28 12:49:56 $ # $Author: mthomas $ # $Source: /afs/cs.cmu.edu/project/ascend/Repository/ascend4/Makefile.Rules.in,v $ # # # This file is combines the make rules required to build ASCEND into a # common location to make it easier to propagate changes. This file # expects/accepts the following variables: # EXECUTABLE: The name of an executable to build # PURIFIED_EXEC: The name of a Purified(tm) executable to build # QUANTIFIED_EXEC: The name of a Quantified(tm) executable to build # # EXEC_OBJS: The objects files required to build $(EXECUTABLE) # EXEC_SRCS: The source files that are used to build $(EXEC_OBJS) # EXEC_LIBS: The libraries that $(EXEC_OBJS) must be linked # against in order to build $(EXECUTABLE) # # # LIBRARY: The name of a library to build # # LIB_OBJS: The object files required to build $(LIBRARY) # LIB_SRCS: The source files hat are used to build $(LIB_OBJS) # # # DIR_SPECIFIC_DEFS: Defines (-D flags) that should be used when # compiling source files in the current directory # DIR_SPECIFIC_INCS: Includes (-I flags) that should be used when # compiling source files in the current directory # SHELL = /bin/sh @SET_MAKE@ ARCHIVE = $(builddir)/archive .SUFFIXES: .SUFFIXES: .c .f .i .o .flo .rflo .ps # build object from C .c.o: $(CC) $(CC_SWITCHES) -c $< -o $@ # build C preprocessed file from C to track down errors .c.i: $(CPP) $(CC_SWITCHES) $< > $@ # build object from FORTRAN .f.o: $(F77) $(F77_SWITCHES) -c $< -o $@ # make nested C function reference listings, of dubious value. .c.flo: $(CFLOW) $(CFLFLAGS) $< $(CPRCOM) > $@ # makes reverse indexed C function listings .c.rflo: $(CFLOW) $(RCFLFLAGS) $< $(CPRCOM) > $@ # make a ps file graph of the internal references of a C file. .c.ps: $(CFLOW) $(RCFLFLAGS) $< $(CPSCOM) > $@ $(MV) $@ TMP.$@ $(DOT) $(DOTFLAGS) -o $@ TMP.$@ $(RM) TMP.$@ $(EXECUTABLE) _dummy1:: Makefile $(EXEC_OBJS) $(RM) $@ $(CC) -o $@ $(LD_FLAGS) $(EXEC_OBJS) $(EXEC_LIBS) $(PURIFIED_EXEC) _dummy2:: Makefile $(EXEC_OBJS) $(RM) $@ $(PURIFY) $(PURIFY_OPTS) $(CC) -o $@ $(LD_FLAGS) \ $(EXEC_OBJS) $(EXEC_LIBS) $(QUANTIFIED_EXEC) _dummy3:: Makefile $(EXEC_OBJS) $(RM) $@ $(QUANTIFY) $(QUANTIFY_OPTS) $(CC) -o $@ $(LD_FLAGS) \ $(EXEC_OBJS) $(EXEC_LIBS) $(LIBRARY) _dummy4:: $(ARCHIVE)/$(LIBRARY) $(ARCHIVE)/$(LIBRARY) _dummy5:: Makefile $(LIB_OBJS) $(RM) $@ $(AR) cr $@ $(LIB_OBJS) $(RANLIB) $@ # Warn when the Makefile is older than Makefile.in Makefile: $(srcdir)/Makefile.in @echo "" @echo "$(srcdir)/Makefile.in is newer than Makefile" @echo "Consider running 'configure' again or running 'make makes'" @echo "" # Targets to install ASCEND. Need to be reworked. install: install-binaries install-scripts install-libraries install-man install-make-dirs: @for i in $(INSTALL_MAKE_DIRS) /dev/null ; do \ if test $$i != /dev/null -a ! -d $$i ; then \ echo Making directory $$i ; \ mkdir -p $$i ; \ fi ; \ done install-binaries:: install-scripts:: install-libraries:: install-man:: # A target to make a backup copy of you Makefile. Useful to do before # you rerun configure so you don't lose all the hacks you added. save-makes:: -$(CP) Makefile Makefile.SAVED # Targets to remove generated files. `distclean' removes nearly # everything generated since you last ran `configure' clean:: -$(RM) $(ARCHIVE)/$(LIBRARY) $(EXECUTABLE) *.o *.i core a.out \ $(PURIFIED_EXEC) $(QUANTIFIED_EXEC) y.output y.tab.c y.tab.h distclean:: clean -$(RM) Makefile Makefile.SAVED TAGS tags *~ \#* *.bak # Targets to generate emacs style (TAGS) and vi style (tags) tables # for quick lookup of function definitions and Tcl procedures TAGS:: $(RM) $@ -$(ETAGS) --include=../compiler/TAGS --include=../solver/TAGS \ --include=../interface/TAGS --include=../packages/TAGS \ --include=../utilities/TAGS --include=../general/TAGS \ --language=c *.c *.h *.l *.y tags:: $(RM) $@ -$(CTAGS) --defines --typedefs-and-c++ --language=c *.h *.c *.l *.y # Targets to generate or remove dependency information. `nodepend' # removes dependency information, `depend' generates dependency # information, and `depend-nosys' generates dependency information but # leaves out dependencies on system header files. nodepend: $(LIB_SRCS) $(EXEC_SRCS) $(DEPEND_RM) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? depend-nosys depend-no-sys: $(LIB_SRCS) $(EXEC_SRCS) $(DEPEND_NOSYS) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? depend: $(LIB_SRCS) $(EXEC_SRCS) $(DEPEND) $(DEPEND_FLAGS) $(DEPEND_INCLUDES) $? # Force emacs to treat this file as a Makefile # # Local Variables: *** # mode:Makefile *** # End: ***