Make missing separator issue - makefile

Getting this error makefile:4: *** missing separator. Stop. on this file
PROC=findcrypt
O1=consts
O2=sparse
!include ..\plugin.mak
# MAKEDEP dependency list ------------------
$(F)consts$(O) : $(I)llong.hpp $(I)pro.h consts.cpp findcrypt.hpp
$(F)findcrypt$(O): $(I)area.hpp $(I)bytes.hpp $(I)fpro.h $(I)funcs.hpp \
$(I)help.h $(I)ida.hpp $(I)idp.hpp $(I)kernwin.hpp \
$(I)lines.hpp $(I)llong.hpp $(I)loader.hpp $(I)moves.hpp \
$(I)nalt.hpp $(I)name.hpp $(I)netnode.hpp $(I)pro.h \
$(I)segment.hpp $(I)sistack.hpp $(I)ua.hpp $(I)xref.hpp \
findcrypt.cpp findcrypt.hpp
$(F)sparse$(O) : $(I)llong.hpp $(I)pro.h findcrypt.hpp sparse.cpp
I've tried using cat -e -t -v makefile to identify bad tabs but it all looks ok from what i can tell.

Related

Pandoc fails to render markdown with image: "! Missing endcsname inserted."

I am having trouble rendering a .md-file with since I inserted an image. Before everything worked quite well.
My configuration
MacBook Air / MacOS 12.5
multiple markdown files for each chapter: 1_einleitung.md / 2_theorie.md / ...
there is a short yaml-block that references the bibliography file within the same folder: bib.bib.
I use a special LUA filter (pangb4e) for numbered examples and interlinear glossing
a metadata.yml ➞ find the yaml code below.
a Make-file ➞ find the makefile code below
the image is stored in images/danes1.png (I even tried to use the entire path instead of the relative one)
2_theorie.md
---
bibliography: [bib.bib]
---
[...]
![Die einfache lineare Progression](images/danes1.png){width=300px #fig:danes1}
metadata.yml
---
author: ...
affiliation: ...
title: ...
date: \today
# number-sections: true
# abstract: This is the abstract.
# Formatting
bibliography: [bib.bib]
cls: linguistics-and-education.csl
lang: de-DE
link-citations: true
linkReferences: true
nameInLink: true
fontsize: 12pt
papersize: a4
indent: true
fontfamily: sourcesanspro
fontfamilyoptions: default
geometry: margin=2.5cm
linestretch: 1.5
header-includes:
- \usepackage{gb4e}
- \usepackage[nottoc]{tocbibind}
figureTitle: "Abbildung"
tableTitle: "Tabelle"
figPrefix:
- "Fig."
- "Figs."
tblPrefix:
- "Tab."
secPrefix:
- Kapitel
loftitle: "# Abbildungsverzeichnis"
lottitle: "# Tabellenverzeichnis"
...
makefile
1_einleitung:
pandoc 1_einleitung.md -o 1_einleitung.pdf \
--metadata-file=metadata.yml \
--number-sections \
--strip-comments \
--filter pandoc-crossref \
--citeproc \
--lua-filter addons/pangb4e.lua \
2_theorie:
pandoc 2_theorie.md -o 2_theorie.pdf \
--metadata-file=metadata.yml \
--number-sections \
--strip-comments \
--filter pandoc-crossref \
--citeproc \
--lua-filter addons/pangb4e.lua \
The error output
Currently, I do my writing within the 2_theorie.md and run the command make 2_theorie to produce a pdf. I just inserted an image in 2_theorie.md and a get the following error:
san#MacBook-Air Doktorarbeit % make 2_theorie
pandoc 2_theorie.md -o 2_theorie.pdf \
--metadata-file=metadata.yml \
--number-sections \
--strip-comments \
--filter pandoc-crossref \
--citeproc \
--lua-filter addons/pangb4e.lua \
Error producing PDF.
! Missing endcsname inserted.
<to be read again>
let
l.591 }
When I delete the image, the code runs as usual but I need to be able to use images in my work.
If you need more information, please let me know!
Thank you!
I found a solution to my problem myself here: https://tex.stackexchange.com/questions/448314/not-able-to-use-images-if-i-call-gb4e-sty
The problem was the package gb4e. I disabled the a feature of the package right after loading it and panda worked just fine
Edits in the metadata.yml
[...]
header-includes:
- \usepackage{gb4e}
- \noautomath # <-- I added this line the to metadata.yml
[...]

For loop values in a Makefile not being used as arguments to a shell command

I'm trying to use a Makefile to iterate over several date values and execute a python script for each one, here's the Makefile I'm using (Makefile.study.s1):
include Makefile
# Dates to test
SNAP_TST := 2019-10-12 2020-02-08 2020-10-10 2021-01-02 2021-07-24 2021-12-31 2022-05-27
buildDataset:
for date in $(SNAP_TST) ; do \
python src/_buildDataset.py --table $(TABLE) \
--nan-values $(NAN_CONFIG) \
--patterns-rmv $(PATTERNS_RMV) \
--target-bin $(TARGET_CLASS) \
--target-surv $(TARGET_SURV) \
--target-init $(TARGET_INIT) \
--train-file $(DATA_TRN) \
--test-file $(DIR_DATA)/main/churnvol_test_$$date.csv \
--train-date $(SNAP_TRN) \
--test-date $$date \
--config-input $(CONFIG_INPUT) \
--feats $(FEATS) ; \
done
.PHONY: buildDataset
When I run make -f Makefile.study.s1 buildDataset it replaces the value date with the string "$date" instead of one of the dates in SNAP_TST. Can you guys help me figure out what I did wrong here, and how I can fix this makefile so that $$date is replaced with one of the dates in SNAP_TST? Thank you in advance.

make on ubuntu vs Mingw32-make on windows -- unable to execute ! and other commands

The following structure works fine on a native ubuntu machine:
Makefile
Makefile-Debug
Makefile-impl
I call make with make CONF=Debug
Contents of Makefile are:
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
build: .build-post
.build-pre:
.build-post: .build-impl
clean: .clean-post
.clean-pre:
.clean-post: .clean-impl
clobber: .clobber-post
.clobber-pre:
.clobber-post: .clobber-impl
all: .all-post
.all-pre:
.all-post: .all-impl
build-tests: .build-tests-post
.build-tests-pre:
.build-tests-post: .build-tests-impl
test: .test-post
.test-pre: build-tests
.test-post: .test-impl
help: .help-post
.help-pre:
.help-post: .help-impl
include Makefile-impl.mk <<----this file gets executed
include Makefile-variables.mk
Now, Makefile-impl.mk has the following line where it is checked whether the makefile corresponding to the Debug configuration -- Makefile-Debug -- actually exists:
.validate-impl:
#if [ ! -f Makefile-${CONF}.mk ]; \ <<------ this line produces an error in MinGW
then \
echo ""; \
echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
echo "See 'make help' for details."; \
echo "Current directory: " `pwd`; \
echo ""; \
fi
#if [ ! -f Makefile-${CONF}.mk ]; \
then \
exit 1; \
fi
The above works perfectly fine on the native ubuntu machine.
When mingw32-make.exe processes the above on a windows machine, I obtain an error:
! was unexpected at this time.
mingw32-make: *** [Makefile-impl.mk:90: .validate-impl] Error 255
Is there any workaround for this? I also obtain other errors, such as for -n on the following different line in Makefile-impl.mk
#if [ -n "${MAKE_VERSION}" ]; then \
Here the error is:
-n was unexpected at this time.
mingw32-make: *** [Makefile-impl.mk:78: .depcheck-impl] Error 255

Explain this makefile recipe construction

install_target: first FORCE
if not exist C:\Qt\Qt5.1.1\5.1.1\Sources\qtbase\bin\ \
C:\Qt\Qt5.1.1\5.1.1\static\?\?C:\Qt\Qt5.1.1\5.1.1\static\?\lib \
mkdir C:$(INSTALL_ROOT)\Qt\Qt5.1.1\5.1.1\Sources\qtbase\bin\? \
C:\Qt\Qt5.1.1\5.1.1\static\?\?C:\Qt\Qt5.1.1\5.1.1\static\?\lib & \
if not exist C:\Qt\Qt5.1.1\5.1.1\Sources\qtbase\bin\? \
C:\Qt\Qt5.1.1\5.1.1\static\?\?C:\Qt\Qt5.1.1\5.1.1\static\?\lib exit 1
What does question mark mean?

Disable all but few warnings in gcc

In gcc -w is used to disable all warnings. However in this case I can't enable specific ones (e.g. -Wreturn-type).
Is it possible to disable all warnings, but enable few specific ones?
As a workaround, is there a way to generate list of all -Wno-xxx at once? And will it help? I wouldn't want to do this manually just to find out that it is not equal to -w.
You can use the following command to get an WARN_OPTS variable suitable for injecting directly into your Makefile:
gcc --help=warnings | awk '
BEGIN { print "WARN_OPTS = \\" }
/-W[^ ]/ { print $1" \\"}
' | sed 's/^-W/ -Wno-/' >makefile.inject
This gives you output (in makefile.inject) like:
WARN_OPTS = \
-Wno- \
-Wno-abi \
-Wno-address \
-Wno-aggregate-return \
-Wno-aliasing \
-Wno-align-commons \
-Wno-all \
-Wno-ampersand \
-Wno-array-bounds \
-Wno-array-temporaries \
: : :
-Wno-variadic-macros \
-Wno-vector-operation-performance \
-Wno-vla \
-Wno-volatile-register-var \
-Wno-write-strings \
-Wno-zero-as-null-pointer-constant \
Once that's put in your actual Makefile, simply use $(WARN_OPTS) as part of your gcc command.
It may need a small amount of touch up to:
get rid of invalid options such as -Wno-;
fix certain -Wno-<key>=<value> types; and
remove the final \ character.
but that's minimal effort compared to the generation of the long list, something you can now do rather simply.
When you establish that you want one of those warnings, simply switch from the -Wno-<something> back to -W<something>.

Resources