Can't name target `dev` - makefile

This is my Makefile:
catchall = echo "Available make commands: dev, rebuild" && exit 0
.DEFAULT:
#$(catchall)
error:
#$(catchall)
dev:
docker-compose -f docker-compose.dev.yml up --abort-on-container-exit
rebuild:
docker-compose -f docker-compose.dev.yml up --build --abort-on-container-exit
When I run make rebuild everything works as expected, but make dev gives this output:
make: `dev' is up to date.
If I rename the dev target to pretty much anything else the command works. Why?
Here's the output of make -v:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0

It was because I had a folder in the same directory called dev. Solution is to add .PHONY: dev to the Makefile.

Related

nano.specs not found in arm-none-eabi-gcc

I am using Ubuntu 20.04.3 LTS and I need to use arm-none-eabi-gcc version 4.8.2 ( I know it is old, but i have to use this version)
So I successfully install this library with below files:
binutils-arm-none-eabi_2.24-2ubuntu2+4_amd64.deb
gcc-arm-none-eabi_4.8.2-14ubuntu1+6_amd64.deb
libcloog-isl4_0.18.2-1_amd64.deb
libisl10_0.12.2-1_amd64.deb
libnewlib-arm-none-eabi_2.1.0-3_all.deb
libnewlib-dev_2.1.0-3_all.deb
multiarch-support_2.27-3ubuntu1_amd64.deb
libmpfr4_3.1.6-1_amd64.deb
Than I checked my gcc-arm-none-eabi version like this :
arm-none-eabi-gcc --version
arm-none-eabi-gcc (4.8.2-14ubuntu1+6) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Than I am trying to compile the source code for stm32f4 with makefile.
If I use the -specs=nano.specs in makefile I get below error:
arm-none-eabi-gcc: error: nano.specs: No such file or directory
But if I dont use -specs=nano.specs command in makefile I can compile successfuly, but I need to use -specs=nano.specs command how can I solve this problem ?

How to set up $(shell ) with GNU MCU Eclipse

I'm trying to get my work laptop build environment working on my home PC.
(Working from home for a few months, you just guessed why).
Using GNU MCU Eclipse. I've installed the same version on my home machine as I installed in late 2018 on my work machine. The project I'm working on uses an external makefile to build for an ARM (SAM4L) target. Clearly there was a step that I did way back then that I've forgotten this time around.
I have the same build tools, toolchain, and Eclipse version installed on both machines (albeit in slightly different locations). On both machines, "where make.exe" and "where sh.exe" at the windows command prompt finds the executables in the Windows Build tools.
My work machine builds successfully, but my home machine gets stuck with $(shell ... ) calls within the makefile.
The first line that gives me trouble:
DATE := $(shell date +%Y%m%d)
The console output is:
process_begin: CreateProcess(NULL, date +%Y%m%d, ...) failed.
make: Makefile:26: pipe: No error
Similar errors occur with subseqent calls to $(shell uname) e.g.:
os_type ?= $(strip $(shell uname))
ifeq ($(os_type),windows32)
os := Windows
gives the error:
process_begin: CreateProcess(NULL, uname, ...) failed.
make[1]: ../../../thirdparty/asf/sam/utils/make/Makefile.sam.in:105: pipe: No error
The only other difference is that my work machine has another installation of MinGW/msys providing a separate sh and make, but these aren't in my Windows path. Nevertheless it's possible these are being used by Eclipse, but I don't see how. I've spent most of the day trawling through the configuration on both machines (Project->properties), and I can't see a difference.
[Edit] - I Just confirmed that both installs call the Make that is in the Windows Build tools, and both are the same version. (and not the same as the other tools in the build-tools that are from a busybox build)
~/eclipse/GNU MCU Eclipse/Build Tools/2.11-20180428-1604/bin $ ./make --version
GNU Make 4.2.1
Built for x86_64-w64-mingw32
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Any guidance??
OK, Easy when you see it.
I didn't have a date or uname command in my Build tools. Because the build tools are based on BusyBox i just needed to copy busybox.exe to date.exe and to uname.exe to provide the required functions. (also needed test command). Clearly I worked this out 18 months ago. I've written a howto doc for next time :-) .
C:\...\GNU MCU Eclipse\Build Tools\2.11-20180428-1604\bin>sh -c "cp busybox.exe date.exe"
C:\...\GNU MCU Eclipse\Build Tools\2.11-20180428-1604\bin>sh -c "cp busybox.exe uname.exe"
C:\...\GNU MCU Eclipse\Build Tools\2.11-20180428-1604\bin>sh -c "cp busybox.exe test.exe"
Hopefully this helps someone in the future.

Compiling autoconf results in an incorrect version reporting

I want to update from autoconf 2.62 to 2.69.
I downloaded the source and ran the following:
./configure
make
make install
These all complete successfully.
When I run autoconf --version I get the following:
autoconf --version
autoconf (GNU Autoconf) ?K??
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David J. MacKenzie and Akim Demaille.
The problem you see here is that the version reports as ?K??.
Why could this be? My machine runs in the EBCDIC codepage and I am wondering if this could be associated. Is there a configure / make option I need to add.
This issues stops me compiling other software, as the configure scripts check the version autoconf reports and it ends up failing those checks.
-----UPDATE-------
I have run make check as requested and this is the output:
autoconf269: >make check
make check-recursive
Making check in bin
Making check in .
Making check in lib
Making check in Autom4te
Making check in m4sugar
make check-local
Making check in autoconf
make check-local
Making check in autotest
make check-local
Making check in autoscan
Making check in emacs
Making check in doc
make: Makefile: line 436: Warning -- FSUM9433 Duplicate entry [fdl.texi] in prerequisite list
Making check in tests
make check-local
cd ../lib/autotest && make autotest.m4f
`autotest.m4f' is up to date
autom4te_perllibdir='..'/lib AUTOM4TE_CFG='../lib/autom4te.cfg' ../bin/autom4te -B '..'/lib -B '..'/lib --language=autotest -I . -I . suite.at -o ./testsuite.tmp
m4:local.at:18: bad expression in eval (bad input): ((?+1+0) > (2+0)) - ((?+1+0) < (2+0))
autom4te: /workarea/tools/m4/bin/m4 failed with exit status: 1
FSUM8226 make: Error code 1
FSUM8226 make: Error code 255
FSUM8226 make: Error code 1
FSUM8226 make: Error code 255
My eyes are drawn to : m4:local.at:18: bad expression in eval (bad input): ((?+1+0) > (2+0)) - ((?+1+0) < (2+0)) -- any ideas why this may be considered a bad expression?
One possiblity: the autoconf you compiled installed into /usr/local while the preinstalled one is in /usr. /usr is first in PATH so the preinstalled one is used.
You can also check the version before running make install to ensure, that the new verson fixes your problem.

Directory change error with mingw32-make

I'm building POCO library 1.6.0 under MinGW32, environment: Windows 7 Ultimate 32-bit, shell: MSYS. Successfully executed ./configure.
$ ./configure
Configured for MinGW
Contents of config.make:
POCO_CONFIG = MinGW
POCO_BASE = /c/dev/poco
POCO_BUILD = /c/dev/poco
POCO_PREFIX = /usr/local
POCO_FLAGS =
OMIT =
export POCO_CONFIG
export POCO_BASE
export POCO_BUILD
export POCO_PREFIX
export POCO_FLAGS
After launching mingw32-make I'm getting:
$ mingw32-make --debug -w
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010 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.
Reading makefiles...
Updating goal targets....
File `poco' does not exist.
File `libexecs' does not exist.
File `Foundation-libexec' does not exist.
Must remake target `Foundation-libexec'.
Invoking recipe from Makefile:69 to update target `Foundation-libexec'.
mingw32-make: Entering directory `c:/dev/poco'
C:/app/MinGW/bin/mingw32-make -d -C /c/dev/poco/Foundation
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010 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.
mingw32-make: Entering an unknown directory
mingw32-make: *** /c/dev/poco/Foundation: No such file or directory. Stop.
mingw32-make: Leaving an unknown directory
mingw32-make: *** [Foundation-libexec] Error 2
mingw32-make: Leaving directory `c:/dev/poco'
The problem is in
mingw32-make: Entering an unknown directory
mingw32-make: *** /c/dev/poco/Foundation: No such file or directory. Stop.
because /c/dev/poco/Foundation does exist:
$ ls
CHANGELOG LICENSE VERSION build_vs110.cmd config.make
CMakeLists.txt MANIFEST XML build_vs120.cmd configure
CONTRIBUTORS Makefile build build_vs90.cmd contrib
CppUnit NEWS build_CE_vs90.cmd buildwin.cmd doc
DLLVersion.rc Net build_vcexpress2008.cmd cmake libversion
Foundation README build_vcexpress2010.cmd components patches
JSON Util build_vs100.cmd config.build
I was modifying makefile to change directory to other sub-folders, no joy. It seems like something prevents mingw32-make from changing directory. Also can confirm that
cd /c/dev/poco/Foundation
works fine.
Tried with make, result is the same:
$ make --debug -w
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010 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.
Reading makefiles...
Updating goal targets....
File `poco' does not exist.
File `libexecs' does not exist.
File `Foundation-libexec' does not exist.
Must remake target `Foundation-libexec'.
Invoking recipe from Makefile:69 to update target `Foundation-libexec'.
make: Entering directory `c:/dev/poco'
C:/app/MinGW/msys/1.0/bin/make -d -C /c/dev/poco/Foundation
GNU Make 3.82
Built for i386-pc-mingw32
Copyright (C) 2010 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: Entering an unknown directory
make: *** /c/dev/poco/Foundation: No such file or directory. Stop.
make: Leaving an unknown directory
make: *** [Foundation-libexec] Error 2
make: Leaving directory `c:/dev/poco'
There are no obvious reasons for mingw32-make to fail as path does not have spaces.
What I have missed? Any suggestions welcome.
The path /c/dev/poco/Foundation does not mean what you seem to think, in the context of mingw32-make.exe. See, mingw32-make.exe is a native Windows application, so it definitely will not understand an MSYS specific path such as /c/dev/poco/Foundation; rather, it will interpret it "as is", as c:/c/dev/poco/Foundation, (assuming your current working drive is c:), which I'm sure is not what you intended.
You do seem to be using MSYS as your shell, so why are you using mingw32-make.exe anyway? Use the make.exe that MSYS itself provides; it does understand MSYS paths.
Do note that, if you run make --version from the MSYS shell, you should see, (at this time of writing):
$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i686-pc-msys
In your updated question, you show an example of running make.exe, which clearly is not this MSYS version; it appears that you have placed an alternative version of make.exe -- perhaps even a copy of mingw32-make.exe itself, for the output is identical -- in some directory which precedes the MSYS version in your $PATH. You should delete this non-MSYS version of make.exe; the entire purpose in calling the MinGW version mingw32-make.exe is to avoid this very conflict. When you run make from the MSYS shell, you want the MSYS version, and not some mingw32-make.exe clone.

The syntax of the command is incorrect while compiling Clang with GCC-4.9.1_x64

After coming across some problems regarding cmake and gcc-4.9.1 on windows system, and spending more than 2 hours of building llvm with clang I got a really nice error that I can't seem to find information on. I've done everything according to documentation and here's the story-teller error message that make gives me:
Scanning dependencies of target LTO_exports
[ 69%] Creating export file for LTO
The syntax of the command is incorrect.
make[2]: *** [tools/lto/LTO.def] Error 1
make[1]: *** [tools/lto/CMakeFiles/LTO_exports.dir/all] Error 2
make: *** [all] Error 2
That is all to it, no other detail available at all. I've checked the LTO.def file since it references that. The file contains one single entry: "EXPORTS[CR][LF]". The LTO_exports.dir/all contains the following files:
build.make
cmake_clean.cmake
depend.internal
depend.make
DependInfo.cmake
progress.make
I haven't touched these files at all. I used the following cmake command before actually using make.
C:\LLVM_Binaries>cmake -G"MinGW Makefiles" -DCMAKE_C_COMPILER="C:/MinGW/bin/gcc.exe" -DCMAKE_CXX_COMPILER="C:/MinGW/bin/g++.exe" -DCMAKE_MAKE_PROGRAM="C:/MinGW/bin/make.exe" -DCMAKE_BUILD_TYPE=Release ..\LLVM
Also here're the details of gcc g++ and make:
gcc --version
gcc (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ --version
g++ (GCC) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
make -v
GNU Make 3.82
Built for x86_64-w64-mingw32
This program is built by Equation Solution <http://www.Equation.com>
for Windows.
Copyright (C) 2010 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.
Anyone else experienced this problem and managed to build llvm with clang on 64bit Windows operating system?
#Edit (output of make VERBOSE=1)
Scanning dependencies of target LTO_exports
make[2]: Leaving directory `C:/LLVM_Binaries'
make -f tools\lto\CMakeFiles\LTO_exports.dir\build.make tools/lto/CMakeFiles/LTO_exports.dir/build
make[2]: Entering directory `C:/LLVM_Binaries'
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_progress_report C:\LLVM_Binaries\CMakeFiles
[ 69%] Creating export file for LTO
cd /d C:\LLVM_Binaries\tools\lto && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E echo EXPORTS > LTO.def
cd /d C:\LLVM_Binaries\tools\lto && type C:/LLVM/tools/lto/lto.exports >> LTO.def
The syntax of the command is incorrect.
make[2]: *** [tools/lto/LTO.def] Error 1
make[2]: Leaving directory `C:/LLVM_Binaries'
make[1]: *** [tools/lto/CMakeFiles/LTO_exports.dir/all] Error 2
make[1]: Leaving directory `C:/LLVM_Binaries'
make: *** [all] Error 2
After digging in this issue quite deeply I've successfully built it. For anyone who might get this error while compiling llvm&clang on windows with gcc: http://reviews.llvm.org/D5476#5e5fbd1d
Of course you can avoid this problem by using the sources from their SVN instead of downloading the latest stable release from http://llvm.org/releases/download.html#3.5
Did you run the configuration file before running cmake?
sh ./configure
If that doesn't work, try using the 32 bit version of your compiler. If that works, you can build for 64-bit by compiling a GCC 32-bit cross compiler.
You could also try Cygwin - perhaps that might help. Or if you're really stuck you could go backtracking and run the problematic command from a terminal, not a makefile.

Resources