Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: How do I change the file name of a project's Makefile
Topic Summary:
Created On: 16-May-2005 23:51
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 16-May-2005 23:51
User is offline View Users Profile Print this message


Francisco Saenz

Posts: 3
Joined: 16-May-2005

I have a Rhapsody project "X" and when I generate source code the Makefile for the project defaults to "X.mak". How can I change to something else? Like "Makefile"?

Thanks,

- Francisco
Report this to a Moderator Report this to a Moderator
 17-May-2005 15:31
User is offline View Users Profile Print this message


Francisco Saenz

Posts: 3
Joined: 16-May-2005

Just to add a little more information, I'm using Rhapsody in C++ 5.0.1 (build 467818).
Report this to a Moderator Report this to a Moderator
 22-May-2005 09:24
User is offline View Users Profile Print this message


Amos Ortal

Posts: 120
Joined: 22-Jul-2004

The generated makefile name is derived from the active component name (e.g. if the component name is cmp then the makefile name is cmp<extension>. You cannot modify the pattern but you can control the extension by setting the <lang>_CG:<environment>:MakeExtension property (is the property doesn't exist the extension default to .mak)

So in order to create a makefile named "Makefile" for VxWorks in C++ you should:
- Set the component name to "Makefile"
- Set the CPP_CG:VxWorks:MakeExtension property to "" (if the property doesn't exist you can add it using COM-API/VBA or in the site.prp file).
Report this to a Moderator Report this to a Moderator
 23-May-2005 15:46
User is offline View Users Profile Print this message


Francisco Saenz

Posts: 3
Joined: 16-May-2005

Hello All -

I think I've reached a solution based on your responses. I added/modified the following two properties under CPP_CG::<Environment>:

Subject CPP_CG
Metaclass MY_OS
Property MakeFileName String "Makefile"
Property MakeExtension String "."
end
end

These changes allowed me to generate a makefile named "Makefile" without modifying anything else. I tried setting MakeExtension blank (i.e. an empty string "") but it didn't work, it was still appending ".mak" at the end.

Thanks for all your help,

- Francisco
Report this to a Moderator Report this to a Moderator
 22-Jun-2005 16:39
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

I tried your solution (thanks!) but found that the target name generated into the makefile was set the same as the makefile name. ie. the following line was generated into my makefile:

TARGET_NAME=<value of MakeFileName property>

Did you find the same?

If so, (and assuming this is not what you wanted) did you find a way around it?

best regards,
Simon

PS. I'm intending to report this to I-Logix support.

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 22-Jun-2005 23:02
User is offline View Users Profile Print this message


Tim Brockwell

Posts: 5
Joined: 22-Jun-2005

Here's another way to get what you want on a windows host.

Create a batch file, e.g. c:\rename_makefile.bat, with contents similar to this:
---------------------
@echo off
set my_app_gen_dir=C:\MyAppGenerationDir
if exist %my_app_gen_dir%\MyApp.mak goto found
goto end
:found
echo Found %my_app_gen_dir%\MyApp.mak
echo Renaming to %my_app_gen_dir%\makefile
move /Y %my_app_gen_dir%\MyApp.mak %my_app_gen_dir%\makefile
echo Done.
:end
----------------------

Then, for the component you are generating, set the CG::File::InvokePostProcessor property to "C:\rename_makefile.bat $file".

When you regenerate your code, the .mak file will be renamed "makefile".

The drawback to this solution is that the .bat file gets called for every file that is generated, but on a reasonably fast machine, the added generation time isn't even noticable.

Hope this helps.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.