Hi, I'm not sure but I think I found a bug in ifeq and ifneq:
My project structure is like this: $ tree . ├── Makefile ├── subprojA │ ├── src.cpp │ ├── Makefile │ └── test.cpp └── subprojA ├── src.cpp ├── Makefile └── test.cpp The upper Makefile should run `make test` for each sub project if "test.cpp" is in this folder. My Makefile is like this: SUBDIRS := $(wildcard */) TESTDIRS := $(SUBDIRS:%=test-%) .PHONY: test $(SUBDIRS) $(TESTDIRS) all: $(SUBDIRS) test: $(TESTDIRS) $(SUBDIRS): CC=$(CC) CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' $(MAKE) all -C $@ $(TESTDIRS): $(eval TARGETDIR := $(@:test-%=%)) $(eval TESTSRC := $(TARGETDIR)test.cpp) @echo "$(wildcard $(TESTSRC))" # <-- prints subproj{A,B}/test.cpp if it exists -> this is working ifneq ("$(wildcard $(TESTSRC))","") @#file exists --> but even if the test src exists, this will never be reached CC=$(CC) CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' $(MAKE) test -C $(TARGETDIR) else @echo "[i] $(TARGETDIR) has no tests..." endif Can you explain, why this shouldn't work? Is this a bug or only a fail in Makefile logic? Best regards and grml, Sedrubal
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make