debugging - How to find error line in eval of multi-line variable definition

Suppose I have the following Makefile with an intentional error in line 4:define TEMPLATEall:this line contains some errorsendef$(eval $(call TEMPLATE))When I run make I get this:$ make-3.81Makefile:7: *** missing separator. Stop.$Make is telling me that there is an error in line 7, which is technically correct because the TEMPLATE variable is expanded on line 7. But this is not tremendously useful. In order to quickly debug this sort of thing it would be much more handy if make could somehow point me directly to the error on line 4. Is the...Read more

Linux 'make' command fails after installing ruby and gems for biopieces

We wanted to try the biopieces tools, which require certain dependencies, such as ruby and perl, a.o.After running the installers, and consequently installing some ruby gems, we were not able to run our regular linux 'make' command anymore:~$ make/var/lib/gems/1.9.1/gems/make-0.3.1/bin/make:1:in `top (required)>': uninitialized constant ELF (NameError) from /usr/local/bin/make:23:in `load' from /usr/local/bin/make:23:in `<main>'If we specify the root directory /usr/bin/make, it does work.For now, we are not using biopiece...Read more

Как перекрыть опцию gcc в make?

Проект содержит несколько make-файлов. Один из включаемых make-файлов устанавливает опцию gcc std99. И это правильно. Но нужно один из файлов собрать без этой опции. Как эту опцию отменить?Добавление.Во включаемом make-файле определяется команда:define build$(CC) \ -std99 \ ... \ -o $@endefа во включаещем make-файле эта команда используется:$(MODULE): $(OBJECTS) $(build)...Read more

Is it useful to write a clean make target nowadays?

Make comes from a time when version control was fairly immature. I understand the need for a streamlined way to clean the workspace back then.Nowadays any decent version control tool can clean the unversioned files in the workspace. Files which don't need cleaning (cache, downloads, etc.) can be excluded. It is also fast and easy to clone the entire workspace again if required.I can think of reasons why not to write a clean target: it increases the size of the codebase, it might contain bugs, etc. I would like to know if there are any good reas...Read more

parallelism - Forcing GNU make to run commands in order

With the following Makefile, GNU make runs the two commands in parallel. Since the first one takes time to finish, rm *.log is run before the log file is created, and fails.dummy.pdf: dummy.tex tex dummy.tex &> /dev/null; rm *.logThe file dummy.tex one line: \bye (a short empty file for TeX). Replacing tex dummy.tex by any other command shows the same behaviour. Removing &> /dev/null would of course solve the problem, but it is not a very good option in my case, since the Makefile is provided by a third party.Is it possible ...Read more

make - Cannot find libgmp when compiling GCC 4.5.2

I'm attempting to compile GCC 4.5.2 as part of the Linux from Scratch book ( My configure is as follows:./configure \ --target=$LFS_TGT --prefix=/tools \ --disable-nls --disable-shared --disable-multilib \ --disable-decimal-float --disable-threads \ --disable-libmudflap --disable-libssp \ --disable-libgomp --enable-languages=c \ --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \ --without-ppl --without-cloogWhen I attempt to make I get th...Read more

make - Makefile alternative for those who don't want tab indenting all content under the opener

Is there a GNU make alternative if don't want to use tab indents in my make program (or make-like) program?For example, when I use make, I need to indent everything after the make opener, (% :). This is a recipe for some problems in some circumstances (for example, I work cross-platform and I use a Windows10 AutoHotkey mechanism that strips tabs from codes I paste into Linux terminals from different reasons and it doesn't pass over make hence I need a non tab including solution).The necessity to tab-indent everything under % : makes my work wit...Read more

make - /lib/ No such file or directory

I encountered some problems when compiling gutenprint-5.2.9.tar.bz2:./extract-strings `cat xml-stamp | sed -e 's;^;./;'` > xmli18n-tmp.h.tmp/lib/ No such file or directoryMakefile:827: recipe for target 'xmli18n-tmp.h' failedmake[4]: *** [xmli18n-tmp.h] Error 255I’m building on Ubuntu 16.04, using the cc-linaro-arm-linux-gnueabihf-4.7-2012.12-20121214_linux cross-compiler....Read more

make - makefile uses same receipe for multiple targets

i love this makefile but if i call 'all' or 'lab4' it will -o the name 'lab4' but build using the dbug receipe. if i call 'dbug' it will -o 'dbug' and use dbug receipe.what am i doing wrong? i stole this from btwCC := gccCFLAGS := -c -Wall -WerrorDBCFLAGS := $(CFLAGS) -DDEBUG -gLDFLAGS :=LAB := lab4PROJDIRS := .SRCFILES := $(shell find $(PROJDIRS) -maxdepth 1 -type f -name "*.c")HDRFILES := $(shell find $(PROJDIRS) -maxdepth 1 -type f -name "*.h")OBJFILES := $(patsubst %.c,%.o,$(SRCFILES))DEPFILES := $(patsubst %.c,%.d,$...Read more

make - Why 'Makefile' demands dependency?

I wonder why 'Makefile' demands dependency line in spite of a command line already has list of file.For example, hello : main.o hello.o gcc -o main.o hello.oThe gcc command already contains main.o, hello.o. Writing dependency line looks inefficient....Read more

make - Use variable for string substution in makefile

I've this really simple make file:run: test -f ./bin/alfred-proxy || wget "http://localhost:8081/1.0.26/my-binary-1.0.26.tar.gz" -O /tmp/my-binary.tar.gz && tar xfvz /tmp/my-binary.tar.gz go build && ./my-awesome-binaryI want to move the version 1.0.26 to a variable so that I can change it easily in future and it's not part of the long command. How can I accomplish that?...Read more

make - Reference function in Makefile?

I'm modifying a Makefile to add a command which will be used to update and compile a dependency.I already have the make clean command working. Now I'm trying to make it run before I run any other make command.I'm trying by adding all: clean but it doesn't seem to work:.PHONY: allall: clean.PHONY: cleanclean: rm -rf buildupdate-dep: mkdir -p build/package_name \ && # do stuff hereHow can I run clean when any of the other functions is run?...Read more