fixed permissions check for executable files exported on systems where 'ls' reports alternative access characters
# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).# All rights reserved.# This component and the accompanying materials are made available# under the terms of the License "Eclipse Public License v1.0"# which accompanies this distribution, and is available# at the URL "http://www.eclipse.org/legal/epl-v10.html".## Initial Contributors:# Nokia Corporation - initial contribution.## Contributors:## Description:# Gnumakefile FLM -> Knows how to run gnumakefiles# Will only work on Windows# #TMPROOT:=$(subst \,/,$(EPOCROOT))OLD_EPOCROOT:=$(patsubst %/,%,$(TMPROOT))/OLDSTYLE_EPOCROOT:=$(subst /,\,$(OLD_EPOCROOT))# Set up the correct make to be invokedMAKEVAR:=ifeq ($(USENMAKE),1)MAKEVAR:=$(NMAKE) $(NMAKEFLAGS)elseMAKEVAR:="$(SBSV1MAKE)"endif################################# FLM Parameter description ### Parameters:# EPOCROOT:=# PLATFORM:=$(VARIANTPLATFORM)# The current configuration either UREL or UDEB:# CFG:=$(VARIANTTYPE)# Relative path to EPOCROOT. (to where?):# TO_ROOT:=# The path to the top-level bld.inf.# Note: if a bld.inf file #includes another bld.inf, this variable will# always contain the directory of that top-level file. If you require# the directory of the bld.inf which actually references the makefile,# use $(EXTENSION_ROOT) instead.# TO_BLDINF:=# The project's working build directory under \epoc32\build\..# EPOCBLD:=################################ Standard Variables ### We may set the following # for the sake of gnumakefiles which# need to know them:## Path element separator./:=/## PATH environment variable separator.;:=:##### Various file and directory manipulation tools.# We are using the standard GNU coretools.# On Windows these are supplied by CYGWINRMDIR:=$(GNURMDIR)RM:=$(GNURM)ERASE:=$(GNURM)MKDIR:=$(GNUMKDIR)CP:=$(GNUCP)# Targets:# We need to hook the BLD, LIB, ..., targets in the gnumakefile into the# global phony TARGET, LIBRARY, ..., targets in the overall Makefile.## Additionally we need a specific name for each gnumakefile's targets so# that we can create dependencies between, say, the FINAL target of one# extension and the FINAL target of another. Ideally this name would be# unique but that would require the full path to be used so we compromise# and use a unique name and a portable reference that is relatively "unique".UNIQ:=$(DIRECTORY)$(EXTMAKEFILENAME)$(TO_ROOT)$(EPOCBLD)$(TO_BLDINF)$(PLATFORM)$(CFG)$(MAKEVAR)UNIQ:=$(word 1,$(shell echo $(UNIQ) | $(GNUMD5SUM)))gmake_$(notdir $(EXTMAKEFILENAME))_$(PLATFORM)_$(CFG):=$(UNIQ)CFG_uppercase:=$(call uppercase,$(CFG))RVCT22BIN:=$(RVCTBIN)RVCT22LIB:=$(RVCTLIB)RVCT22INC:=$(RVCTINC)EXTMAKEFILEPARAMETERS:= \ EPOCROOT PLATFORM TO_ROOT TO_BLDINF \ EPOCBLD CFG RMDIR RM ERASE MKDIR CP \ MAKEFILENAME DIRECTORY EXTMAKEFILENAME \ DEPENDENCIES TOOL RVCT22LIB RVCT22INC RVCT22BIN MAKEVAR# The standard gnumakefile Targets# These will be implemented in terms of double colon# rules - such that make FREEZE will cause all FREEZE # targets to be evaluated.# For each call of this FLM we also need# to create unique versions of each of these targets# so that there is something to attach# the current FLM parameters to using target-specific # variable declarations.EXTMAKETARGETS:= \ MAKMAKE \ BLD \ FREEZE \ LIB \ CLEANLIB \ RESOURCE \ CLEAN \ RELEASABLES \ FINAL# DO_NOTHING # Hook into global targets#MAKEFILE:: $(UNIQ)_MAKMAKEBITMAP:: $(UNIQ)_MAKMAKETARGET:: $(UNIQ)_BLDFREEZE:: $(UNIQ)_FREEZELIBRARY:: $(UNIQ)_LIBCLEAN:: $(UNIQ)_CLEAN $(UNIQ)_CLEANLIBRESOURCE:: $(UNIQ)_RESOURCEFINAL:: $(UNIQ)_FINALRELEASABLES:: $(UNIQ)_RELEASABLES# make sure gnumakefiles happen at the right stagesMAKMAKE_DEPS:=EXPORTRESOURCE_DEPS:=BITMAP LIB_DEPS:=RESOURCEBLD_DEPS:=LIBRARYFINAL_DEPS:=TARGETexport /export ;#################################### Global Targets #### All the global targets for the gnumakefiles# gnumakes are called as sub-makes, using make 3.79 from abld (passed through $(SBSV1MAKE)). # makefile and nmakefile are called using nmake.define callgnumake.PHONY:: $(UNIQ)_$(1)$(EPOCROOT)/epoc32/build/TEM_$(1):: $(UNIQ)_$(1)$(UNIQ)_$(1): $($(1)_DEPS) $(call startrule,extension_makefile,FORCESUCCESS) \ $(foreach V,$(EXTMAKEFILEPARAMETERS),$(V)='$($(V))') EXTMAKEFILETARGET='$(1)' \ $(if $(USENMAKE),export MAKEFLAGS="";cd "$(subst /,\,$(DIRECTORY))";,) export EPOCROOT="$(strip $(OLDSTYLE_EPOCROOT))\"; export CFG=$(CFG_uppercase); \ $(MAKEVAR) $(if $(USENMAKE),,-C "$(subst /,\,$(DIRECTORY))") -f "$(EXTMAKEFILENAME)" \ CFG=$(CFG_uppercase) EPOCBLD="$(subst /,\,$(EPOCBLD))" TO_BLDINF="$(subst /,\,$(TO_BLDINF))" PLATFORM=$(PLATFORM) $(if $(SAVESPACE),$(subst BLD,SAVESPACE,$(1)),$(1)) \ $(call endrule,extension_makefile) ifneq ($(call isoneof,$(1),RELEASABLES FINAL),) $(call startrawoutput) \ echo "$(call whatLogOpen)" ; \ $(foreach V,$(EXTMAKEFILEPARAMETERS),$(V)='$($(V))') EXTMAKEFILETARGET='RELEASABLES' \ $(if $(USENMAKE),export MAKEFLAGS="";cd "$(subst /,\,$(DIRECTORY))";,) export EPOCROOT="$(strip $(OLDSTYLE_EPOCROOT))\"; export CFG=$(CFG_uppercase); \ $(MAKEVAR) $(if $(USENMAKE),-C -S,-C "$(subst /,\,$(DIRECTORY))" --no-print-directory) -f "$(EXTMAKEFILENAME)" \ CFG=$(CFG_uppercase) EPOCBLD="$(subst /,\,$(EPOCBLD))" TO_BLDINF="$(subst /,\,$(TO_BLDINF))" PLATFORM=$(PLATFORM) RELEASABLES | \ (read -r LINE; while [ $$$$? -eq 0 ]; do \ if [[ ! $$$$LINE =~ "Nothing to be done for" ]] ; then echo "$(call whatLogItem,EM,$$$$LINE)"; fi; \ read -r LINE; done; ); \ echo "$(call whatLogClose)" \ $(call endrawoutput)WHATGNUEM:: $(UNIQ)_RELEASABLESendifendefDO_NOTHING:: $(UNIQ)_DO_NOTHING $(UNIQ)_DO_NOTHING: ;$(foreach EXTTRG,$(EXTMAKETARGETS),$(eval $(call callgnumake,$(EXTTRG))))## Do ROMFILE target in romstuff.mkeifeq ($(ROMFILE_$(call sanitise,$(EXTMAKEFILENAME))),)ROMFILE_$(call sanitise,$(EXTMAKEFILENAME)):=1ROMDIR:=$(subst $(OLD_EPOCROOT),$(OLD_EPOCROOT)epoc32/rom/,$(TO_BLDINF))define RomfileRomstuffROMFILE:: @$(MAKEVAR) --no-print-directory $(if $(USENMAKE),,-C "$(subst /,\,$(DIRECTORY))") -f "$(EXTMAKEFILENAME)" ROMFILE >> $(ROMDIR)/ARMV5TEST.IBYendef$(eval $(call RomfileRomstuff))endif