"make: *** [all] Error 1" for compiling tex files - makefile

I tried to write a makefile to compile the tex file, but an error made me crazy. I have simplified my makefile like below
all: main.tex
xelatex -interaction=nonstopmode ./main.tex
but the error still exists as follows.
make: *** [all] Error 1
I also tried to directly run the command in terminal:
xelatex -interaction=nonstopmode ./main.tex
I have a successful compilation. Similar errors have been found in make: *** [ ] Error 1 error and make: *** [ ] Error 1 error, but the solution does not work for me. Is there anyone could help me? Thanks.

A very dirty and useful trick is to force true in order to avoid the error and to let make continue:
$(FICTEX).pdf: $(FICTEX).aux $(BBL)
$(PDFLATEX) $(FICTEX)||true
$(PDFLATEX) $(FICTEX)||true

Related

Make threw out an error but no detailed error message

Here's the last few lines from the output of running "make install" at root level /home/gm/TEST/:
make[3]: Leaving directory `/home/gm/TEST/tppf/tm/ipmgt'
ld ipfac.o ipfacV.o ipfac_rset.o ipfac_args.o ipfac_d2a.o ipfac_a2d.o ipfac_modr.o ipfac_mod.o ipfac_read.o ipfac_add.o ipfac_del.o ipfac_list.o ipfac_unlk.o ipfac_lock.o ipfac_util.o ipfac_lkid.o -r -o /home/gm/TEST/tppf/lib/ipfac_tppf.o
make[3]: Leaving directory `/home/gm/TEST/tppf/tm/ipfac'
make[2]: Leaving directory `/home/gm/TEST/tppf/tm'
make[1]: *** [i_tm] Error 2
make[1]: Leaving directory `/home/gm/TEST/tppf'
make: *** [i_tppf] Error 2
And the Makefile under /home/gm/TEST/tppf/tm/ipfac contains this rule:
install: ipfac.h $(TPPLIB)/ipfac_tppf.o
$(TPPLIB)/ipfac_tppf.o: $(PROPOBJS)
ld $(PROPOBJS) -r -o $(TPPLIB)/ipfac_tppf.o
Is there something wrong with the linking process? Make should've told me what the error actually is, but it didn't.
BTW, I think /home/gm/TEST/tppf/lib/ipfac_tppf. O was linked and created successfully, or at least it was there in directory /home/gm/TEST/tppf/lib/ after make failed and exited.
That line is not the error line. You can tell that it succeeded because there was no error message there, for building the target /home/gm/TEST/tppf/lib/ipfac_tppf.o.
The error is here:
make[1]: *** [i_tm] Error 2
The [1] means that it was the first level of makefile (note the recipe you are quoting here was in the 3rd level of makefile) and the [i_tm] means that the build of the target i_tm failed. You need to look back up further in the output of make, earlier than what you've shown us, and find the *** error line for building the i_tm target and see what errors were generated there.

SkaMPI compilation error, Makefile.dep:5: *** missing separator.

I was trying to compile SkaMPI 5 using latest GNU make(3.81), but getting below error :
make -f Makefile.dep MPICC="mpicc" CFLAGS="-O2" skampi
make[1]: Entering directory
Makefile.dep:5: *** missing separator. Stop.
make[1]: Leaving directory
make: *** [skampi] Error 2

What does numbers in make[1] make[2] make[3] mean?

For example I get an error like this when running makefile:
make[3]: *** [/home/ziga/Downloads/openwrt/rakun_openwrt/staging_dir/host/stamp/.upx_installed] Error 1
make[2]: *** [tools/upx/install] Error 2
make[1]: *** [/home/ziga/Downloads/openwrt/rakun_openwrt/staging_dir/target-powerpc_uClibc-0.9.33.2/stamp/.tools_install_nynnn] Error 2
What does the number in the square brackets in make[3], make[2] and make[1]. I am not trying to solve this curent error. I am just curious about the syntax.
Basicly it shows the deepth of recursion

GCC 4.5.0: host-x86_64-unknown-linux-gnu/fixincludes: No such file or directory

When "make check" for GCC4.5.0, such error was occured:
make[1]: Entering directory `/home/username/tool/gcc-4.5.0'
/bin/sh: line 0: cd: host-x86_64-unknown-linux-gnu/fixincludes: No such file or directory
make[1]: *** [check-fixincludes] Error 1
make[1]: Leaving directory `/home/username/tool/gcc-4.5.0'
make: *** [do-check] Error 2
How to solve this problem? please....... & Thanks~~~~~
I had a same problem as you; the reason which fixincludes doesn't exist is because you never finished running "make"(+).
Apparently the check failed. The makefile tried to enter a directory that doesn't exist. What this means depends on the project you are trying to build.

Leaving directory.....?

When I am compiling my code with makefiles (I have 12 makefiles) there is an error telling
make.exe[1]: Leaving directory Error 2 what is the reason for this?
Also what does the "Error 2 or Error 1 " mean?
When make prints "Error 2" in this context it just means that there was an error in a recursive make invocation. You have to look at the error messages preceeding that message to determine what the real problem was, in the submake. For example, given a Makefile like this:
all:
$(MAKE) -f sub.mk
... and a sub.mk like this:
all:
#exit 1
When I run GNU make, it prints the following:
gmake -f sub.mk
gmake[1]: Entering directory `/tmp/foo'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory `/tmp/foo'
gmake: *** [all] Error 2
Error 2 tells me that there was an error of some sort in the submake. I have to look above that message, to the Error 1 message from the submake itself. There I can see that some command invoked while trying to build all exited with exit code 1. Unfortunately there's not really a standard that defines exit codes for applications, beyond the trivial "exit code 0 means OK". You have to look at the particular command that failed and check its documentation to determine what the specific exit code means.
These error messages have nothing to do with Unix errno values as others have stated. The outermost "2" is just the error code that make itself assigns when a submake has an error; the inner "1" is just the exit code of a failed command. It could just as easily be "7" or "11" or "42".

Resources