common/Make.proto
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 08 Jan 2019 09:35:11 +0000
changeset 866 8a885a75daa9
parent 515 d460ef249979
child 903 3c6c268d7395
permissions -rw-r--r--
Issue 256: fix parsing branch name from changelog To retrieve a branch of an changeset, `stx:libscm` uses `{branch}` branch keyword and then parses it as "name list". However, according to documentation it is a single string: branch String. The name of the branch on which the changeset was committed. This obviously caused problems when branch name had spaces in it. This commit fixes the problem. One remaining thing is that `stx:libscm` technically allows a changeset to be in more than one branch which seems to be impossible in Mercurial itself. This should be investigated and fixed, eventually.

# $Header$
#
# DO NOT EDIT
# automagically generated from the projectDefinition: stx_libscm_common.
#
# Warning: once you modify this file, do not rerun
# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
#
# The Makefile as generated by this Make.proto supports the following targets:
#    make         - compile all st-files to a classLib
#    make clean   - clean all temp files
#    make clobber - clean all
#
# This file contains definitions for Unix based platforms.
# It shares common definitions with the win32-make in Make.spec.

#
# position (of this package) in directory hierarchy:
# (must point to ST/X top directory, for tools and includes)
TOP=../..
INCLUDE_TOP=$(TOP)/..

# subdirectories where targets are to be made:
SUBDIRS=


# subdirectories where Makefiles are to be made:
# (only define if different from SUBDIRS)
# ALLSUBDIRS=

REQUIRED_SUPPORT_DIRS=

# if your embedded C code requires any system includes,
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libbasic3 -I$(INCLUDE_TOP)/stx/libjava -I$(INCLUDE_TOP)/stx/libscm/mercurial -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libview -I$(INCLUDE_TOP)/stx/libview2 -I$(INCLUDE_TOP)/stx/libwidg -I$(INCLUDE_TOP)/stx/libwidg2


# if you need any additional defines for embedded C code,
# add them here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
LOCALDEFINES=

LIBNAME=libstx_libscm_common
STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=.  -varPrefix=$(LIBNAME)


# ********** OPTIONAL: MODIFY the next line ***
# additional C-libraries that should be pre-linked with the class-objects
LD_OBJ_LIBS=
LOCAL_SHARED_LIBS=


# ********** OPTIONAL: MODIFY the next line ***
# additional C targets or libraries should be added below
LOCAL_EXTRA_TARGETS=

OBJS= $(COMMON_OBJS) $(UNIX_OBJS)



all:: preMake classLibRule postMake

pre_objs::  




# Update SVN revision in package definition class
ifneq (,$(findstring .svn,$(wildcard .svn)))
.svnversion: *.st
	if [ -d .svn ]; then \
		rev=$(shell svnversion -n); \
		echo -n $$rev > .svnversion; \
	else \
		echo -n exported > .svnversion; \
	fi

stx_libscm_common.o: stx_libscm_common.st .svnversion
	@if [ -d .svn ]; then \
		rev2="$(shell printf "%-16s" $$(cat .svnversion))"; \
		echo "  [SV]  Expanding svnRevisionNo in $1.st"; \
		sed -e "s/\"\$$SVN\-Revision:\".*\"\$$\"/\"\$$SVN-Revision:\"\'$$rev2\'\"\$$\"/g" $< > .stx_libscm_common.svn.st; \
	fi
	$(MAKE) CC="$(CLASSLIB_CC)" OPT="$(OPT)" SEPINITCODE="$(SEPINITCODE)" STC="$(STC)" STFILE=.stx_libscm_common.svn $(C_RULE);
	sed -i -e "s/\".stx_libscm_common.svn.st\");/\"\stx_libscm_common.st\");/g" .stx_libscm_common.svn.c
	$(MAKE) .stx_libscm_common.svn.$(O)
	@mv .stx_libscm_common.svn.$(O) stx_libscm_common.$(O)
endif



# Enforce recompilation of package definition class if Mercurial working
# copy state changes. Together with --guessVersion it ensures that package
# definition class always contains correct binary revision string.
ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
stx_libscm_common.$(O): $(shell hg root)/.hg/dirstate
endif




# run default testsuite for this package
test: $(TOP)/goodies/builder/reports
	$(MAKE) -C $(TOP)/goodies/builder/reports -f Makefile.init
	$(TOP)/goodies/builder/reports/report-runner.sh -D . -r Builder::TestReport -p $(PACKAGE)



# add more install actions here
install::

# add more install actions for aux-files (resources) here
installAux::

# add more preMake actions here
preMake::

# add more postMake actions here
postMake:: cleanjunk

# build all mandatory prerequisite packages (containing superclasses) for this package
prereq:
	cd ../../libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
	cd ../../libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
	cd ../../libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
	cd ../../libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
	cd ../../libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"



# build all packages containing referenced classes for this package
# they are not needed to compile the package (but later, to load it)
references:


cleanjunk::
	-rm -f *.s *.s2

clean::
	-rm -f *.o *.H

clobber:: clean
	-rm -f *.so *.dll


# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
$(OUTDIR)SCMAbstractDialog.$(O) SCMAbstractDialog.$(H): SCMAbstractDialog.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractPackageModel.$(O) SCMAbstractPackageModel.$(H): SCMAbstractPackageModel.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractPackageWorkingCopyRegistry.$(O) SCMAbstractPackageWorkingCopyRegistry.$(H): SCMAbstractPackageWorkingCopyRegistry.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractRevisionInfo.$(O) SCMAbstractRevisionInfo.$(H): SCMAbstractRevisionInfo.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractSourceCodeManager.$(O) SCMAbstractSourceCodeManager.$(H): SCMAbstractSourceCodeManager.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic3/AbstractSourceCodeManager.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractTask.$(O) SCMAbstractTask.$(H): SCMAbstractTask.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMCodeMonitor.$(O) SCMCodeMonitor.$(H): SCMCodeMonitor.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMCommonPackageModelGroup.$(O) SCMCommonPackageModelGroup.$(H): SCMCommonPackageModelGroup.st $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMCommonSourceCodeManagerUtilities.$(O) SCMCommonSourceCodeManagerUtilities.$(H): SCMCommonSourceCodeManagerUtilities.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic3/SourceCodeManagerUtilities.$(H) $(STCHDR)
$(OUTDIR)SCMCompatModeQuery.$(O) SCMCompatModeQuery.$(H): SCMCompatModeQuery.st $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Query.$(H) $(STCHDR)
$(OUTDIR)SCMError.$(O) SCMError.$(H): SCMError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMWarning.$(O) SCMWarning.$(H): SCMWarning.st $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)stx_libscm_common.$(O) stx_libscm_common.$(H): stx_libscm_common.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractCommitDialog.$(O) SCMAbstractCommitDialog.$(H): SCMAbstractCommitDialog.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractDialog.$(H) $(INCLUDE_TOP)/stx/libview2/ApplicationModel.$(H) $(INCLUDE_TOP)/stx/libview2/Model.$(H) $(INCLUDE_TOP)/stx/libview2/SimpleDialog.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractFileoutLikeTask.$(O) SCMAbstractFileoutLikeTask.$(H): SCMAbstractFileoutLikeTask.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractTask.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractPackageRevision.$(O) SCMAbstractPackageRevision.$(H): SCMAbstractPackageRevision.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractPackageModel.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractPackageWorkingCopy.$(O) SCMAbstractPackageWorkingCopy.$(H): SCMAbstractPackageWorkingCopy.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractPackageModel.$(H) $(STCHDR)
$(OUTDIR)SCMPackageModelError.$(O) SCMPackageModelError.$(H): SCMPackageModelError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMError.$(H) $(STCHDR)
$(OUTDIR)SCMPackageModelWarning.$(O) SCMPackageModelWarning.$(H): SCMPackageModelWarning.st $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMWarning.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractCommitTask.$(O) SCMAbstractCommitTask.$(H): SCMAbstractCommitTask.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractFileoutLikeTask.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractTask.$(H) $(STCHDR)
$(OUTDIR)extensions.$(O): extensions.st $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic3/ChangeSet.$(H) $(STCHDR)

# ENDMAKEDEPEND --- do not remove this line