Make.proto
author claus
Fri, 17 Feb 1995 18:20:13 +0100
changeset 13 4a4fa9e1500d
parent 11 6e014573e0c6
child 15 6cb30063ea41
permissions -rw-r--r--
*** empty log message ***

#
# $Header$
#
# -------------- no need to change anything below ----------

TOP=../..
SUBDIRS=

RCSSOURCES=*.rc patches Make.proto

#
# other definitions to use for things compiled here
#
LOCALDEFS=-DDEBUG
ST_LDFLAG=

#
# see COMMON/defines for what those XXX_LIB etc. are
#
# MINI_LIB        = libbasic, libcomp $(PRIVATELIBS)
# FUNDAMENTAL_LIB = above PLUS libview, libwidg
# DEVELOP_LIB     = above PLUS libtool
# STANDARD_LIB    = above PLUS libwidg2, libdbase
# EXTENDED_LIB    = above PLUS libwidg3

#
# this defines where the show starts
#
STARTUP_CLASS="Smalltalk"
STARTUP_SELECTOR="start"

#
# directories from which bitmap files in bitmap subdirectories are to be symlinked
# to the bitmaps subdirectory
#
BITMAPDIRS= \
	$(LIBBASIC2DIR) $(LIBVIEWDIR) $(LIBWIDGDIR) 				\
	$(LIBWIDG2DIR) $(LIBWIDG3DIR) $(LIBTOOLDIR) $(CLIENTDIR)/[A-Z]* 	\
	$(OTHERLIBDIRS)								\
	$(TOP)/fileIn $(TOP)/fileIn/* $(TOP)/libtomcat $(TOP)/goodies 		\
	$(TOP)/goodies/* $(TOP)/goodies/*/*

#
# directories from which binary files are to be symlinked 
# to the binary subdirectory
#
BINARYDIRS= \
	$(LIBBASICDIR) $(LIBBASIC2DIR) $(LIBVIEWDIR) $(LIBWIDGDIR) 		\
	$(LIBWIDG2DIR) $(LIBWIDG3DIR) $(LIBTOOLDIR) $(CLIENTDIR)/[A-Z]* 	\
	$(LIBCOMPDIR) $(OTHERLIBDIRS)						\
	$(TOP)/fileIn $(TOP)/libtomcat $(TOP)/goodies $(TOP)/goodies/*		\
	$(TOP)/goodies/*/*

#
# directories from which source files are to be symlinked 
# to the source subdirectory
#
SOURCEDIRS= \
        $(LIBBASICDIR) $(LIBBASIC2DIR) $(LIBCOMPDIR) $(LIBVIEWDIR) $(LIBWIDGDIR) \
        $(LIBWIDG2DIR) $(LIBWIDG3DIR) $(LIBTOOLDIR) $(CLIENTDIR)/[A-Z]*          \
        $(OTHERLIBDIRS)                                                          \
        $(TOP)/fileIn $(TOP)/libtomcat $(TOP)/goodies $(TOP)/goodies/*           \
        $(TOP)/goodies/*/*

#
# including your own private lib in the make process and executable:
#
# for example, if you have a libprivate directory,
# where libprivate.obj is built, and that one should be included,
# add lines as below to your configuration/.../defines file:
#    PRIVATEOBJ=$(TOP)/libprivate/libprivate.obj
#    PRIVATE_SO=$(TOP)/libprivate/libprivate.so
#    PRIVATELIBS=libprivate

# ---------------------- end additional stuff --------------------


#
# default target: create the TARGET (usually smalltalk),
#                 create subdirectories with source-links, bitmap-links and resource-links
#
all::       $(TARGET) symlinks

#
# same, force recreation of link-directories
#
allNew:     $(TARGET) newResources styles newSource newBitmaps binary include misc

#
# create symbolic links to sources, resources etc.
# normally (on an end-user system) these should go into usr/local/lib/smalltalk
#
symlinks:   resources styles newSource bitmaps binary include misc

#
# the standard smalltalk executable:
# basic classes + view & widgets + tools + persistency
# persistency needs DBLIB
#
smalltalk:  $(TARGET)

smalltalk_static:
	    $(MAKE) linkIt LIBOBJS="$(LIBOBJS) $(PERSOBJ)" EXTRA_OBJ="$(EXTRA_OBJ)"


smalltalk_shared:           
	    $(MAKE) linkIt LIBOBJS="$(LIBOBJS_SHARED) $(PERS_SO)" EXTRA_OBJ="$(EXTRA_OBJ)"

#
# a "smaller" smalltalk (does not include development classes)
#
smalltalk_exec:
	    -rm classList.stc
	    $(MAKE) classList.stc \
			      EXTRA_CLASSES="$(EXTRA_CLASSES) DebugView" \
			      EXTRA_OBJ="$(EXTRA_OBJ) $(LIBTOOLDIR)/DebugView.so" \
			      LIBLIST="$(FUNDAMENTAL_LIST)"
	    $(MAKE) smalltalk \
			      EXTRA_OBJ="$(EXTRA_OBJ) $(LIBTOOLDIR)/DebugView.so" \
			      LIBOBJS="$(FUNDAMENTAL_LIB)" \
			      LIBOBJS_SHARED="$(FUNDAMENTAL_LIB_SHARED)"

linkIt:     main.$(O) $(LIBOBJS) $(LIBRUN) $(EXTRA_LIBS) $(EXTRA_OBJ)
	    @-echo "Making classList ..."
	    $(MAKE) classList.$(O) LIBS="$(LIBOBJS)"
	    @-echo "done, linking ..."
	    $(LD) $(ST_LDFLAG) $(LDFLAGS) -o smalltalk$(EXE) \
		  $(CRT0) classList.$(O) main.$(O) \
		  $(OPTIONAL_SHARED_LIB_PATH) \
		  $(LIBOBJS) $(EXTRA_OBJ) \
		  $(LIBRUNDIR)/hidata.$(O) $(LIBRUNDIR)/$(LIBRUNTARGET) \
		  $(DBLIB) \
		  $(MATHLIB) $(EXTRA_LIBS) $(SYSLIBS) $(CRTN)

classList: classList.c
	    $(CC) $(_C) $(CFLAGS) classList.c
	    rm -f classList.c

#
# make list of classes for a standard smalltalk
# (includes basic, view & widgets and Persistency)
#
BASICLIST:   $(CLASSLISTS)
	    -cat $(CLASSLISTS) > $(CLASSLIST)

# classList.stc:  $(LIBS) $(OTHERLIBRARIES)             

classList.stc:  Makefile
	    @-rm classList.stc classList.c
	    @$(MAKE) GENERICLIST CLASSLIST=classList.stc        \
		EXTRA_CLASSES="$(EXTRA_CLASSES)"                \
		LIBLIST="$(LIBLIST)"				\
		CLASSLIBRARIES="                                \
		    $(LIBLIST)                                  \
		    $(OTHERLIBRARIES)                           \
		"                                               \
		CLASSLISTS="                                    \
		    $(EXTRACLASSLISTS)                          \
		    $(CLIENTCLASSLISTS)                         \
		"

#
# make a new source subdirectory
# the source directory consists of sym-links to all .st files we find
#
newSource:
	    -rm -rf source
	    $(MAKE) sourceLink

Source:     source

source:     
	    $(MAKE) sourceLink

#
# make a new include subdirectory and link to abbreviation file
newInclude:
	    -rm -rf include
	    $(MAKE) include

include:
	    -mkdir include
	    -(cd include; $(LNS) ../$(INCLUDE)/abbrev.stc .)
	    -if [ -f $(INCLUDE)/symbols.stc ]; then			\
	        (cd include; $(LNS) ../$(INCLUDE)/symbols.stc .);	\
	     fi
	    rm -f include/RCS

misc:       examples

examples:
	    -mkdir examples examples/3D
	    -(cd examples/3D; $(LNS) ../../$(TOP)/clients/GLdemos/*.data .)

#
# make a new binary subdirectory
# (this is only useful on systems that support dynamic loading;
#  autoloaded classes will then be loaded from machine code files
#  instead of source)
#
newBinary:
	    -rm -rf binary
	    $(MAKE) binaryLink

binary:
	    $(MAKE) binaryLink

#
# make a new bitmaps subdirectory
# (simply collect the contents of all bitmap directories)
#
newBitmaps:
	    -rm -rf bitmaps
	    $(MAKE) bitmaps

Bitmaps:    bitmaps

bitmaps:    
	    $(MAKE) bitmapLink

#
# clean out intermediate chunk
#
cleanjunk::
	    -rm -f a.out changes SymbolTable ttt main.c
	    -rm -f classList.c fclassList.c nxclassList.c basicclassList.c
	    -rm -f betaclassList.c miniList.c tinyList.c

#
# clean out all that is not needed to run smalltalk
#
clean::
	    -rm -f a.out changes SymbolTable ttt main.c
	    -rm -f classList.stc classList.c classList.o
	    -rm -f fclassList.stc fclassList.c
	    -rm -f nxclassList.stc nxclassList.c
	    -rm -f basicclassList.stc basicclassList.c
	    -rm -f betaclassList.stc betaclassList.c
	    -rm -f miniList.stc miniList.c
	    -rm -f tinyList.stc tinyList.c

#
# clean out all that can be regenerated
#
clobber::
	    -rm -rf resources source bitmaps changes include examples
	    -rm -f smalltalk minitalk tinytalk st.img
	    -rm -f main.o

#
# make a new resources subdirectory
#
newResources:
	    rm -rf resources
	    $(MAKE) resources styles

resources: 
	    -mkdir resources
	    -if [ "`echo $(LIBBASICDIR)/resources/*`" != '$(LIBBASICDIR)/resources/*' ]; then \
		(cd resources; $(LNS) ../$(LIBBASICDIR)/resources/* .);                       \
		rm -f resources/RCS;                                                          \
	    fi
	    -if [ "`echo $(LIBVIEWDIR)/resources/*`" != '$(LIBVIEWDIR)/resources/*' ]; then   \
		(cd resources; $(LNS) ../$(LIBVIEWDIR)/resources/* .);                        \
		rm -f resources/RCS;                                                          \
	    fi
	    -if [ "`echo $(LIBWIDGDIR)/resources/*`" != '$(LIBWIDGDIR)/resources/*' ]; then   \
		(cd resources; $(LNS) ../$(LIBWIDGDIR)/resources/* .);                        \
		rm -f resources/RCS;                                                          \
	    fi
	    -if [ "`echo $(LIBWIDG2DIR)/resources/*`" != '$(LIBWIDG2DIR)/resources/*' ]; then \
		(cd resources; $(LNS) ../$(LIBWIDG2DIR)/resources/* .);                       \
		rm -f resources/RCS;                                                          \
	    fi
	    -if [ "`echo $(LIBWIDG3DIR)/resources/*`" != '$(LIBWIDG3DIR)/resources/*' ]; then \
		(cd resources; $(LNS) ../$(LIBWIDG3DIR)/resources/* .);                       \
		rm -f resources/RCS;                                                          \
	    fi
	    -if [ "`echo $(LIBTOOLDIR)/resources/*`" != '$(LIBTOOLDIR)/resources/*' ]; then   \
		(cd resources; $(LNS) ../$(LIBTOOLDIR)/resources/* .);                        \
		rm -f resources/RCS;                                                          \
	    fi
	    -if [ "`echo $(TOP)/fileIn/resources/*`" != '$(TOP)/fileIn/resources/*' ]; then   \
		(cd resources; $(LNS) ../$(TOP)/fileIn/resources/* .);                        \
		rm -f resources/RCS;                                                          \
	    fi
	    -if [ "`echo $(CLIENTDIR)/*/resources/*`" != '$(CLIENTDIR)/*/resources/*' ]; then \
		(cd resources; $(LNS) ../$(CLIENTDIR)/*/resources/* .);                       \
		rm -f resources/RCS;                                                          \
	    fi

styles:
	    -(cd resources; $(LNS) ../$(LIBVIEWDIR)/styles/* .)
	    rm -f resources/RCS

$(TARGET):  $(INCLUDE)/stc.h $(INCLUDE)/stcIntern.h 

#
# installation rules
#

install:: installThis

#
# install binary only
#
binInstall::
	-mkdir $(DESTLIBDIR)
	-mkdir $(DESTBINDIR)
	 $(INSTALL) smalltalk $(DESTBINDIR)
	-strip $(DESTBINDIR)/smalltalk

#
# install all local stuff
#
# notice the [x-y]* patterns; some unixes (at&t) dont like too many arguments ...
#
installThis::
	-mkdir $(DESTLIBDIR)
	-mkdir $(DESTBINDIR)
	 $(INSTALL) smalltalk $(DESTBINDIR)
	-strip $(DESTBINDIR)/smalltalk
	-mkdir $(DESTLIBDIR)/source
	-chmod a+rx $(DESTLIBDIR)/source
	-cp source/[A-G]* $(DESTLIBDIR)/source
	-cp source/[H-P]* $(DESTLIBDIR)/source
	-cp source/[Q-Z]* $(DESTLIBDIR)/source
	-chmod a+r $(DESTLIBDIR)/source/[A-G]*
	-chmod a+r $(DESTLIBDIR)/source/[H-P]*
	-chmod a+r $(DESTLIBDIR)/source/[Q-Z]*
	-mkdir $(DESTLIBDIR)/bitmaps
	-chmod a+rx $(DESTLIBDIR)/bitmaps
	-cp bitmaps/[A-I]* $(DESTLIBDIR)/bitmaps
	-cp bitmaps/[J-Z]* $(DESTLIBDIR)/bitmaps
	-cp bitmaps/[a-i]* $(DESTLIBDIR)/bitmaps
	-cp bitmaps/[j-z]* $(DESTLIBDIR)/bitmaps
	-chmod a+r $(DESTLIBDIR)/bitmaps/[A-I]*
	-chmod a+r $(DESTLIBDIR)/bitmaps/[J-Z]*
	-chmod a+r $(DESTLIBDIR)/bitmaps/[a-i]*
	-chmod a+r $(DESTLIBDIR)/bitmaps/[j-z]*
	-chmod a+rx $(DESTLIBDIR)/resources
	-mkdir $(DESTLIBDIR)/resources
	-cp resources/* $(DESTLIBDIR)/resources
	-chmod a+r $(DESTLIBDIR)/resources/*.rs
	-cp *.rc *.stc patches $(DESTLIBDIR)
	-chmod a+r $(DESTLIBDIR)/*.rc $(DESTLIBDIR)/*.stc $(DESTLIBDIR)/patches

qinstall:: installThis