|
I can't recall which one it is but there is an option* in make to list everything as it proceeds. That may help to isolate the problem.
*I think -n will process the makefile but not execute the resulting statements
Possibly -p to list everything
|
|
|
|
|
Richard MacCutchan wrote: *I think -n will process the makefile but not execute the resulting statements
Possibly -p to list everything
correct. But you're going to want to do
make -p > make.out 2>&1 and then use an editor to view the results.
$ make -p hello.c | wc -l
1481
$
So that's ~1500 lines for a simple one liner. And then you're going to have to wade through all the rules for everything from c, c++ to lexx/yacc and fortran, etc.
|
|
|
|
|
No big deal with a modern editor to find the key parts.
|
|
|
|
|
Just took a look and it seems that the commands make will process are at or near the top of the file, and then the rules that make used follow e.g.
$ make -p hello > make.out 2>&1
$ head -20 make.out
cc hello.c -o hello
# GNU Make 4.2.1
# Built for arm-unknown-linux-gnueabihf
# Copyright (C) 1988-2016 Free Software Foundation, Inc.
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
# This is free software: you are free to change and redistribute it.
# There is NO WARRANTY, to the extent permitted by law.
# Make data base, printed on Tue Feb 4 12:02:00 2020
# Variables
# automatic
<D = $(patsubst %/,%,$(dir $<))
# automatic
?F = $(notdir $?)
# default
.SHELLFLAGS := -c
# environment
XDG_SESSION_CLASS = user
$
Trying to figure out the rules that make used to generate the commands can sometimes be challenging, though.
|
|
|
|
|
As Charles Petzold famously wrote in "Programming Windows 3.1", "No one said it would be easy".
|
|
|
|
|
If it was easy, any idiot could do it. The main problem, as I see it, is many of them think they can
|
|
|
|
|
And we know where they get their code from.
|
|
|
|
|
Hi Richard,
Thanks for the info: it helped to find the solution. I will explain what the solution is as a reply to the original message.
|
|
|
|
|
Hi All,
Based on Richard's first reply I managed to find the solution which is based on some info I found here:
How to force make to use bash as a shell on Windows/MSYS2 - Stack Overflow[^]
It is one of the results I got for this google search: temporary batch file created by make does not work msys2
The reason for that search is that Richard suggested there is an option to ensure that make's output becomes a lot more verbose. The option is -d and it produces a lot more output if you use it.
In that output I noticed that make created a temporary batch file and tried to execute it but failed.
The content of that batch file was this: mkdir -p build/./main/, exactly the error that a standard make call produced.
So: apparently make could not execute the batch files it creates itself so I googled so as to know why and found the result mentioned above.
It suggested I was using the wrong version of make to try and build my application and as it turns out that was exactly what was wrong.
The make I was using was the one that was installed with the toolchain and when you type make -v it reports:
GNU Make 3.82
Built for i686-pc-mingw32
I then used pacman -S make to install the proper make version and that one reports this:
GNU Make 4.3
Built for x86_64-pc-msys
End result: when you run things in the latest mingw64 or mingw32 shell it requires the newer make version built for msys instead of the earlier version which did work in the older version of mingw32 shell. When I use the later version of make Built for x86_64-pc-msys it works like a charm again.
|
|
|
|
|
Thanks for such a comprehensive explanation. I am sure it will be useful for others.
|
|
|
|
|
Use SCP Command to Transfer Files/Folders in Linux
|
|
|
|
|
The man page for scp has what you need to do this
cheers
|
|
|
|
|
Hi,
Not so long ago I managed to set up Cross platform development to build applications for a Raspberry PI running Raspbian from a windows 10 machine as described in this article I wrote: Toolset to Cross Compile/Remote Debug Raspberry from Windows Host[^].
What is does is build an example application ( simply "hello world" ) on the windows machine, transfer it to the raspberry PI and run/debug it using a GDB server on the Pi and a GDB client from Vscode on the windows machine.
Now I would like to try and expand that a bit to develop a GUI based application in the same way.
I have done some checking and I think that using the GTK-2.0 library is probably the way to go. On the PI I have installed that library successfully but now I would like to transfer it to the appropriate location in the msys32 directory where the cross compilation tools are located as well. The problem is that it is not entirely clear to me where all the header and library files are located on the PI. Running pkg-config --cflags --libs gtk+-2.0 does tell me what I should add as extra includes when I run the gcc build tool on the PI but it is not clear how and where I could copy the required header and library files so that the cross compilation tool on the windows machine could find them.
Any suggestions/ideas would be very much appreciated.
Edit: added "directory' to indicate that the mentioned msys32 is a directory.
|
|
|
|
|
WinForms is also supported, and may be easier to use/setup.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Thanks. I have recently done an application like that: a VB.NET application developed/built on a Windows 10 machine and then executed on the Raspberry PI using mono. It worked well but I am now investigating if there is a more native way to do it.
I have found some interesting info in a document called "An introduction to C&GUI programming" by Simon Long, one of the engineers who works for the Raspberry PI Foundation.
Unfortunately everything in it is built on the Raspberry PI itself via command line etc... and I really like to use my VScode IDE on my Windows machine .
If I don't succeed I will revert to Visual studio, C#.NET and mono on the PI but I will keep looking for a while.
|
|
|
|
|
You may want to try GtkSharp | Mono[^]; also download the MonoDevelop IDE; it allows you to "draw" UI's, like VS does for WinForms.
A quick Google implied that VS can do that natively; GTK# Platform Setup - Xamarin | Microsoft Docs[^], but never tried it. If you try it and it works, please let me know
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Have you looked at using the remote compile option for VS? That way you don't need to figure out how to get the GTK2.0 libs and headers on Windows.
If you're looking at developing GUI programs, do you know about VcXrv or Xming, which provide XWindows servers on a Windows system?
|
|
|
|
|
Thanks for the info, I didn't know of any of those. I will check out all of them.
|
|
|
|
|
Hi,
The remote development option for VScode does work very neatly. Edit/develop everything from Visual studio code on the windows 10 machine, build and test everything on the Raspberry PI. It takes a bit of doing to get it all to work nicely together but I have a working application that uses the GTK-2.0 library that is installed on the PI. Thanks for the suggestion.
|
|
|
|
|
Don't forget that you've got 4 cores on the Pi, so you might be able to improve your compile times using Properties > C/C++ > General > Max Parallel Compilation Jobs
|
|
|
|
|
I have just watched the latest episode of Michael Portillo's "Great Railway Journeys". He visited RAF Coningsby, and your name was mentioned. Something new I learned today.
|
|
|
|
|
One of the most beautiful pieces of kit ever built, I think. Second would be the LNER Class A4, which has held the speed record for steam engines at 126 MPH since 1938! Maybe I should change my name to Mallard, instead?
|
|
|
|
|
Ha ha, Portillo was waxing lyrical about the Mallard on the same program. Do you have a British connection, other than your love for these machines?
|
|
|
|
|
I have dual citizenship. Born in the UK, but we emigrated to Canada when I was only six, which was over 50 years ago, now. So, yeah, I do, bit it's somewhat tenuous. I don't really remember much about life in Britain.
|
|
|
|
|
I generally do not like when post ask " I am using / have X ..." and poster receives "advise" "why don't you use XYZ instead.."
I have been struggling using Linux version of X IDE together with "plug-in" called "Terminal communication framework" - TCF.
It is rather obscure framework , but does all the "dirty work" after the code is cross-compiled.
My app is intended to run on RPi and so far TCF works as expected.
Cheers
|
|
|
|