common/Make.proto
author Jan Vrany <jan.vrany@labware.com>
Fri, 19 Feb 2021 08:29:41 +0000
changeset 924 4d92f234f671
parent 909 993b38cb97dd
permissions -rw-r--r--
Rework and fix HGSourceCodeManager >> #revisionLogOf:...directory:module:` This commit changes the logic in two ways: 1. #newestRevision is now the newest revision in the branch that *contains* given file (not necesarily modidfes it). If there are multiple heads in that branch, pretty much random one is returned. This changes old behavior and therefore this commit updates tests. 2. If a specific single revision is requested, i.e., both from and to revisions are the same, revision log with that single revision is returned no matter whether it modifies the file or even contains that file at all. This is essentially a workaround to fix issue #305. Moreover, this commit simplifies the code a lot by delegating all the changeset searching and filtering to mercurial using revset expressions. See https://swing.fit.cvut.cz/projects/stx-jv/ticket/305#comment:3

# $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.$(C) 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.$(C) SCMAbstractPackageModel.$(H): SCMAbstractPackageModel.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractPackageWorkingCopyRegistry.$(O) SCMAbstractPackageWorkingCopyRegistry.$(C) SCMAbstractPackageWorkingCopyRegistry.$(H): SCMAbstractPackageWorkingCopyRegistry.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractRevisionInfo.$(O) SCMAbstractRevisionInfo.$(C) SCMAbstractRevisionInfo.$(H): SCMAbstractRevisionInfo.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractSourceCodeManager.$(O) SCMAbstractSourceCodeManager.$(C) SCMAbstractSourceCodeManager.$(H): SCMAbstractSourceCodeManager.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic3/AbstractSourceCodeManager.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractTask.$(O) SCMAbstractTask.$(C) SCMAbstractTask.$(H): SCMAbstractTask.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMCodeMonitor.$(O) SCMCodeMonitor.$(C) SCMCodeMonitor.$(H): SCMCodeMonitor.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMCommonPackageModelGroup.$(O) SCMCommonPackageModelGroup.$(C) SCMCommonPackageModelGroup.$(H): SCMCommonPackageModelGroup.st $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMCommonSourceCodeManagerUtilities.$(O) SCMCommonSourceCodeManagerUtilities.$(C) SCMCommonSourceCodeManagerUtilities.$(H): SCMCommonSourceCodeManagerUtilities.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic3/SourceCodeManagerUtilities.$(H) $(STCHDR)
$(OUTDIR)SCMCompatModeQuery.$(O) SCMCompatModeQuery.$(C) 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)SCMCopyrightLine.$(O) SCMCopyrightLine.$(C) SCMCopyrightLine.$(H): SCMCopyrightLine.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMCopyrightUpdater.$(O) SCMCopyrightUpdater.$(C) SCMCopyrightUpdater.$(H): SCMCopyrightUpdater.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMError.$(O) SCMError.$(C) 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)SCMMergeTool.$(O) SCMMergeTool.$(C) SCMMergeTool.$(H): SCMMergeTool.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)SCMMergeToolStartup.$(O) SCMMergeToolStartup.$(C) SCMMergeToolStartup.$(H): SCMMergeToolStartup.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/StandaloneStartup.$(H) $(STCHDR)
$(OUTDIR)SCMWarning.$(O) SCMWarning.$(C) 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.$(C) 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.$(C) 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.$(C) SCMAbstractFileoutLikeTask.$(H): SCMAbstractFileoutLikeTask.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractTask.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractPackageRevision.$(O) SCMAbstractPackageRevision.$(C) SCMAbstractPackageRevision.$(H): SCMAbstractPackageRevision.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractPackageModel.$(H) $(STCHDR)
$(OUTDIR)SCMAbstractPackageWorkingCopy.$(O) SCMAbstractPackageWorkingCopy.$(C) SCMAbstractPackageWorkingCopy.$(H): SCMAbstractPackageWorkingCopy.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libscm/common/SCMAbstractPackageModel.$(H) $(STCHDR)
$(OUTDIR)SCMPackageModelError.$(O) SCMPackageModelError.$(C) 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.$(C) 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.$(C) 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/Behavior.$(H) $(INCLUDE_TOP)/stx/libbasic/Class.$(H) $(INCLUDE_TOP)/stx/libbasic/ClassDescription.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/IdentityDictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/UserPreferences.$(H) $(INCLUDE_TOP)/stx/libbasic3/ChangeSet.$(H) $(STCHDR)

# ENDMAKEDEPEND --- do not remove this line