×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    226

    Header file inclusion in mmp file and .mk file

    Hi,
    Can i include a header file an mmp file and in .mk file? My purpose is to use a header file with some #defines which is gernerated by some other tool.

    Thanks,
    Jinu

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,691

    Re: Header file inclusion in mmp file and .mk file

    bld.inf and .mmp files are preprocessed, you can use the directives (#include, #ifdef, etc.) in them.
    .mk files are makefiles, you should check the related documentation about how you can refer external files in a makefile. First of all, if you check a makefile, you will see that # means comment.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: Header file inclusion in mmp file and .mk file

    wizard_hu_ already discussed the MMP file part so I'm not going to touch that.

    One way to pass external data to makefiles through the build toolchain is to use environment variables. When referencing a variable in a makefile which hasn't been defined, make implementations will check for a similarly named environment variable and substitute its value instead.

    Lauri

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    226

    Re: Header file inclusion in mmp file and .mk file

    Hi Lauri/wizard_hu_ ,
    Thanks a lot for the information. But i did not undertstand how to implement the make file related part. The header file with #defines are generated during dynamic build process and I am supposed to configure .mk files, mmp files and code based on #defines. Could you please elaborate a bit more related to make file part?

    Thanks,
    Jinu

  5. #5
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: Header file inclusion in mmp file and .mk file

    An example:
    Code:
    >copy con: Makefile
    default:
            echo $(FOO)
    ^Z
            1 file(s) copied.
    
    >make
    echo
    ECHO is off.
    
    >set FOO=foo
    
    >make
    echo foo
    foo
    If you have a tool-generated header file containing #defines, it's relatively straightforward to write e.g. a perl script that copies the #defines to environment variables, for example:

    Code:
    perl -ne "print 'set FOO_',$1,'=',$2,chr(13),chr(10) if /#define\s+(\S+)\s*(.*)/" <generated.h >generated_setenv.cmd
    generated_setenv
    (The #defines in this example are prefixed with FOO_ in the environment vars. Perl can access %ENV directly but since it is executed in a subshell, any changes made there are not seen in the parent process.)

    Lauri

Similar Threads

  1. Replies: 2
    Last Post: 2009-02-20, 15:58
  2. .mk file problem
    By Liwuje in forum Symbian
    Replies: 0
    Last Post: 2009-02-16, 11:42
  3. Replies: 1
    Last Post: 2006-07-26, 09:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×