This repository has been archived by the owner on Apr 28, 2023. It is now read-only.
forked from Mars999/regal
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.snappy
67 lines (48 loc) · 1.43 KB
/
Makefile.snappy
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
ifndef MAKEFILE_SNAPPY_INCLUDED
MAKEFILE_SNAPPY_INCLUDED := 1
.PHONY: snappy.lib snappy.clean
include build/common.inc
ifeq ($(filter nacl%,$(SYSTEM)),)
include build/snappy.inc
#
# snappy
#
ifneq ($(SNAPPY.STATIC),)
all:: snappy.lib
clean:: snappy.clean
SNAPPY.SRCS := $(SNAPPY.CXX)
SNAPPY.SRCS.NAMES := $(notdir $(SNAPPY.SRCS))
SNAPPY.OBJS := $(addprefix tmp/$(SYSTEM)/snappy/static/,$(SNAPPY.SRCS.NAMES))
SNAPPY.OBJS := $(SNAPPY.OBJS:.c=.o)
SNAPPY.OBJS := $(SNAPPY.OBJS:.cc=.o)
SNAPPY.DEPS := $(SNAPPY.DEPS:.o=.d)
-include $(SNAPPY.DEPS)
SNAPPY.CFLAGS += -fvisibility=hidden
ifeq ($(filter-out linux% darwin% nacl%,$(SYSTEM)),)
SNAPPY.CFLAGS += -DHAVE_UNISTD_H
endif
ifeq ($(MODE),release)
SNAPPY.CFLAGS += -DNDEBUG
endif
snappy.lib: lib/$(SYSTEM)/$(SNAPPY.STATIC)
snappy.clean:
$(RM) -r tmp/$(SYSTEM)/snappy/static
$(RM) -r lib/$(SYSTEM)/$(SNAPPY.STATIC)
tmp/$(SYSTEM)/snappy/static/%.o: src/snappy/%.c
@mkdir -p $(dir $@)
$(LOG_CC)$(CCACHE) $(CC) $(SNAPPY.CFLAGS) $(CFLAGS) $(PICFLAG) -o $@ -c $<
tmp/$(SYSTEM)/snappy/static/%.o: src/snappy/%.cc
@mkdir -p $(dir $@)
$(LOG_CC)$(CCACHE) $(CXX) $(SNAPPY.CFLAGS) $(CFLAGS) $(CXXFLAGS) $(PICFLAG) -o $@ -c $<
lib/$(SYSTEM)/$(SNAPPY.STATIC): $(SNAPPY.OBJS)
@mkdir -p $(dir $@)
$(LOG_AR)$(CCACHE) $(AR) cr $@ $(SNAPPY.OBJS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
endif
endif
endif