Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
# -*- mode: perl; tabs: 8; indent-width: 4; show-tabs: yes; -*-## Module name : TOOLSET/KeilC51V41# Module type : Makefile system# Environment(s):## Description:# Keil C51 ( Version 4.1) toolset# A very simple toolset to support# 1) C compiliation# 2) Generation of libaries# 3) Merging of libraries## Does not support ( because its not needed yet )# a) Shared libraries# b) Executables# c) Assembler files## Version Who Date Description# DDP 04-Jan-05 Created#............................................................................################################################################################ ToolsetInit()# Runtime initialisation###############################################################################ToolsetInit();sub ToolsetInit{my $KeilVersion = "C51V41";#.. Parse arguments#foreach $_ ( @args ) {Message( "KeilC51V41: unknown option $_ -- ignored\n" );}#.. Standard.rul requirements#$s = asm;$o = o51;$a = lib;$exe = "";#.. Define environment#Init( "KeilC51V41" );ToolsetDefine( "#################################################" );ToolsetDefine( "# Compiler version" );ToolsetDefine( "#" );ToolsetDefine( "KeilC51_Version = \"$KeilVersion\"" );ToolsetDefine( "" );ToolsetDefine( "#" );ToolsetDefines( "KeilC51V41.def" );ToolsetRules ( "KeilC51V41.rul" );ToolsetRules ( "standard.rul" );## Extend the cleanup rule#ToolsetGenerate( '*.lst' );## The keil compiler cannot handle long filenames# This is a problem in many VOBS, so attempt to generate# makefiles with a relative GBE_ROOT.#$::UseRelativeRoot = 1;}################################################################################ ToolsetCC( $source, $obj, \@args )# This subroutine takes the user options and builds the rule(s)# required to compile the source file 'source' to 'obj'################################################################################sub ToolsetCC{my( $source, $obj, $pArgs ) = @_;Debug( "CC: $source -> $obj" );foreach ( @$pArgs ) {Debug( "option: $_" );if ( /--Shared$/ ) { # Building a 'shared' object$cflags = "$cflags \$(SHCFLAGS)";Debug( "CC: as shared object" );} else { # unknown optionMessage( "CC: unknown option $_ -- ignored\n" );}}MakePrint( "\n\t\$(CC)\n" );MakePrint( "\$(OBJDIR)/$i.${o}:\tCFLAGS +=$cflags\n" )if ( $cflags );}################################################################################ ToolsetCCDepend( $depend, \@sources )# This subroutine takes the user options and builds the# rule(s) required to build the dependencies for the source# files 'sources' to 'depend'.################################################################################sub ToolsetCCDepend{MakePrint( "\t\$(CCDEPEND)\n" );}################################################################################ ToolsetAR( $name, \@args, \@objs )# This subroutine takes the user options and builds the rules# required to build the library 'name'.## Arguments:# n/a## Output:# [ $(BINDIR)/name$.${a}: .... ]# $(AR)################################################################################sub ToolsetAR{my( $name, $pArgs, $pObjs ) = @_;#.. Parse arguments#foreach $_ ( @$pArgs ){Message( "AR: unknown option $_ -- ignored\n" );}#MakeEntry( "\$(LIBDIR)/$name\$(GBE_TYPE).${a}:\t", "", " \\\n\t\t", ".${o}", @$pObjs );#.. Build library rule (just append to standard rule)#MakePrint( "\n\t\$(AR)\n\n" );}################################################################################ ToolsetARMerge()# Generate the recipe to merge libraries.# The dependency list is created by the caller.################################################################################sub ToolsetARMerge{MakePrint( "\n\t\$(ARMERGE)\n\n" );}#.. Successful termination1;