srctools/cmaker/makefile
changeset 1 be27ed110b50
child 598 0a541d1f13c3
equal deleted inserted replaced
0:044383f39525 1:be27ed110b50
       
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of the License "Symbian Foundation License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description:
       
    15 # cmaker makefile installation.
       
    16 #
       
    17 
       
    18 # Set perl executable if it is not set by the environment. 
       
    19 PERL ?= perl
       
    20 INSTALLDIR    = $(subst \,/,$(EPOCROOT))epoc32/tools
       
    21 INSTALLDIRSRC = $(INSTALLDIR)/cmaker
       
    22 INSTALLDIRBIN = $(INSTALLDIR)/rom
       
    23 SRCFILES = $(wildcard src/*.mk)
       
    24 TRGFILES = $(patsubst src/%.mk,$(INSTALLDIRSRC)/%.mk,$(SRCFILES))
       
    25 
       
    26 .PHONY: install clean
       
    27 
       
    28 install: $(TRGFILES) $(INSTALLDIRBIN)/mingw_make.exe $(INSTALLDIR)/cmaker.cmd ; @
       
    29 
       
    30 src/cmaker.cmd: $(INSTALLDIR)
       
    31 $(INSTALLDIR)/cmaker.cmd : src/cmaker.cmd
       
    32 	$(call copy,$<,$@)
       
    33 
       
    34 src/*.mk: $(INSTALLDIRSRC)
       
    35 $(INSTALLDIRSRC)/%.mk: src/%.mk
       
    36 	$(call copy,$<,$@)
       
    37  
       
    38 bin/mingw_make.exe :$(INSTALLDIRBIN)
       
    39 $(INSTALLDIRBIN)/mingw_make.exe: bin/mingw_make.exe
       
    40 	$(call copy,$<,$@)
       
    41 
       
    42 $(INSTALLDIR):
       
    43 	$(call makedir,$@)
       
    44 
       
    45 $(INSTALLDIRSRC):
       
    46 	$(call makedir,$@)
       
    47 
       
    48 $(INSTALLDIRBIN):
       
    49 	$(call makedir,$@)
       
    50 
       
    51 clean:
       
    52 	$(call remove,$(INSTALLDIRSRC))
       
    53 	$(call remove,$(INSTALLDIR)/cmaker.cmd)
       
    54 
       
    55 ############################################################################################	
       
    56 # Create some perl specific operations to make the install operation platform independent
       
    57 define makedir
       
    58   $(PERL) -e 'use File::Path; mkpath(q($1))'
       
    59 
       
    60 endef
       
    61 
       
    62 define copy
       
    63   $(PERL) -e 'use File::Copy; copy(q($1),q($2))'
       
    64 
       
    65 endef
       
    66 
       
    67 define remove
       
    68   $(PERL) -e 'use File::Remove qw(remove); remove \1,q($1)'
       
    69 
       
    70 endef