forked from ucr-serverless/spright
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
167 lines (118 loc) · 5.72 KB
/
Makefile
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# SPDX-License-Identifier: MIT
# Copyright (c) 2022 University of California, Riverside
ifneq ($(shell pkg-config --exists libconfig && echo 0), 0)
$(error "libconfig is not installed")
endif
ifneq ($(shell pkg-config --exists libdpdk && echo 0), 0)
$(error "DPDK is not installed")
endif
CFLAGS = $(shell pkg-config --cflags libconfig libdpdk)
LDFLAGS = $(shell pkg-config --libs-only-L libconfig libdpdk)
LDLIBS = $(shell pkg-config --libs-only-l libconfig libdpdk)
CFLAGS += -Isrc/include -Isrc/cstl/inc -MMD -MP -O3 -Wall -Werror
LDLIBS += -lbpf -lm -pthread -luuid
.PHONY: all shm_mgr gateway nf clean
all: bin shm_mgr gateway nf adservice currencyservice emailservice paymentservice shippingservice productcatalogservice cartservice recommendationservice frontendservice checkoutservice
shm_mgr: bin/shm_mgr_rte_ring bin/shm_mgr_sk_msg
bin/shm_mgr_rte_ring: src/io_rte_ring.o src/shm_mgr.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/shm_mgr_sk_msg: src/io_sk_msg.o src/shm_mgr.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
gateway: bin/gateway_rte_ring bin/gateway_sk_msg
bin/gateway_rte_ring: src/io_rte_ring.o src/gateway.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/gateway_sk_msg: src/io_sk_msg.o src/gateway.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
nf: bin/nf_rte_ring bin/nf_sk_msg
bin/nf_rte_ring: src/io_rte_ring.o src/nf.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_sk_msg: src/io_sk_msg.o src/nf.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
adservice: bin/nf_adservice_rte_ring bin/nf_adservice_sk_msg
bin/nf_adservice_rte_ring: src/io_rte_ring.o src/adservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_adservice_sk_msg: src/io_sk_msg.o src/adservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
currencyservice: bin/nf_currencyservice_rte_ring bin/nf_currencyservice_sk_msg
bin/nf_currencyservice_rte_ring: src/io_rte_ring.o src/currencyservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) ./src/cstl/src/libclib.a
bin/nf_currencyservice_sk_msg: src/io_sk_msg.o src/currencyservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) ./src/cstl/src/libclib.a
emailservice: bin/nf_emailservice_rte_ring bin/nf_emailservice_sk_msg
bin/nf_emailservice_rte_ring: src/io_rte_ring.o src/emailservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_emailservice_sk_msg: src/io_sk_msg.o src/emailservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
paymentservice: bin/nf_paymentservice_rte_ring bin/nf_paymentservice_sk_msg
bin/nf_paymentservice_rte_ring: src/io_rte_ring.o src/paymentservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_paymentservice_sk_msg: src/io_sk_msg.o src/paymentservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
shippingservice: bin/nf_shippingservice_rte_ring bin/nf_shippingservice_sk_msg
bin/nf_shippingservice_rte_ring: src/io_rte_ring.o src/shippingservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_shippingservice_sk_msg: src/io_sk_msg.o src/shippingservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
-include $(patsubst %.o, %.d, $(wildcard src/*.o))
productcatalogservice: bin/nf_productcatalogservice_rte_ring bin/nf_productcatalogservice_sk_msg
bin/nf_productcatalogservice_rte_ring: src/io_rte_ring.o src/productcatalogservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) ./src/cstl/src/libclib.a
bin/nf_productcatalogservice_sk_msg: src/io_sk_msg.o src/productcatalogservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) ./src/cstl/src/libclib.a
cartservice: bin/nf_cartservice_rte_ring bin/nf_cartservice_sk_msg
bin/nf_cartservice_rte_ring: src/io_rte_ring.o src/cartservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) ./src/cstl/src/libclib.a
bin/nf_cartservice_sk_msg: src/io_sk_msg.o src/cartservice.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) ./src/cstl/src/libclib.a
recommendationservice: bin/nf_recommendationservice_rte_ring bin/nf_recommendationservice_sk_msg
bin/nf_recommendationservice_rte_ring: src/io_rte_ring.o src/recommendationservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_recommendationservice_sk_msg: src/io_sk_msg.o src/recommendationservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
-include $(patsubst %.o, %.d, $(wildcard src/*.o))
frontendservice: bin/nf_frontendservice_rte_ring bin/nf_frontendservice_sk_msg
bin/nf_frontendservice_rte_ring: src/io_rte_ring.o src/frontendservice.o src/utility.o src/shm_rpc.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_frontendservice_sk_msg: src/io_sk_msg.o src/frontendservice.o src/utility.o src/shm_rpc.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
-include $(patsubst %.o, %.d, $(wildcard src/*.o))
checkoutservice: bin/nf_checkoutservice_rte_ring bin/nf_checkoutservice_sk_msg
bin/nf_checkoutservice_rte_ring: src/io_rte_ring.o src/checkoutservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
bin/nf_checkoutservice_sk_msg: src/io_sk_msg.o src/checkoutservice.o src/utility.o
@ echo "CC $@"
@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
-include $(patsubst %.o, %.d, $(wildcard src/*.o))
%.o: %.c
@ echo "CC $@"
@ $(CC) -c $(CFLAGS) -o $@ $<
bin:
@ mkdir -p $@
clean:
@ echo "RM -r src/*.d src/*.o bin"
@ $(RM) -r src/*.d src/*.o bin