makefile missing separator tab - makefile

I'm trying to 'make' BIND DNS server.
I'm using the command: make -f Makefile.in and I get the error:
Makefile.in:32: *** missing separator (did you mean TAB instead of 8 Spaces?). Stop..
I tried it both on AntiX Linux (which is based on Debian testing) and on Ubuntu.
I tried versions 9.11.2, 9.10.6 and 9.9.11 of BIND.
I'm using keyboard layout QWERTY US UTF8 (but I did not edit the Makefile.in).
On line 32 of the Makefile.in there is this:
#BIND9_MAKE_RULES#
I've never seen such lines before (I'm new to 'make').
Could this be a directive replaced by space characters and cause the problem?
I know there are several questions like this, which are downvoted or closed as off topic, but some answers would be appreciated, or probably if you could tell me where should this question be asked?

You can't use Makefile.in as a makefile. It's not a makefile. It's a template for a makefile, that must be processed first to turn it into a real makefile, which will be called Makefile (no .in).
You should read the INSTALL or README file in the source distribution to learn how to build it. I haven't tried to build BIND (in a very, very long time) but most likely it comes with a configure script that you must run first. That script will create the Makefile for you. Then you run make (without any -f ... flags).

As corrected by MadScientist:
Makefile.in is a template file used by autoconf and friends. Specifically, autoconf takes configure.in file to generate a configure script. This script then takes Makefile.in and modifies it to create Makefile. What you found was a marker for this process. You can find more information here

Related

Generate make file

I have a golang CLI program which generates a makefile to a specific project. While this works, there is an issue when the project already has a makefile. Of course I can check that in advance to avoid collusion, but how is it suggested to do it?
I'm not an expert in makefiles, but how can I create second makefile (maybe with the project name or something) that user can run via make (I guess with additional steps or info to the terminal)
You can generate it as Makefile.project and document to be run as make -f Makefile.project
You can give your Makefile whatever filename. Then make must be executed with parameter -f <your_filename> or --file=<your_filename>. See make manual on filenames.
Which version of make are you using? Some versions run special makefiles before others. For example, GNU make looks for the following files and runs the first one it finds: GNUmakefile, Makefile, makefile.
If you are using GNU make, then name your generated file GNUmakefile and add in the making any makefile already in the directory. That way, anyone running make in the directory will automatically run the generated makefike first.

Notepad++ with avr-gcc error

I want to create a run command in notepad++, that cleans/deletes the compiled files whenever I press Ctrl + M. So far I created this line of code :
cmd /k c:\WinAVR-20100110\utils\bin\make.exe make clean $(FULL_CURRENT_PATH)
It does not work and gives this warning :
No Rule To make target clean
Which technically means the parameter is wrong, however I did not find a way to correct it.
Any Suggestions
You don't want to pass make as an argument to make because then it will look for a target named make which is not defined.
Also, you would need to make sure make is running in the right directory. One way to do that is use the -C option. For example:
make -C path/to/my/dir clean
Some unsolicited tips: WinAVR is really old, see how you are using the version from 2010-01-10? I'd recommend using MSYS2 for your Bash shell environment and then installing the latest AVR 8-bit toolchain from Atmel.

How to Change the Default Command That make Executes?

By default, when running make to compile a C source code file named prog.c
make prog
the default command that executes is
cc prog.c -o prog
Sometimes I really need to include some additional flags. I know that when there are no Makefiles, make relies on some environment variables.
On Ubuntu 14.04, how to configure these variables to change the command that gets executed by default?
Step by step answers will be appreciated!
When no makefile is present (or no rule exists in that makefile) make relies on a default built-in database of rules. Run make -p to get make to spit out all the rules it knows about (in the no makefile case that will be the default ones).
When you look at that list you will find a pattern rule for building C source into object files or executables. Those rules have variables in them (like CFLAGS, LDFLAGS, etc.) that can be used to control exactly what you are trying to. That's why they are there (and are why that default command has such funny spacing, in case you ever wondered about that).

How Do I Build Lua For Windows Using MinGW and MSYS?

I have a book called Beginning Lua Programming which is suppose to go over the raw basics but it is sort of leaving me stranded. Here is an effort to condense 3 pages:
QUOTE:
The following environment variables are recommended for Windows:
UTIL_DIR=c:\program files\utility
LUA_DIR=c:\program files\lua\5.1
LUA_CPATH=?.dll;%LUA_DIR%\?.dll
LUA_PATH=?.lua;%LUA_DIR%\?.lua
The UTIL_DIR variable identifies the utility directory you created in the preceding section.
After this, there is a segment about setting the 'windows search path' for lua. Basically, it tells me to look up the output of 'doskey /?' and 'path' and figure it out myself. I have no idea what these do, how to use them, and what the difference between them is.
I'm at my wits end. A detailed explanation or a link to a detailed blog/article or youtube video is EXTREMELY appreciated!
There are a few ways to get Lua working on your machine. If you just want to a functional Lua environment in a hurry with minimal fuss then consider downloading one of the precompiled Lua binaries. The common ones being Lua for Windows and LuaBinaries.
Building Lua with Mingw isn't too difficult:
First get your desired Lua version here.
Extract the tar file containing Lua's source somewhere. For this example, I'll assume you extracted to c:\lua
If you have Msys already set up, you can run the make file from that environment. From the Msys shell, you can build lua with the follow commands:
cd /c/lua
make PLAT=mingw
make install
You should find lua.exe and luac.exe somewhere in there after the build completes. Lua should be ready for use at this point.
The regular cmd.exe shell can work too with some changes to the commands:
cd lua
mingw32-make PLAT=mingw
The make install assumes a *nix environment and so doesn't work under a normal windows cmd shell. In this case you can just manually copy the compiled files from .\lua\src to where you want or you can just run it directly from there if desired.

makefile extension

I wanted to create a makefile. So I wrote instructions in a notepad file.
But what extension should I give while saving this file?
If you run:
make
this program will look for a file named makefile in your directory, and then execute it.
If you have several makefiles, then you can execute them with the command:
make -f MyMakefile
By default, The GNU Make tries some particular names, no using any extension. You can specify file with any name to it. But if you want syntax highlighting in some editors, you can use an extension.
There is a wildcard rule for recognizing make files in Geany editor:
Make=*.mak;*.mk;GNUmakefile;makefile;Makefile;makefile.*;Makefile.*;
From the GNU Make documentation
By default, when make looks for the
makefile, it tries the following
names, in order: GNUmakefile, makefile
and Makefile. Normally you should call
your makefile either makefile or
Makefile
These will be searched for if you don't specify the makefile with the -f flag (Only GNU make will look for GNUMakefile, so give it that name only if you know you're using GNU tools)
It sounds like you're running Windows, in which case makefiles often have a .NMK suffix (because they are intended for use with NMAKE). In the civilised world though makefiles do not generally have a suffix: makefile or Makefile are the canonical file names.
If you need to distinguish one from another, and you are configuration managing the makefile, you should use project.make as the name. On the basis that most LSE's , in particular gedit, are recognising this over .mak. Upon packaging, or sign out to a dedicated folder it can be renamed to makefile, the fully qualified path being descriptive of the project. In this way you can have different versions. If your work is complex enough to be using a makefile you should not mixing multiple builds in the same folder anyway.

Resources