|
|
|
|
Re: Cross compilation (from Linux redhat to Windows) of an existing project [message #1724065 is a reply to message #1724049] |
Sat, 20 February 2016 14:35 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
I'm using Fedora which is RedHat-ish. I'm having an issue with the repository and yum/dnf so I haven't been able to install mingw64 to make my own tests. I don't have time at the moment to fix it. I will try again later.
I use my own make files as well. An all too common issue here is with CDT's automated makefile generator. Nice idea but likely a mistake considering the number of issues. The only advantage to this automated generation that I see is not having to add source files whenever a new one occurs and having to add a rule for each executable target.
How to create one is OT for this forum but, as a seed for thinking about it, adding something like below can be used to automate finding source files within the make file itself.
IGNORE=CVrun BuildPNL CompareCPT PredictPNL TestNB TestMX TrainEM
MAINPROGS=$(shell $(CWD)/FindMainProgs.pl)
MAINNAMES=$(notdir $(basename $(MAINPROGS)))
MYPROGS=$(filter-out Test% $(IGNORE), $(MAINNAMES))
MYTESTS=$(filter-out $(IGNORE),$(filter Test%, $(MAINNAMES)))
SRCFILES=$(wildcard src/*.cpp)
SRCNAMES=$(filter-out $(IGNORE),$(notdir $(basename $(SRCFILES))))
OBJFILES=$(addsuffix .o,$(addprefix obj/,$(SRCNAMES)))
I haven't bothered automating the executable target rule generation as I rarely have multiple executables within a project and it's just as easy to edit an existing rule. Someday perhaps. The MAINPROGS variable could be a start.
[Updated on: Sat, 20 February 2016 14:39] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01878 seconds