Make.proto
author claus
Wed, 16 Aug 1995 17:38:28 +0200
changeset 25 463dd2575719
parent 24 1b6ff7a7839e
child 26 398bad70619c
permissions -rw-r--r--
.

#
# $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) $(LIBTABLEDIR) $(LIBTOOLDIR) $(CLIENTDIR)/[A-Z]*         \
	$(OTHERLIBDIRS)                                                         \
	$(TOP)/fileIn $(TOP)/fileIn/* $(TOP)/goodies           			\
	$(TOP)/goodies/* $(TOP)/goodies/*/*

#
# directories from which binary files are to be symlinked 
# to the binary subdirectory
#
BINARYDIRS= \
	$(LIBBASICDIR) $(LIBBASIC2DIR) $(LIBBASIC3DIR) $(LIBVIEWDIR) $(LIBWIDGDIR) \
	$(LIBWIDG2DIR) $(LIBWIDG3DIR) $(LIBTOOLDIR) $(CLIENTDIR)/[A-Z]*         \
	$(LIBCOMPDIR) $(LIBTABLEDIR) $(LIBPRODIR) $(LIBXTDIR) $(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) $(LIBBASIC3DIR) $(LIBCOMPDIR) $(LIBVIEWDIR) \
	$(LIBWIDGDIR) $(LIBWIDG2DIR) $(LIBWIDG3DIR) $(LIBTOOLDIR) $(CLIENTDIR)/[A-Z]* \
	$(LIBTABLEDIR) $(LIBUIDIR) $(LIBPRODIR) $(LIBXTDIR) $(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)$(TARGET_RULE_EXTENSION) symlinks

#
# same, force recreation of link-directories
#
allNew:     $(TARGET)$(TARGET_RULE_EXTENSION) newResources styles newSource newBitmaps binary newInclude 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 includeLink misc

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

smalltalk:: $(TARGET)$(TARGET_RULE_EXTENSION)

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 modulList.stc
	    @$(MAKE) modulList.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)"

$(LIBTOOLDIR)/DebugView.so:
	    (cd $(LIBTOOLDIR) ; $(MAKE) DebugView.so)

$(LIBTOOLDIR)/DebugView.o:
	    (cd $(LIBTOOLDIR) ; $(MAKE) DebugView.o)

$(LIBVIEWDIR)/XWorkstat.o:
	    (cd $(LIBVIEWDIR) ; $(MAKE) XWorkstat.o)

$(LIBVIEWDIR)/XWorkstat.so:
	    (cd $(LIBVIEWDIR) ; $(MAKE) XWorkstat.so)

$(LIBVIEWDIR)/GLXWorkstat.o:
	    (cd $(LIBVIEWDIR) ; $(MAKE) GLXWorkstat.o)

$(LIBVIEWDIR)/GLXWorkstat.so:
	    (cd $(LIBVIEWDIR) ; $(MAKE) GLXWorkstat.so)

$(LIBCOMPDIR)/ObjFLoader.o:
	    (cd $(LIBCOMPDIR) ; $(MAKE) ObjFLoader.o)

$(LIBCOMPDIR)/ObjFLoader.so:
	    (cd $(LIBCOMPDIR) ; $(MAKE) ObjFLoader.so)

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

#
# dont want this abbrev.stc be included ...
#
abbrev.stc::
	    -rm ttt*.*

collectAbbrev::
	    -rm abbrev.stc

#
# 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) includeLink

includeLink:
	    -rm ttt*.H
	    -mkdir include
	    -(cd include; $(LNS) ../$(INCLUDE)/abbrev.stc .)
	    -(cd include; $(LNS) ../$(INCLUDE)/liblist.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
	    -rm -f pers* pers2 data data2 data.boss tetris.scores

#
# 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
	    -rm -f pers pers2 data data2 data.boss tetris.scores
	    -rm -f st.img st2.img
	    -rm -f .stx*.mem

#
# clean out all that can be regenerated
#
clobber::
	    -rm -rf resources source binary 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
	    $(MAKE) resourceLink
resourceLink: 
	    -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 $(LIBTABLEDIR)/resources/*`" != '$(LIBTABLEDIR)/resources/*' ]; then \
		(cd resources; $(LNS) ../$(LIBTABLEDIR)/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:	    resources
	    -(cd resources; $(LNS) ../$(LIBVIEWDIR)/styles/* .)
	    rm -f resources/RCS

main.o::    $(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