Below makefile is for checking if the 'obj' directory exist or not.
DIR_TO_CHECK_FOR := '/home/deepak/makefilefolder/obj'
objects= obj/file1.o obj/file2.o obj/file3.o
DIR_TO_CHECK_FOR := '/home/deepak/makefilefolder/obj'
objects= obj/file1.o obj/file2.o obj/file3.o
all: create
create: ifeq ("$(wildcard $(DIR_TO_CHECK_FOR))", "") @echo "Folder does not exist" else @echo "Folder exists" endif
$(objects): obj/%.o: src/%.c gcc -c $< -o $@
clean: rm -rf obj/
This is showing error while running 'make create':
ifeq ("", "")
/bin/sh: -c: line 1: syntax error near unexpected token "",' /bin/sh: -c: line 1: ifeq ("", "")'
make: *** [makefile:8: create] Error 2
I have tried many things please help me out to resolve this.
i have tried to correct the directory path. checked the wildcard syntax of create target.