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