Makefile : What does #VAR# do? - makefile

I'm trying to build mod_wsgi from sources.
But when I'm trying to use "make", I get the following issue :
/bin/sh: APXS#: command not found
Makefile.in:31: recipe for target 'src/server/mod_wsgi.la' failed
make: *** [src/server/mod_wsgi.la] Error 127
I checked the Makefile.in file and I line 31 is this one :
$(APXS) -c $(CPPFLAGS) $(CFLAGS) $(SRCFILES) $(LDFLAGS) $(LDLIBS)
And at the line 15 :
APXS = #APXS#
I checked and apxs is installed.
What is #APXS# supposed to do? Giving the path to apxs? (like which apxs?) Use an environment variable?
Why doesn't it work here? I'm building a docker container, could it be the problem?
Thank you for your help!

The #VAR# notation is an autoconf idiosyncrasy, together with the .in suffix in your file Makefile.in, it leads me to think that you did not ./configure your package.
What does it mean to configure my package?
The autoconf software is a tool to write ./configure scripts, meant to detect the characteristics of the system they are running on: What is the path where this program is stored? Where are these C headers? These are questions typically answered by the ./configure script. When it has gathered its answers, it exports the answers by processing a list of files – usually ending with .in like your Makefile.in – and replaces the #VAR# placeholders by the values it guessed.
How do I configure my package?
I do not know the details of your software package, but given the information you provided, you should try to run the ./configure script. Use ./configure --help to review its options. If such a script is not available, try to generate it by using the autoconf command in the toplevel directory of your package.

Related

make: f77: No such file or directory

Whilst attempting to make/compile the grafic package, I'm seeing this error after calling the make command within the grafic directory:
f77 -O2 -c grafic1.f
make: f77: No such file or directory
make: *** [grafic1.o] Error 1
I have XCode and all associated command line tools installed, what could be causing this error?
This error is make telling you that you have no binary in your path called f77. There are two things you need to look at the fix this:
Do you have a Fortran compiler installed? MacOS X/Xcode does not come pre-installed with one by default. The easiest options to install one are via third-party tools like macports or homebrew where you can install gfortran which may be a standalone package or may be part of the gcc package.
Once you have a compiler installed, your makefile needs to know about it. Without seeing the makefile this is only an assumption, but if autotools are not used the fortran compiler is usually hardcoded in a variable called FC, e.g. you might see a line
FC=f77
and you would change this to
FC=gfortran
assuming gfortran is in your path.
Once you have a Fortran compiler installed and the makefile knows about it, you should be able to execute make successfully.

Makefile.in:12: *** commands commence before first target. Stop

When I try to run "make clean" it gives me make: ** No rule to make target clean'. Stop.
So I do make -f Makefile.in clean
and it tells me Makefile.in:12: *** commands commence before first target. Stop.
I went into the Makefile.in and removed the tab on line 12 and retried
make -f Makefile.in clean
but then it gives me Makefile.in:12: *** missing separator. Stop.
Does anyone know what is going on here? I would really appreciate some help.
This was too long for a comment:
checking for Tcl library... not found checking for Tcl header... found /usr/local/include/tcl.h checking whether the Tcl system has changed... yes configure: error:
Tcl cannot be found on this system.
Eggdrop requires Tcl and the Tcl development files to compile. If you already have Tcl installed on this system, make sure you also have the development files (common package names include 'tcl-dev' and 'tcl-devel'). If I just wasn't looking in the right place for it, re-run ./configure using the --with-tcllib='/path/to/libtcl.so' and --with-tclinc='/path/to/tcl.h' options.
See doc/COMPILE-GUIDE's 'Tcl Detection and Installation' section for more information.
I am following this guide to get tcl installed correctly. http://botlending.com/docs/eggdrop/compile/19#19
Makefile.in is not a makefile. It's input to for the configure script, which will convert it into a makefile.
Please read the INSTALL or README file that came with the software for instructions, but typically you need to first run configure:
./configure
Then you can run make and/or make install:
make

Makefile error on windows

I am trying to run makefile on windows7. I have added make.exe in windows path variable and
I am trying to run "make -f makefile.txt" but it shows error
"cc -o edit main.o kbd.o command.o display.o insert.o search.o files.o utils.o
process_begin: CreateProcess(NULL, cc -o edit main.o kbd.o command.o display.o i
nsert.o search.o files.o utils.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [edit] Error"
Please help me as i am new to make concept.
It is not sufficient to just add make.exe to the path. Your problem is that cc can not be found while trying to make the target called edit. Try running the same command from an MinGW/MSYS or CygWin shell, depending on how you installed this. That will most likely give you the proper environment to use make with this makefile.
This issue is similar to copy a file using a makefile at runtime
To make it work install MinGW (mingw-get-setup.exe) which will install mingw-get.exe utility that could be used to install all needed build tools.
With C:\Mingw\bin (or whatever path selected during installation) on $PATH type in console:
$ mingw-get.exe gcc g++ msys-base
After it finishes MSYS env will be available with all necessary tools (execute C:\MinGW\msys\1.0\msys.bat to open it)
Now you can use make like in unix envs.
Mike#Mike-PC ~
$ make
make: *** No targets specified and no makefile found. Stop.
If it is not enough install mingw32-make as well with mingw-get.
For some things on windows you'll want to install coreutils. I had this issue for nordic nrf micro issues with make but it's the same error
http://gnuwin32.sourceforge.net/packages/coreutils.htm
Landed here on a re-install of windows scratching head. This was the fix as it adds a bunch of useful commands to windows. Like why did "ls" work on my old drive and not the new one... answer core-utils. Why does it build everywhere and not here -- core-utils. Hope this helps someone in another 8 years.

how to add a flag in any make file

I have a program and I want to measure it performance but using gprof.now I want to add a -pg flag in it. I have many different files makefile.am makefile.in configure
I install the program using following steps
./configure
make
make install
Now I have read somewhere that:
automake gererates Makefile.in from Makefile.am
configure generates Makefile from Makefile.in
I am totally confused and want to ask two question
In which file and where do I add -pg flag? In makefile.in or makefile.am as they both have different types of flag options?
If configure generates makefile from makefile.in and automake generates makefile.in from makefile.am then shoud'nt we be using make before ./configure? what the hierarchy?
man gcc:
-pg Generate extra code to write profile information suitable for the
analysis program gprof. You must use this option when compiling
the source files you want data about, and you must also use it when
linking.
It says it needs to be in CPPFLAGS (used for both C and C++ code) and LDFLAGS (unless non-standard variables are used). The standard way is to pass flags to configure script:
$ ./configure CPPFLAGS=-pg LDFLAGS=-pg

Header file not found when building under cygwin

I am trying to build a certain library under cygwin (OpenEXR), and I get the following error:
b44ExpLogTable.cpp:52:18: error: half.h: No such file or directory
half.h is referenced using #include <half.h>, and is actually a part of another library I successfully run make/make install on previously.
The question is -- when using #include with <>, where the preprocessor expects to find the specified file?
(I have just found it in /usr/local/include/OpenEXR, but I have no idea why preprocessor cannot).
Update: I have also found:
Makefile
ILMBASE_CXXFLAGS = -I/usr/local/include/OpenEXR
Makefile.am
INCLUDES = #ILMBASE_CXXFLAGS# \
-I$(top_builddir) \
-I$(top_srcdir)/config
This actually decreased my understanding of what the problem may be.
Update 2: So, by redefining some variables in makefile I found out that instead of $(CXXCOMPILE) make seems to run $(CXX) $(CXXFLAGS), with CXXFLAGS being just -g -O2. Ok, I have no idea how it manages to run $(CXX) $(CXXFLAGS) if this combination in not used anywhere in the makefile except in $(CXXCOMPILE) which is not run. I can add my -I to CXXFLAGS but I have a feeling that a lot more additions will be required, so I would prefer to find a root cause of the problem.
(I am not sure whether it is a Super User or Stack Overflow question, because my developer skills in C++/Linux are almost non-existent.)
Additional include directories are usually specified in CPPFLAGS. Try running ./configure CPPFLAGS=-I/usr/local/include/OpenEXR and re-running make.
You need to somehow get -I/usr/local/include/OpenEXR added to the compiler command line. That might be a simple matter of doing:
CFLAGS=-I/usr/local/include/OpenEXR make

Resources