From 6fa1e2498d2103d84bdbef6c2899cb8c8ccbb553 Mon Sep 17 00:00:00 2001 From: Yatis Date: Sun, 1 Nov 2020 11:01:39 +0100 Subject: [PATCH] Fix printf error + uninstall rules generation error + update configure --- configure | 11 ++++++----- make/Makefile.default | 19 ++++++------------- src/stdio/internal/printf_common.c | 4 ++-- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/configure b/configure index c8960ef..a72ad7e 100755 --- a/configure +++ b/configure @@ -211,22 +211,23 @@ ln -s $src $dst #--- generate_config() { - echo 'CONFIG.CFLAGS := ' - echo 'CONFIG.TARGET := ' - echo 'CONFIG.FORMAT := ' + # build information echo "CONFIG.TOOLCHAIN := $toolchain" [ "$prefix" ] && echo "CONFIG.PREFIX := $prefix" - [ "$cflags" ] && echo "CONFIG.CFLAGS += $cflags" - # debug / unit tests + # extra flags + echo 'CONFIG.CFLAGS := ' + [ "$cflags" ] && echo "CONFIG.CFLAGS += $cflags" [ $debug = true ] && echo 'CONFIG.CFLAGS += -g3' # ABI support + echo 'CONFIG.TARGET := fxlibc' [ $support_vhex_kernel = true ] && echo 'CONFIG.TARGET += fxlibc-vhex' [ $support_casio_abi_fx9860 = true ] && echo 'CONFIG.TARGET += fxlibc-fx9860g' [ $support_casio_abi_fxcg50 = true ] && echo 'CONFIG.TARGET += fxlibc-fxcg50' # formats + echo 'CONFIG.FORMAT := ' [ $format_static = true ] && echo 'CONFIG.FORMAT += static' [ $format_dynamic = true ] && echo 'CONFIG.FORMAT += dynamic' } diff --git a/make/Makefile.default b/make/Makefile.default index 9dbaff1..ca9dc08 100644 --- a/make/Makefile.default +++ b/make/Makefile.default @@ -35,7 +35,7 @@ #--- MAJOR := 0 MINOR := 3 -PATCH := 4 +PATCH := 5 EXTRAVERSION := @@ -210,25 +210,18 @@ version: # @note: # *1 - library pathname define generate-install-rule -# get the library name (remove path information) -lib-basename := $(notdir $1) - -# Genetate rules name -lib-install-rule := $$(basename $$(lib-basename))-install -lib-uninstall-rule := $$(basename $$(lib-basename))-uninstall - # Generate the installation rule -$$(lib-install-rule): +$(basename $(notdir $1))-install: install -d $(CONFIG.PREFIX) install $1 -m 644 $(CONFIG.PREFIX) # Generate the uninstallation rule -$$(lib-uninstall-rule): - rm -f $(CONFIG.PREFIX)$$(lib-basename) +$(basename $(notdir $1))-uninstall: + rm -f $(CONFIG.PREFIX)$(notdir $1) # Register generated rules into their appropriate list -lib-installation-rules += $$(lib-install-rule) -lib-uninstallation-rules += $$(lib-uninstall-rule) +lib-installation-rules += $(basename $(notdir $1))-install +lib-uninstallation-rules += $(basename $(notdir $1))-uninstall endef diff --git a/src/stdio/internal/printf_common.c b/src/stdio/internal/printf_common.c index 3d21ace..c27f796 100644 --- a/src/stdio/internal/printf_common.c +++ b/src/stdio/internal/printf_common.c @@ -20,8 +20,8 @@ int printf_common(struct printf_opt *opt, const char *restrict format) // Check printable char if (format[p] != '%' || format[p + 1] == '%') { tmp = format[p]; - if (format[p] != '%') - tmp = format[++p]; + if (format[p] == '%') + p = p + 1; (*opt->disp_char)(opt,tmp); continue; }