Compile error from gmake, but single line runs fine - gcc

I'm editing a makefile with multiple targets, using the Unity unit testing framework. Pressing the "Build" button in Code Composer Studio runs through fine until the following line
$(C_COMPILER) $(INC_DIRS) $(SRC_FILES1) -o $(TARGET1)
Also in the makefile are the following lines:
C_COMPILER=C:\MinGW\bin\mingw32-gcc.exe
UNITY_ROOT=../test/unity/
UNITY_C=$(UNITY_ROOT)unity.c
UNITY_H=$(UNITY_ROOT)unity.h
INC_DIRS=-I../include/ -I$(UNITY_ROOT)
SRC_FILES1=$(UNITY_C) ../source/ProductionCode.c ../test/TestProductionCode.c ../test/test_runners/TestProductionCode_Runner.c
TARGET_BASE1=test1
TARGET_EXTENSION=.out
TARGET1 = $(TARGET_BASE1)$(TARGET_EXTENSION)
And when building in Code Composer, this is the error that is displayed
C:\MinGW\bin\mingw32-gcc.exe -I../include/ -I../test/unity/ ../test/unity/unity.c ../source/ProductionCode.c ../test/TestProductionCode.c ../test/test_runners/TestProductionCode_Runner.c -o test1.out
gmake[1]: *** [default] Error 1
gmake[1]: Leaving directory `C:/Users/matt.harding/Documents/SubversionDirectories/pt_listen_only_can_interface/sw/ccs6_workspace/makefile_project_test1/Debug'
gmake: *** [all] Error 2
So I opened up Cygwin and tried it there to see if I could find the cause. Entering just this problem line, it ran perfectly fine and generated the target successfully! So I'm not sure what would be the problem in Code Composer...
Any ideas? Thanks!
EDIT: If I run the same makefile with gmake in cygwin, it displays the same error as in CCS. So... why is there a problem running this with gmake rather than just running the compiler from Cygwin?
EDIT: From what I can gather, it looks like a compiler incompatibility between Windows and Cygwin? If I change the compiler in the makefile to
C_COMPILER=C:\cygwin\bin\gcc.exe
There is still a problem when running the makefile from Code Composer, but running gmake all works perfectly in Cygwin!

So I found a solution to my problem.
I changed the compiler to
C_COMPILER=C:\MinGW\bin\gcc.exe
Still didn't work in Code Composer Studio (CCS)
I added C:\MinGW\bin\ to the system PATH.
Still didn't work in CCS.
I closed and reopened CCS after having added MinGW to the system PATH.
SUCCESS!
I don't fully understand why things didn't work why I expected them to, but at least we have a solution.

Related

cygwin doesn't execute make

I am very new to cygwin and recently installed it because I need to compile some fortran files. I installed all libraries (and its dependencies) I need, but when I execute make to run the makefile, nothing is happening:
user#PC1 ~
$ make
user#PC1 ~
$
No error, no nothing. When I directly execute the file contained in the makefile: same result. All files required are contained in my folder where I run make. However, the package seems to be installed just fine when I call where make or which make. I reinstalled everything multiple times, but still nothing is happening. I then tried to bind the MinGW make so I can use it in cygwin and by calling this version of make, I receive the error I'd expect:
user#PC1 ~
$ mymake
C:\mingw\bin\mingw32-make.exe: *** No targets specified and no makefile found. Stop.
Unfortunately, I need the make-package from cygwin itself to work, but I have no idea what's going on. Any hints? Calling make.exe doesn't work either.
Update: I just installed cygwin and all required packages on my laptop and there everything works as intended...no problems in runing make.
I had the same problem and managed to fix this following those steps:
Open the cygwin setup and completely uninstall make (reinstalling failed for me). If you haven't deleted the download folder yet, you can select "Install from Local Directory" to make things faster.
Once uninstalled, re-run the setup again and check make, install the dependencies if needed.
Tested with make version 4.2.1-1 on my system, and got it working again.

Error installing libmaxminddb

I am trying to install the GEolite2 database on a netbsd server. I can't get past the first make for libmaxmindb. I get the following error;
make all-recursive
Making all in src
Making all in bin
Making all in t
make: don't know how to make man/man1/*.1. Stop
make: stopped in /usr/local/maxmind/libmaxminddb-1.1.1
*** Error code 1
Stop.
make: stopped in /usr/local/maxmind/libmaxminddb-1.1.1
*** Error code 1
Stop.
make: stopped in /usr/local/maxmind/libmaxminddb-1.1.1
Hpw can I either fix this or get around it?
UPDATE:
I downloaded the tarball for 1.1.1 from github.com/maxmind/libmaxminddb/releases/download/1.1.1/….
I noticed that the man directory has no Makefile in it and from what I could tell, maybe it should.
I am using NetBSD 6.0.1 and ran the steps in the Readme.
configure - ran normally
make - failed as shown above. –
I also tried starting from a git clone - same result.
On BSD systems one should always use GNU Make with Makefiles generated by GNU Automake.
I see in README.md for the libmaxminddb repository on github.com that one is expected to run the bootstrap script after cloning the repo (which is quite normal, though more often the script is called autogen).
If you don't already have GNU Make and the GNU Autotools installed I recommend using pkgsrc to install them.

XCode and gcc errors

So, I feel like my xcode/gcc/however they are supposed to work together has been broken for a while. Trying to download various technologies (most recently redis) has always ended in sadness. When I tried to make the redis I get
-bash-3.2$ make
cd src && make all
LINK redis-server
/bin/sh: gcc-4.6: command not found
make[1]: *** [redis-server] Error 127
make: *** [all] Error 2
This is the kind of error I've been gettng forever. For reference, I'm running Mac 10.7.5, my latest xcode is 4.6 and my latest gcc is 4.2. Any ideas on how I can make this work? I'd rather not upgrade my Mac OS if possible. Thanks!
I honestly don't know if this is the right way to fix this, but this issue became so problematic for me that I was willing to try anything. I noticed that I definitely had a
/usr/bin/gcc
file. And I notice that my system couldn't find the /gcc-4.6.
So.... I just did one of these numbers
sudo cp /usr/bin/gcc /usr/bin/gcc-4.6
and voila. It works now. Now I can do it all, including essential tasks like compiling any C code. So, hopefully this helps someone out.

MinGW make fails on crlibm: 'failcom' is not recognized as an internal or external command

On Windows 7, 64-bit, I am trying to compile crlibm. My environment is a 32-bit MinGW that came with the Python-XY distribution, and the shell I'm using is bash as it comes with Git for Windows.
I have sucessfully ran ./configure without any arguments. But when I try to run make, I get the following error message:
$ env PATH=/c/MinGW32-xy/bin make
make all-recursive
make[1]: Entering directory `c:/Users/michael/crlibm-1.0beta4'
'failcom' is not recognized as an internal or external command,
operable program or batch file.
make[1]: *** [all-recursive] Error 255
make[1]: Leaving directory `c:/Users/michael/crlibm-1.0beta4'
make: *** [all] Error 2
As someone noticed in a different context, failcom seems to be a variable in the makefile, but for some reason it is interpreted as a command. When this command is invoked, it is of course not found, and the build process fails.
Unfortunately, the discussion linked above has not led to a solution that I could have used. So my question is if anyone here recognizes this problem and knows how to solve or work around it.
Best regards,
Michael
I have finally found the answer to my question on this wiki page. I cite:
A common misunderstanding is MSYS is "UNIX on Windows", MSYS by itself does not contain a compiler or a C library, therefore does not give the ability to magically port UNIX programs over to Windows nor does it provide any UNIX specific functionality like case-sensitive filenames. Users looking for such functionality should look to Cygwin or Microsoft's Interix instead.
To summarize: MSYS/MinGW is not suposed to support a configure/make workflow of the type a UNIX user is accustomed to. Installing Cygwin as suggested in the above wiki page did indeed solve my problem.

Trouble installing/compiling lua on macosx

I have been attempting to compile/install Lua on Snow Leopard. I have changed the target platform in the Makefile.std to macosx and I still get the following issue:
sudo make -f Makefile.std macosx
make[1]: *** No rule to make target 'macosx'. Stop
make: *** [macsox] Error 2
I also changed the target of the same Makefile.std file in the src directory.
Is there something I'm missing here?
I have tried "make macosx" amongst other variations...
This should be easy.
Did you download the source from lua.org? The official distribution does not contain a Makefile.std. Doing "make macosx" should just work. Get the official tarball.
Note also that there are Lua packages in MacPorts and Fink.

Resources