# ASCEND lib Directory Makefile # Makefile for building dynamically loaded binary relations and other misc # things where we assume there is no source tree available and no # Makefile.Rules or ConfigAscend. # Mark Thomas # March 18, 1997 # $Date: 1998/06/18 18:45:42 $ # $Revision: 1.10 $ # $Author: mthomas $ # $Source: /afs/cs.cmu.edu/project/ascend/Repository/ascend4/lib/Makefile.in,v $ # SHELL = /bin/sh builddir = .. srcdir = @fullpathsrcdir@/../generic/lib VPATH := @fullpathsrcdir@/../generic/lib # The next variables are the primary executables and/or libraries that # this makefile is responsible for, and the default target of this # makefile. EXECUTABLE = LIBRARY = none default: btprolog.h Makefile.bt # Defines and Includes that are specific to this directory DIR_SPECIFIC_DEFS = DIR_SPECIFIC_INCS = # The next variables list the source files (EXEC_SCRS) to compile # into the object files (EXEC_OBJS) that are linked with the # library files (EXEC_LIBS) to make EXECUTABLE EXEC_SRCS = EXEC_OBJS = EXEC_LIBS = # The next variables list the source files (LIB_SCRS) to compile # into the object files (LIB_OBJS) that are combined to make LIBRARY LIB_SRCS = LIB_OBJS = # The global makefile macros (ConfigAscend) and global rules (Makefile.Rules) # include $(builddir)/ConfigAscend include $(builddir)/Makefile.Rules # File specific rules # Copy the bintoken header file from the compiler directory btprolog.h: $(srcdir)/../compiler/btprolog.h $(CP) $(srcdir)/../compiler/btprolog.h . # Build a Makfile suitable for installing Makefile.bt: Makefile ../ConfigAscend $(RM) $@ @$(ECHO) '# Makefile for ASCEND bin-tokens' >$@ @$(ECHO) '#' >>$@ @$(ECHO) '# This makefile is generated by ASCENDs make install' >>$@ @$(ECHO) '# It is used by the ASCEND compiler to build a shared' >>$@ @$(ECHO) '# object that is loaded into ASCEND' >>$@ @$(ECHO) '' >>$@ @$(ECHO) '# default C compiler.' >>$@ @$(ECHO) 'CC = $(CC)' >>$@ @$(ECHO) '' >>$@ @$(ECHO) '# unix, at least' >>$@ @$(ECHO) 'CP = $(CP)' >>$@ @$(ECHO) '' >>$@ @$(ECHO) '# caller is assumed to pass to make on the command line' >>$@ @$(ECHO) '#-RM=/bin/rm (or some equivalent file deletion command)' >>$@ @$(ECHO) '#-BTINCLUDES=(the absolute path of this directory)' >>$@ @$(ECHO) '' >>$@ @$(ECHO) '# Flags to pass to the C compiler when compiling' >>$@ @$(ECHO) '# the components of a shared library' >>$@ @$(ECHO) 'SHLIB_CFLAGS = $(SHLIB_CFLAGS)' >>$@ @$(ECHO) '' >>$@ @$(ECHO) '# Base command to use to combine object files into' >>$@ @$(ECHO) '# a shared library' >>$@ @$(ECHO) 'SHLIB_LD = $(SHLIB_LD)' >>$@ @$(ECHO) '' >>$@ @$(ECHO) '# Dependent libraries for the linker to scan when' >>$@ @$(ECHO) '# creating a shared library' >>$@ @$(ECHO) 'SHLIB_LD_LIBS = $(SHLIB_LD_LIBS)' >>$@ @$(ECHO) '' >>$@ @$(ECHO) '# Suffix to use for the names of dynamically' >>$@ @$(ECHO) '# loadable objects' >>$@ @$(ECHO) 'SHLIB_SUFFIX = $(SHLIB_SUFFIX)' >>$@ @$(ECHO) '' >>$@ $(SED) -ne '/^###START_COPY_ME/,/^###END_COPY_ME/p' Makefile >>$@ # The following is the target to make the dynamically loadable object # and the required flags. When we ``make install'' everything # between the START_COPY_ME and END_COPY_ME lines will be put into # the generated Makefile # Do not edit the next line --- it is special ###START_COPY_ME # Flags for building routine and simple generated C code. # Generally, -O > -O2 is a bad idea because it messes with # IEEE 754 standards and we may not get the expected trap # behavior. BTCFLAGS = -O -c $(BTTARGET) _dummy_target: $(BTTARGET).c -$(RM) $(BTTARGET).o $(BTTARGET)$(SHLIB_SUFFIX) $(CC) $(BTINCLUDES) $(SHLIB_CFLAGS) $(BTCFLAGS) \ $(BTTARGET).c -o $(BTTARGET).o $(SHLIB_LD) $(SHLIB_LDFLAGS) \ -o $(BTTARGET)$(SHLIB_SUFFIX) $(BTTARGET).o ###END_COPY_ME # Do not edit the previous line --- it is special # Files to install install-binaries:: btprolog.h Makefile.bt @if test ! -d $(LIB_DIR) ; then \ echo Making directory $(LIB_DIR) ; \ mkdir -p $(LIB_DIR) ; \ fi @for i in btprolog.h Makefile.bt /dev/null ; do \ if $(CMP) -s $$i $(LIB_DIR)/$$i ; then \ echo "Skipping $$i (up to date)" ; \ elif test $$i != "/dev/null" ; then \ echo "Installing $$i --> $(LIB_DIR)" ; \ $(INSTALL_DATA) $$i $(LIB_DIR) ; \ fi ; \ done uninstall-binaries:: @for i in btprolog.h Makefile.bt /dev/null ; do \ if test -f $(LIB_DIR)/$$i ; then \ echo Removing $(LIB_DIR)/$$i ; \ $(RM) $(LIB_DIR)/$$i ; \ fi ; \ done # Files, in addition to the default, to remove when we `make clean' clean:: -$(RM) btprolog.h Makefile.bt *.so *.sl # DO NOT DELETE THIS LINE -- g++dep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. # IF YOU PUT ANYTHING HERE IT WILL GO AWAY