I'm trying to create a Makefile that works on both Windows and Linux. Running make clean
generates the following error:
process_begin: CreateProcess(NULL, rmdir /s /q D:DocumentsProgrammingprojectin, ...) failed.
make: Makefile:13: pipe: No such file or directory
process_begin: CreateProcess(NULL, rmdir /s /q D:DocumentsProgrammingprojectobj, ...) failed.
make: Makefile:15: pipe: No such file or directory
The relevant parts of the Makefile are:
BIN_DIR=bin
OBJ_DIR=obj
SRC_DIR=src
ifeq ($(OS),Windows_NT)
RMDIR=$(shell rmdir /s /q $(subst /,,$(abspath $1)))
else
RMDIR=$(shell rm -rf $(abspath $1))
endif
clean:
@echo "RM $(BIN_DIR)"
@$(call RMDIR,$(BIN_DIR))
@echo "RM $(OBJ_DIR)"
@$(call RMDIR,$(OBJ_DIR))
@echo "Done!"
.PHONY: clean
The project structure looks like this:
├─bin
├─obj
├─src
└─Makefile
question from:
https://stackoverflow.com/questions/65865637/gnu-make-pipe-no-such-file-or-directory-error 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…