Skip to content

Commit d30588d

Browse files
committed
Create dir if it doesn't exist
1 parent 0b77fd4 commit d30588d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ ERLANG_INCLUDES := $(shell erl -eval 'io:format("~s", \
88
LIBP2P_DIR = native/libp2p_nif
99
OUTPUT_DIR = priv/native
1010

11+
# create dir if it doesn't exist
12+
dir_guard=@mkdir -p $(@D)
13+
1114
GO_SOURCES = $(LIBP2P_DIR)/main.go
1215
GO_ARCHIVES := $(patsubst %.go,%.a,$(GO_SOURCES))
1316
GO_HEADERS := $(patsubst %.go,%.h,$(GO_SOURCES))
@@ -22,6 +25,7 @@ $(LIBP2P_DIR)/%.a $(LIBP2P_DIR)/%.h: $(LIBP2P_DIR)/%.go
2225
go build -buildmode=c-archive -tags only_go $*.go
2326

2427
$(OUTPUT_DIR)/libp2p_nif.so: $(GO_ARCHIVES) $(GO_HEADERS) $(LIBP2P_DIR)/libp2p.c $(LIBP2P_DIR)/utils.c
28+
$(dir_guard)
2529
gcc $(CFLAGS) -o $@ \
2630
$(LIBP2P_DIR)/libp2p.c $(LIBP2P_DIR)/utils.c $(GO_ARCHIVES)
2731

0 commit comments

Comments
 (0)