Subversion Repositories tendra.SVN

Rev

Rev 17 | Rev 27 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed


# BUILD OPTIONS
#
# These flags control which components of the release should be installed.
#
# If BUILD_UPDATE is true then the public executables and their configuration
# files will be installed (this has to be done on every target platform).
#
# If BUILD_MACHINE is true then all the other target dependent components
# will be installed (this also has to be done on every target platform).
#
# If BUILD_COMMON is true then the target independent components will be
# installed (this only has to be done once, indeed if the release is being
# built simultaneously on several platforms then the builds can conflict
# with each other, so start the quickest machine off first to install
# the complete release, and get the other machines to only install the
# target dependent sections).
#
# BUILD_OK is set to false if an error occurs.

BUILD_UPDATE=   true
BUILD_MACHINE=  true
BUILD_COMMON=   true
BUILD_OK=       true

include defs.mk

all:
        @${ECHO} "==> Starting TenDRA build..."
        make utilities
        make install-utilities
        make tools
        make install-tools
        make wrappers
        make producers
        make install-producers
        make install-startup
        make install-env
        make install-apis
        make install-libs

        @${ECHO} "==> Creating object directory and symbolic links"
        @${ECHO} "==> Object directory created, bootstrapping build"
        




















# RANDOM BITS 'N PIECES

SUBDIR=         src

#.include "Makefile.defs"

sedfile:
        @${ECHO} "# Create ${.TARGET}"
        @${ECHO} "1,\$$s%-MACH-%${OSFAM}/${BLDARCH}%g"          \
                > ${.TARGET}
        @${ECHO} "1,\$$s%-BLDARCH-%${BLDARCH}%g"                \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-OSFAM-%${OSFAM}%g"                    \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-MACHDIR-%$(MACH_BASE)%g"              \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-BINDIR-%$(MACH_BASE)/bin%g"           \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-ENVDIR-%$(MACH_BASE)/env%g"           \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-LIBDIR-%$(MACH_BASE)/lib%g"           \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-INCLDIR-%${COMMON_DIR}/include%g"     \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-STARTUPDIR-%${COMMON_DIR}/startup%g"  \
                >> ${.TARGET}
        @${ECHO} "1,\$$s%-TMPDIR-%${TMP_DIR}%g"                 \
                >> ${.TARGET}





#.if !exists(Makefile.defs)
#.BEGIN:
#       @${ECHO} "Please run 'makedefs' prior to running (b)make"
#       @${ECHO}
#       @${EXIT} 1;
#.else
#all:
#. if defined(BOOTSTRAP)
#       @${ECHO} "==> Starting TenDRA build..."
#       @${ECHO} "==> Creating object directory and symbolic links"
#       @${ECHO} "==> Object directory created, bootstrapping build"
#       @cd ${BASE_DIR} && ${MAKE} _objdirs_done=yes obj;
#. else
#.  if !exists(${.CURDIR}/obj/_obj_tree_complete)
#.   if "${_objdirs_done}" != "yes"
#       @${ECHO} "==> Starting TenDRA build..."
#       @${ECHO} "==> Creating object directory and symbolic links"
#       @cd ${BASE_DIR} && ${MAKE} _objdirs_done=yes obj;
#       @${ECHO} "Do not remove this file." > ${OBJ_DIR_INDICATOR};
#       @${ECHO} "==> Object directory created, building"
#       @${ECHO}

#_objdirs_done=yes
#.   endif
#.  endif
#. endif
#.endif


wrappers:
        rm -f ${PUBLIC_BIN}/tcc
        echo '#!/bin/sh' > ${PUBLIC_BIN}/tcc
        echo exec $(INSTALL_BINDIR)/tcc -yTENDRA_BASEDIR=$(INSTALL_DIR) -Y$(INSTALL_ENVDIR)/default \$${@+"\$$@"} >> ${PUBLIC_BIN}/tcc
        chmod +x ${PUBLIC_BIN}/tcc
        


dirs:
        mkdir -p $(INSTALL_DIR) || exit 1
        mkdir -p $(MACH_BASE)\
                $(MACH_BASE)/bin\
                $(MACH_BASE)/env\
                 $(MACH_BASE)/lib\
                 $(MACH_BASE)/lib/diag\
                 $(MACH_BASE)/lib/sys
#       mkdir -p $(MACH_WORK) || exit 1
        mkdir -p $(COMMON_DIR) || exit 1
        rm -f ${MACH_BASE}/startup.tar
        cd $(BASE_DIR)/src/lib && tar cvf ${MACH_BASE}/startup.tar startup || exit 1 
        cd ${COMMON_DIR} &&  rm -rf startup && tar xvf ${MACH_BASE}/startup.tar
        rm -f ${MACH_BASE}/startup.tar


api-depend:
        @${ECHO} "# Creating API source for ${API}"
        ${TSPEC} -I${BASE_DIR}/${APIS} -O./ -S./building ${API}

makeapi: ${APILIB}

${APILIB}: ${APIOBJS}
        @${ECHO} "# Linking ${API} API"
        ${TLD} -mc -o ${APILIB} ${APIOBJS}


b:
        @${ECHO} "==> Starting TenDRA build..."
        @${ECHO} "==> Creating object directory and symbolic links"
        @${ECHO} "==> Object directory created, bootstrapping build"
        cd $(BASE_DIR)/src/utilities/ && $(MAKE) 
        cd $(BASE_DIR)/src/tools/ && $(MAKE) 


clean:
        cd $(BASE_DIR)/src/utilities/ && $(MAKE) clean
        cd $(BASE_DIR)/src/tools/ && $(MAKE) clean
        rm -rf $(WORK_DIR)


producers:
        @cd src/producers/c && $(MAKE)
        @cd src/producers/cpp && $(MAKE)

install-producers:
        @cd src/producers/c && $(MAKE) install
        @cd src/producers/cpp && $(MAKE) install


tools:
        @cd src/tools && $(MAKE)

install-tools:
        @cd src/tools && $(MAKE) install

utilities:
        @cd src/utilities/ && $(MAKE) 

install-utilities:
        @cd src/utilities/ && $(MAKE) install



install-env:
        cd src/lib/env && $(MAKE) install

install-startup:
        cp -R $(BASE_DIR)/src/lib/startup  $(INSTALL_DIR)/lib/
        cp -R $(BASE_DIR)/src/lib/machines/$(OSFAM)/$(BLDARCH)/startup \
                $(INSTALL_DIR)/lib/machines/$(OSFAM)/$(BLDARCH)
        cp -R $(BASE_DIR)/src/lib/machines/$(OSFAM)/$(BLDARCH)/include \
                $(INSTALL_DIR)/lib/machines/$(OSFAM)/$(BLDARCH)

install-apis:
        install -d $(INSTALL_DIR)/lib/building
        install -d $(INSTALL_DIR)/lib/include
        for API in `cat $(BASE_DIR)/src/build/APIS` ; do \
                echo Installing API $${API} ... ; \
                $(TSPEC) -O$(INSTALL_DIR)/lib/include -S$(INSTALL_DIR)/lib/building -I$(BASE_DIR)/src/lib/apis -w -v $${API} ; \
                echo all done  $${TSPEC_INPUT};\
        done

install-libs:
        for API in `cat $(BASE_DIR)/src/build/APIS` ; do \
                echo Compiling lib $${API} ... ; \
                cd $(INSTALL_DIR)/lib/building/$${API}.api ;\
                if [ -f ${INSTALL_STARTUPDIR}/$${API}.h ] ; then \
                        $(MAKE) "TCC=$(TCC) -yTENDRA_BASEDIR=$(INSTALL_DIR) -Y$(INSTALL_ENVDIR)/default" TLD=$(INSTALL_BINDIR)/tld TCFLAGS=-I$(INSTALL_STARTUPDIR) ;\
                        $(MAKE) PREFIX=$(INSTALL_DIR) install ;\
                else \
                        echo Skipped ; \
                fi ;\
        done
        


libs:


                #${PUBLIC_BIN}/tspec -w -v ${API} ; \


#       cd $(BASE_DIR)/src/utilities && $(MAKE) -DBOOTSTRAP 
#       cd $(BASE_DIR)/src/tools && $(MAKE) -DBOOTSTRAP 



#       cd ${BASE_DIR}/${APIS}/${API}/ && ${.MAKE} -DBOOTSTRAP