forked from gabrielcuvillier/regal-emscripten-fixes
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.zlib
55 lines (39 loc) · 1.06 KB
/
Makefile.zlib
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
ifndef MAKEFILE_ZLIB_INCLUDED
MAKEFILE_ZLIB_INCLUDED := 1
.PHONY: zlib.lib zlib.clean
include build/common.inc
include build/zlib.inc
#
# zlib
#
ifdef ZLIB.STATIC
all:: zlib.lib
clean:: zlib.clean
ZLIB.SRCS := $(ZLIB.C)
ZLIB.SRCS.NAMES := $(notdir $(ZLIB.SRCS))
ZLIB.OBJS := $(addprefix tmp/$(SYSTEM)/zlib/static/,$(ZLIB.SRCS.NAMES))
ZLIB.OBJS := $(ZLIB.OBJS:.c=.o)
ZLIB.DEPS := $(ZLIB.OBJS:.o=.d)
-include $(ZLIB.DEPS)
ZLIB.CFLAGS += -fvisibility=hidden
ifeq ($(filter-out linux% darwin% nacl%,$(SYSTEM)),)
ZLIB.CFLAGS += -DHAVE_UNISTD_H
endif
zlib.lib: lib/$(SYSTEM)/$(ZLIB.STATIC)
zlib.clean:
$(RM) -r tmp/$(SYSTEM)/zlib/static
$(RM) -r lib/$(SYSTEM)/$(ZLIB.STATIC)
tmp/$(SYSTEM)/zlib/static/%.o: src/zlib/src/%.c
@mkdir -p $(dir $@)
$(LOG_CC)$(CCACHE) $(CC) $(ZLIB.CFLAGS) $(CFLAGS) $(PICFLAG) -o $@ -c $<
lib/$(SYSTEM)/$(ZLIB.STATIC): $(ZLIB.OBJS)
@mkdir -p $(dir $@)
$(LOG_AR)$(CCACHE) $(AR) cr $@ $(ZLIB.OBJS)
ifneq ($(RANLIB),)
$(LOG_RANLIB)$(RANLIB) $@
endif
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
endif
endif