-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 912 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (28 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
PROTO_DIR := proto
PROTO_GEN_DIR := $(PROTO_DIR)/gen
PROTO_SRC := $(PROTO_DIR)/nfs.proto
PROTO_GEN_SRCS := $(PROTO_GEN_DIR)/nfs.pb-c.c
PROTO_GEN_HDRS := $(PROTO_GEN_DIR)/nfs.pb-c.h
PROTO_LIB := $(PROTO_DIR)/libnfsproto.a
.PHONY: all proto storage_server name_server client clean proto-clean
all: proto storage_server name_server client
proto: $(PROTO_LIB)
storage_server: proto
$(MAKE) -C storage_server
name_server: proto
$(MAKE) -C name_server
client: proto
$(MAKE) -C client
$(PROTO_GEN_DIR):
mkdir -p $@
$(PROTO_LIB): $(PROTO_GEN_SRCS) $(PROTO_GEN_HDRS)
$(MAKE) -C $(PROTO_DIR)
$(PROTO_GEN_SRCS) $(PROTO_GEN_HDRS): $(PROTO_SRC) | $(PROTO_GEN_DIR)
cd $(PROTO_DIR) && protoc-c --proto_path=. --c_out=gen $(notdir $<)
proto-clean:
$(MAKE) -C $(PROTO_DIR) clean
rm -rf $(PROTO_GEN_DIR)
clean: proto-clean
$(MAKE) -C storage_server clean
$(MAKE) -C name_server clean
$(MAKE) -C client clean