CDP Forum
NOTE: The forum is being replaced by support.icd.no

Author Message
leik
Guest

 Posted: Wed 18 Jul 9:11:21 2007    Post subject: Converting VC++ Projects to Makefile. The best option is to write the whole Makefile from scratch, since a lot of the parameters from VC++ and windows will not be of any meaning in gcc / linux. This will take some time, but the result will probably be better, and more lucid than a script generated Makefile. If you have wery large project files, it may be better to use a script and clean up the mess afterwards. This may be done by a awk-script made by José Fonseca called dsw2mak.awk Use in Windows: 1) Download and install MinGW from sourceforge.net, and install it to c:/MinGW 2) Download and install the shell emulator MSys. This file can be found by a googlesearch; "msys-1.0.9.exe", or else on sourceforge.net 3) Donwload and install the package mingw-utils from http://sourceforge.net/project/downloading.php?groupname=mingw&filename=mingw-utils-0.3.tar.gz&use_mirror=kent and untar the content into c:/MinGW 4) Copy your VC++ project folder into c:/MinGW . This is done to make it visible to the MSys-shell. 5) Start the MSys - shell, from Startmenu -> Programs -> MinGW -> MSYS -> msys. Your project can now be found in msys /mingw : cd /mingw 6) If you're using VC++ v7.0 or newer, read pkt 6a) before continuing. 7) Run the scipt gawk -f dsw2mak /mingw/proj_name/CDP_Application/CDP_Application.dsw 6a) The solution above only works on dsw, that is VC++ 6.0 project file. If you're using a newer vertion of Visual C++, you will have to convert your .sln/ .vcproj files to the older .dsw/ .dsp VC++ 6.0 project files. A guide/ tool for this is located on http://www.arstdesign.com/articles/prjconverter.html Use in Linux: Here you already have a shell, and most probably the tool awk or gawk. This means that the only thing that has to be done is to get the dsw2mak.awk script. This is found under /bin in ming-utils-0.3.tar.gz . Extract this file, and use the commando given in pkt. 7 above, only with absolute filepath. You still need the .dsw/.dsp files (VC++ 6.0 project files). See pkt. 6a above. Use wine to run prjconverter.exe.
Nils-Petter

Joined: 14 Mar 2007
Posts: 14
Location: Norway

 Posted: Mon 6 Aug 9:59:58 2007    Post subject: Using dos prompt in Windows You can also use dos prompt (Windows): 1. Install MinGW. 2. Select "run" from the start menu and type cmd. 3. Go to your project folder (with the project dsw file). 4. Type "path\to\utility\gawk -f path\to\script\dsw2mak.awk dswFileName". This will convert all project files included in the dsw file to makefiles with the extension .mak. Example: D:\CDP\CDP_Application>C:\msys\1.0\bin\gawk -f C:\msys\1.0\bin\dsw2mak.awk CDP.dsw_________________Nils Petter Eftedal Industrial Control Design AS
Nils-Petter

Joined: 14 Mar 2007
Posts: 14
Location: Norway

 Posted: Fri 21 Dec 12:33:37 2007    Post subject: New tool! We now have a new tool available that enable users to convert solution files and project files into GNU makefiles. The tool can also be used to edit existing project settings and create new makefiles from template. The MakefileWizard also provides a graphical user interface and highly configurable conversion rules that can be edited in xml. Download the MakefileWizard the below link: http://www.icd.no/download/Tools/MakefileWizard/_________________Nils Petter Eftedal Industrial Control Design AS
henriga

Joined: 30 Jul 2008
Posts: 2

Posted: Wed 30 Jul 9:33:58 2008    Post subject:

I'm using MakefileWizard with default configuration file (wizconf.xml) and I'm pleased with the result. However, I get this in my makefile:

 Code: SOURCE_FILES=    \

The "HEADER_FILES" correctly becomes a list of header files from the Visual studio project, but the list of source files disappear. I found a workaround - replace the SOURCE_FILES line with this:
 Code: DIRECTORIES = src SOURCE_FILES = $(foreach dir,$(DIRECTORIES),$(wildcard$(dir)/*.c))

This will set SOURCE_FILES to a list of *.c files in all directories specified. If you want to also include cpp-files, use this:

 Code: SOURCE_FILES = $(foreach dir,$(DIRECTORIES),$(wildcard$(dir)/*.c $(dir)/*.cpp)) If you want to add more source directories, do like this:  Code: DIRECTORIES = src1 src2 /Henrik Nils-Petter Site Admin Joined: 14 Mar 2007 Posts: 14 Location: Norway Posted: Wed 30 Jul 11:45:10 2008 Post subject: Thank you for feedback! You are absolutely right in your discovery. The MakefileWizard only supports .cpp files. Note that you must also add dependency for .c files for your fix to work:  Code: %.o: %.c$(COMPILER) $(CFLAGS)$(ILFLAGS) $(GLOBALS) -o$@ -c \$<

I'll add this in the next version of the MakefileWizard.
_________________
Nils Petter Eftedal
Industrial Control Design AS
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1

 Jump to: Select a forum CDP Developer's Forum----------------FAQ - ForumFAQ - CDPInstallation and configurationCDPC++ programmingI/O configurationLinux programmingRTOS-32 programmingWeb interface Add-ons----------------CDPSimCDPUIFree
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum