Solved

Convert Unix makefile to VC *.dsp file

Posted on 2001-07-24
18
1,161 Views
Last Modified: 2012-06-27
Hi all,

Is there any way to convert an ANSI Unix makefile to the Microsoft Visual C++ DSP file format in some automatic fashion? The actual makefile already compiles with MS's NMAKE utility, but I can't get it imported to the C++ IDE (except as a reference-file, but I want a normal project view). Any idea or a link to some utility that does this is greatly appreciated.

thanks,
Abel
0
Comment
Question by:abel
  • 9
  • 6
  • 2
  • +1
18 Comments
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Try to open the Makefile as a project, that'll 'sort of' convert it.
0
 
LVL 39

Author Comment

by:abel
Comment Utility
jkr:
Nop, the "sort of" conversion, like the one that happens when you open an old dsp file, does not work for this kind of makefiles. It doesn't convert it, it only appends the makefile file to the project as a single file with custom build settings set to NMAKE $file or something the like.

What I need is an import that make a "normal" VC dsp file of it, so that I can see the filetree, the class-view and all.
0
 
LVL 30

Accepted Solution

by:
Axter earned 150 total points
Comment Utility
Create a new Makefile project. (ctrl-N, then select Makefile from the Project tab)

When you get to the first step, change the command line field to the name of your makefile.

After you click the FINISH button, add the source files to your project.
You can do this by clicking on PROJECT on the main menu, and then click Add-To-Project, and then click FILES.

You should get a normal project view then.
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
>>I can see the filetree, the class-view and all.
If you do the above instructions I posted, you'll get the file-tree view and class-view.
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Well, I meant 'Open Workspace' and choose 'Makefile' from the 'File Type' box...
0
 
LVL 39

Author Comment

by:abel
Comment Utility
> Well, I meant 'Open Workspace' and choose 'Makefile' from the 'File Type' box...
same results...

Axter:
I tried your suggestions. All compiles perfectly well, but this is still not a converted makefile. I only execute/run the makefile with NMAKE from VC instead of having a compilable VC project that I can browse. I miss the "go to definition" functionality and the class view.
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
Did you add the source files (*.cpp, *.h) files to your project?
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
If you added the source files to your project per the above instructions, you should difinitely get the class view.
If you don't have the class view, then you haven't added the source files to your project.
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
>>You can do this by clicking on PROJECT on the main menu,
>>and then click Add-To-Project, and then click FILES.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 39

Author Comment

by:abel
Comment Utility
> If you added the source files to your project per the above instructions, you should difinitely get the class view.
> If you don't have the class view, then you haven't added the source files to your project.

I really did this (adding the files to the project). Maybe I must do something else, but I really included every file. I noted that none of the files have build options. Only the project settings have build options. Is this correct? Do I need to alter something? I still run the makefile with the NMAKE-utility. Is this correct?
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
>>Is this correct?
Yes this is correct.

>>Do I need to alter something?
No, you shouldn't.

>>I still run the makefile with the NMAKE-utility.
>>Is this correct?
That wouldn't make a difference.

Is there a posibility that you can email me the project?
My email is (david@axter.com)

I'm not sure what went wrong, but the makefile does not give you the class-view.  Adding the files to the project is what gives you the class-view.
If I could see the project, I should be able to tell what went wrong.
0
 
LVL 39

Author Comment

by:abel
Comment Utility
I can send you the makefile, but the project (cpp/h) files themselves I cannot send due to copyright rules (it's not my project, I'm hired by a company...). And even then, it contains about 100Mb source files and the whole project needs supporting files and libraries that exceed 1 Gb! That's too much for sending over the wire... :(

Is the makefile enough?

0
 
LVL 2

Expert Comment

by:Slordak
Comment Utility
With regards to "converting" a makefile into a Visual C++ DSP file, it certainly depends on what all is taking place in the makefile.  Most complex UNIX makefiles for real world products invoke a number of UNIX utilities in order to do some processing of the source code and output files.  These would include things such as awk, sed, perl, nm, m4, etc.

If one doesn't have these tools for WIN32, some of this becomes all but impossible, and most of these would have to be added as pre-build or post-build steps in the DSP file.  It can become a complicated task for anything but the most trivial makefiles.
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
>>Is the makefile enough?
Could you send me the VC++ project file(s) and the makefile?
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
If you send me the *.dsp file and the makefile, I can then compare the two.

You *.dsp file should have your source files listed.
Something like the following:
# Begin Group "Source Files"

# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File

SOURCE=.\CSocket.cpp
# End Source File
# End Group
# Begin Group "Header Files"

# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File

SOURCE=.\CSocket.h
# End Source File
# End Group
# Begin Group "Resource Files"


The above listing is from a *.dsp file I created and then added CSocket.cpp and CSocket.h to the project.
This allows me to see (via class view) a custom CSocket class that I created.
0
 
LVL 39

Author Comment

by:abel
Comment Utility
I owe you an apology. I should've tried harder... I did it once again and now I suddenly have all the classes listed in the class-view. Well, at least the ones in the files, as you said.

Thanks a lot! ;-)
0
 
LVL 39

Author Comment

by:abel
Comment Utility
Slordak:
you are right, of course, but in this case, as I said in my question (I quote: "The actual makefile already compiles with MS's NMAKE") those problems were already overcome.

Axter:
points are yours!
0
 
LVL 30

Expert Comment

by:Axter
Comment Utility
>>Thanks a lot! ;-)
Welcome.  Glad to have helped.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now