From fb0c08bb121ede0b50e5af58a3b932759ab9e7e4 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 15 May 2019 18:30:14 +0200 Subject: [PATCH] makefile: handle missing directory --- tools/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 522090d..40e49d7 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,5 +1,6 @@ -BIN = bin -OBJ = obj +BIN = bin +OBJ = obj +DIRS = $(BIN) $(OBJ) CFLAGS = -g -O -W -Wall BINS = $(addprefix $(BIN)/, unmunge munge repair) @@ -7,6 +8,8 @@ UNMUNGE_OBJS = $(addprefix $(OBJ)/, util.o unmunge.o) MUNGE_OBJS = $(addprefix $(OBJ)/, util.o munge.o) REPAIR_OBJS = $(addprefix $(OBJ)/, util.o heap.o mempool.o subst.o repair.o) +$(shell mkdir -p $(DIRS)) + all: $(BINS) $(BIN)/unmunge: $(UNMUNGE_OBJS) @@ -25,4 +28,4 @@ clean: rm -f $(OBJ)/* $(BIN)/*.core cleaner: - rm -f $(BIN)/* $(OBJ)/* $(BIN)/*.core + rm -rf $(DIRS)