yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | |
| 2 | include $(COMMON_BASE_MK) |
| 3 | |
| 4 | NAME=libpng |
| 5 | SRC_DIR=libpng-1.6.37 |
| 6 | INSTALL_DIR=$(LIB_DIR)/$(NAME)/install |
| 7 | BUILD_DIR=build |
| 8 | GEN_MAKEFILE=$(BUILD_DIR)/Makefile |
| 9 | |
| 10 | CONFIG_OPTS = --target=arm-linux --host=arm-linux |
| 11 | CONFIG_OPTS += --enable-static |
| 12 | ifeq ($(CONFIG_LIBCURL_SHARE_LIB), y) |
| 13 | CONFIG_OPTS += --enable-shared |
| 14 | else |
| 15 | CONFIG_OPTS += --disable-shared |
| 16 | endif |
| 17 | export ZLIBINC=$(LIB_DIR)/zlib/install/include |
| 18 | export ZLIBLIB=$(LIB_DIR)/zlib/install/lib |
| 19 | export CFLAGS += -I$(ZLIBINC) |
| 20 | export CPPFLAGS += -I$(ZLIBINC) |
| 21 | export LDFLAGS += -L$(ZLIBLIB) |
| 22 | |
| 23 | all: $(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 | |
| 31 | clean: |
| 32 | -rm -fr $(BUILD_DIR) $(INSTALL_DIR) |
| 33 | |
| 34 | romfs: |
| 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 | |