Determine the SDK platform version in MMP)

Source: Internet
Author: User
Determine the SDK platform version in MMP

Hot16 475 times of reading Label: mmp sdk platform judge Coastline@Devdiv.net reprinted please indicate the source
I believe that many of my friends want to differentiate the SDK platform version in MPs. Unfortunately, no solution has been found so far. Recently, when I mentioned this problem with my colleagues, I said that I could use makefile to do it. I only had some knowledge about the syntax of makefile, and I didn't want to worry about it for a while. Colleague Harry's brother is a Linux cool-man. He said he was here, and the result was coming soon. Well, it is his credit for this solution. I just sorted out the posts and shared them with you.
The following describes the principles and steps:
There is an HRH file under epoc32 \ include \ variant \ (different SDK versions may have different HRH file names), which defines the macros used by the SDK. Originally, if Symbian was thoughtful, he could put a unique macro for each SDK in this HRH, but he did not. Now we want to do this job in place of him. Once we have the only macro, we can use this macro in the matrix to distinguish the 5 version. We use makefile to check the SDK installation path. If the "s60_5th" string is contained, the SDK is regarded as the fifth version. Although this judgment logic is not 100% correct, it is accurate enough for the actual situation, I don't think any guy will get bored and change the s60_5th string. If the Fifth SDK version is used, append a macro to symbian_ OS .hrh, which can be used in MMP. This is the idea.
1. Copy the symbian_ OS .hrh file from epoc32 \ include \ variant \ of your fifth SDK to the directory of BLD. inf of the project (generally the group directory), and change it to symbian_ OS _mod.hrh to differentiate it. Edit the hosts file and add/*** modified by coastline * you can use the following macro to determine s60_5th in MMP */# ifndef s60_5th # define s60_5th # endif
2. in bld. create the determinesdkversion and MK file in the directory where INF is located. The content of the file is as follows: #===================================================== ============================================= # Name : Determinesdkversion. MK # part of: # Author: coastline # description: #===================================================== ============================================================== do_nothing: @ REM do_nothing
Makmake: do_nothing
BLD: do_nothingifeq (s60_5th, $ (findstring s60_5th, $ (epocroot ))) @ Echo ---------- symbian_ OS .hrh replaced ---------- Copy symbian_ OS _mod.hrh $ (Epocroot) \ epoc32 \ include \ variant \ symbian_ OS .hrhendif
Clean: do_nothing
Lib: do_nothing
Cleanlib: do_nothing
Resource: do_nothing
Final: do_nothing
3. Add the upper and lower lines in bld. inf: prj_matrix files Gnumakefile determinesdkversion. mk note that the two rows should be placed before the actual MMP 5.
4. you can use the s60_5th macro in the project's MMP: # ifdef s60_5thlibrary ooxx. lib # elselibrary xxoo. lib # endif: use the five and three versions of SDK to compile the SDK respectively. Is it okay? You don't have to change the SDK manually in the MPs.
5. For some clean Program You can improve the makefile and restore the HRH file in the clean branch. However, this is obviously unnecessary.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.