blob: 57813474ce63dd14f111d5604bf0a65d228cfd03 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001
2include $(COMMON_BASE_MK)
3
4NAME=libpng
5SRC_DIR=libpng-1.6.37
6INSTALL_DIR=$(LIB_DIR)/$(NAME)/install
7BUILD_DIR=build
8GEN_MAKEFILE=$(BUILD_DIR)/Makefile
9
10CONFIG_OPTS = --target=arm-linux --host=arm-linux
11CONFIG_OPTS += --enable-static
12ifeq ($(CONFIG_LIBCURL_SHARE_LIB), y)
13CONFIG_OPTS += --enable-shared
14else
15CONFIG_OPTS += --disable-shared
16endif
17export ZLIBINC=$(LIB_DIR)/zlib/install/include
18export ZLIBLIB=$(LIB_DIR)/zlib/install/lib
19export CFLAGS += -I$(ZLIBINC)
20export CPPFLAGS += -I$(ZLIBINC)
21export LDFLAGS += -L$(ZLIBLIB)
22
23all: $(GEN_MAKEFILE)
24 make -C build all
25 make -C build install
26
27$(GEN_MAKEFILE):
28 mkdir -p $(BUILD_DIR)
29 cd $(BUILD_DIR); ../$(SRC_DIR)/configure --prefix=$(INSTALL_DIR) $(CONFIG_OPTS)
30
31clean:
32 -rm -fr $(BUILD_DIR) $(INSTALL_DIR)
33
34romfs:
35 cd $(INSTALL_DIR)/lib; \
36 for i in *.so*; do \
37 if [ -L $$i ]; then \
38 $(ROMFSINST) -s `find $$i -printf %l` /lib/$$i; \
39 elif [ -f $$i ]; then \
40 $(ROMFSINST) /lib/$$i; \
41 fi; \
42 done
43