We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b77fd4 commit d30588dCopy full SHA for d30588d
Makefile
@@ -8,6 +8,9 @@ ERLANG_INCLUDES := $(shell erl -eval 'io:format("~s", \
8
LIBP2P_DIR = native/libp2p_nif
9
OUTPUT_DIR = priv/native
10
11
+# create dir if it doesn't exist
12
+dir_guard=@mkdir -p $(@D)
13
+
14
GO_SOURCES = $(LIBP2P_DIR)/main.go
15
GO_ARCHIVES := $(patsubst %.go,%.a,$(GO_SOURCES))
16
GO_HEADERS := $(patsubst %.go,%.h,$(GO_SOURCES))
@@ -22,6 +25,7 @@ $(LIBP2P_DIR)/%.a $(LIBP2P_DIR)/%.h: $(LIBP2P_DIR)/%.go
22
25
go build -buildmode=c-archive -tags only_go $*.go
23
26
24
27
$(OUTPUT_DIR)/libp2p_nif.so: $(GO_ARCHIVES) $(GO_HEADERS) $(LIBP2P_DIR)/libp2p.c $(LIBP2P_DIR)/utils.c
28
+ $(dir_guard)
29
gcc $(CFLAGS) -o $@ \
30
$(LIBP2P_DIR)/libp2p.c $(LIBP2P_DIR)/utils.c $(GO_ARCHIVES)
31
0 commit comments