3 # Don't pass command line variables when calling make.
4 # This saves us trouble when building against klibc.
7 EXTRA_DIST = klibc_compat.h
9 PNGDEFS = -DPNG_NO_WRITE_TIME -DPNG_NO_FLOATING_POINT_SUPPORTED -DPNG_NO_WRITE_SUPPORTED -DPNG_NO_READ_iTXt \
10 -DPNG_LEGACY_SUPPORTED -DPNG_NO_PROGRESSIVE_READ -DPNG_NO_MNG_FEATURES -DPNG_NO_CONSOLE_IO \
11 -DPNG_NO_ERROR_NUMBERS -DPNG_READ_GRAY_TO_RGB_SUPPORTED -DPNG_READ_16_TO_8_SUPPORTED \
12 -DPNG_READ_STRIP_ALPHA_SUPPORTED -DPNG_NO_INFO_IMAGE -DPNG_NO_READ_TRANSFORMS -DPNG_NO_READ_ANCILLARY_CHUNKS \
15 # Flags for the kernel utilities
16 K_CFLAGS = -O2 -w -ffunction-sections -fdata-sections \
17 -DWITH_ERRLIST -DTARGET_KERNEL -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER
20 mostlyclean-local-libfreetype \
21 mostlyclean-local-libjpeg \
22 mostlyclean-local-libpng \
23 mostlyclean-local-libz
28 noinst_LIBRARIES += libjpeg.a
30 noinst_LIBRARIES += libpng.a libz.a
33 noinst_LIBRARIES += libfreetype.a
40 libfreetype_a_SOURCES =
42 libfreetype.a: klibc_compat.h
43 $(Q)$(MKDIR_P) libfreetype
44 $(Q)cd libfreetype ; \
45 if test ! -e ./config.mk ; then \
46 $(call infmsg,CONF,libfreetype.a) ; \
47 CFLAGS="$(K_CFLAGS) -include $(abs_top_srcdir)/libs/klibc_compat.h" \
48 CC="$(KLCC)" CPPFLAGS="-I$(LIBZ_SOURCE)" \
49 $(LIBFREETYPE2_SOURCE)/configure --host=$(host) --build=$(build_triplet) --disable-shared $(OUTPUT) ; \
51 if ! $(MAKE) --question $(AM_MAKEFLAGS) CFLAGS="$(K_CFLAGS)" library ; then \
52 $(call infmsg,MAKE,libfreetype.a) ; \
54 $(MAKE) $(AM_MAKEFLAGS) CFLAGS="-c $(K_CFLAGS)" CCexe="$(BUILD_CC)" library $(OUTPUT)
56 $(Q)cp -f libfreetype/.libs/libfreetype.a $@
59 $(Q)$(MKDIR_P) libjpeg
61 if test ! -e ./Makefile ; then \
62 $(call infmsg,CONF,libjpeg.a) ; \
63 CC=$(KLCC) CFLAGS="$(K_CFLAGS) -I$(abs_top_builddir)/libs/libjpeg" $(LIBJPEG_SOURCE)/configure \
64 --host=$(host) --build=$(build_triplet) $(OUTPUT) ; \
65 echo "#define NO_GETENV 1" >> jconfig.h ; \
66 $(SED) -i "s#CFLAGS=.*#CFLAGS=$(K_CFLAGS) -I$(abs_top_builddir)/libs/libjpeg#" Makefile ; \
67 $(SED) -i "s:#define JMESSAGE.*::" $(LIBJPEG_SOURCE)/jerror.c ; \
69 if ! $(MAKE) --question $(AM_MAKEFLAGS) CC="$(KLCC)" libjpeg.a ; then \
70 $(call infmsg,MAKE,libjpeg.a) ; \
72 $(MAKE) $(AM_MAKEFLAGS) CC="$(KLCC)" libjpeg.a $(OUTPUT)
74 $(Q)cp -f libjpeg/libjpeg.a $@
77 $(Q)cd $(LIBPNG_SOURCE) ; \
78 if test ! -e ./Makefile ; then \
79 $(call infmsg,CONF,libpng.a) ; \
80 cp scripts/makefile.linux Makefile $(OUTPUT); \
81 $(SED) -i -e '/^CFLAGS/ { N ; s#^CFLAGS=.*#CFLAGS=$(K_CFLAGS) $(PNGDEFS)# ; P ; D }' \
82 -e 's#^ZLIBINC=.*#ZLIBINC=$(LIBZ_SOURCE)#' \
83 -e 's#^ZLIBLIB=.*#ZLIBLIB=$(LIBZ_SOURCE)#' Makefile ; \
85 if ! $(MAKE) --question $(AM_MAKEFLAGS) CC="$(KLCC)" AR_RC="$(AR) rc" RANLIB="$(RANLIB)" libpng.a ; then \
86 $(call infmsg,MAKE,libpng.a) ; \
88 $(MAKE) $(AM_MAKEFLAGS) CC="$(KLCC)" AR_RC="$(AR) rc" RANLIB="$(RANLIB)" libpng.a $(OUTPUT)
90 $(Q)cp -f $(LIBPNG_SOURCE)/libpng.a $@
93 $(Q)cd $(LIBZ_SOURCE) ; \
94 if test ! -e ./Makefile ; then \
95 $(call infmsg,CONF,libz.a) ; \
96 CC=$(KLCC) CFLAGS="$(K_CFLAGS)" \
97 ./configure $(OUTPUT); \
98 $(SED) -i 's#^CFLAGS=\(.*\)#CFLAGS=\1 $(K_CFLAGS)#' Makefile ; \
100 if ! $(MAKE) --question $(AM_MAKEFLAGS) CC="$(KLCC)" AR="$(AR) rc" RANLIB="$(RANLIB)" libz.a ; then \
101 $(call infmsg,MAKE,zlib.a) ; \
103 $(MAKE) $(AM_MAKEFLAGS) CC="$(KLCC)" AR="$(AR) rc" RANLIB="$(RANLIB)" libz.a $(OUTPUT)
105 $(Q)cp -f $(LIBZ_SOURCE)/libz.a $@
107 mostlyclean-local-libfreetype:
108 $(Q)$(MKDIR_P) libfreetype
109 $(Q)cd libfreetype ; \
110 if test -e ./config.mk ; then \
111 $(call infmsg,CLEAN,libfreetype.a) ; \
112 $(MAKE) $(AM_MAKEFLAGS) clean $(OUTPUT) ; \
115 $(Q)rm -fr libfreetype
116 $(Q)rm -f libfreetype.a
118 mostlyclean-local-libjpeg:
119 $(Q)$(MKDIR_P) libjpeg
121 if test -e Makefile ; then \
122 $(call infmsg,CLEAN,libjpeg.a) ; \
123 $(MAKE) $(AM_MAKEFLAGS) clean $(OUTPUT) ; \
129 mostlyclean-local-libpng:
130 $(Q)cd $(LIBPNG_SOURCE) ; \
131 if test -e Makefile ; then \
132 $(call infmsg,CLEAN,libpng.a) ; \
133 $(MAKE) $(AM_MAKEFLAGS) clean $(OUTPUT) ; \
138 mostlyclean-local-libz:
139 $(Q)cd $(LIBZ_SOURCE) ; \
140 if test -e Makefile ; then \
141 $(call infmsg,CLEAN,libz.a) ; \
142 $(MAKE) $(AM_MAKEFLAGS) clean $(OUTPUT) ; \