Dear Friends:
I want to use a makefile to compare two folders. If the two folders are equal I don't do anything, but if they are different I want to create a folder. Here is my makefile which is complaining about:
BINDIREXISTS:=T
ifeq "../.build" "../TopicA" /bin/sh: ifeq: not found make: * [checkDest] Error 127
The makefile is the following:
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)/*