Je veux utiliser un fichier makefile pour comparer deux dossiers. Si les deux dossiers sont égaux, je ne fais rien, mais s'ils sont différents, je veux créer un dossier. Voici mon makefile qui se plaint:make pour comparer deux dossiers
#BINDIREXISTS:=T
ifeq "../.build" "../TopicA"
/bin/sh: ifeq: not found
make: *** [checkDest] Error 127
Le makefile est la suivante:
PROJNAME=TopicA
TOP=..
SRCDIR=src
BUILDDIR=.build
SRC=TopicA.cpp
EXECUTABLE=TopicA.exe
CC=g++
#################################
#MACROS:
define bindirchk
#BINDIREXISTS:=$(shell if [ -d '$(TOP)/$(1)/$(2)/' ]; then echo "T"; else echo "F"; fi)
ifeq "$(strip $(TOP)/$(1))" "$(strip $(TOP)/$(2))"
echo "T"
else
echo "F"
endif
endef
define mkbuilddirs
@echo creating build directories $(TOP)/$(1) and $(TOP)/$(1)/$(2)
$(shell mkdir -p $(TOP)/$(1) $(TOP)/$(1)/$(2))
endef
#################################
#main targets and pre-reqs
all: checkDest
#$(CC) $(SRCDIR)/$(SRC) -o $(TOP)/$(BUILDDIR)/$(PROJNAME)/$(EXECUTABLE)
checkDest:
$(call bindirchk,$(BUILDDIR),$(PROJNAME))
echo $(BINDIREXISTS)
if [ "$(BINDIREXISTS)" "F" ]; then
# echo test found to be true
$(shell mkdir -p $(TOP)/$(1) $(TOP)/$(1)/$(2))
fi
clean:
rm -rf $(TOP)/$(BUILDDIR)/*
formatez votre code s'il vous plaît code, utilisez les boutons ci-dessus la fenêtre d'édition. Cela rendra votre question plus facile à lire et d'autres SER seront prêts à vous aider. –