From 1592fc20ac2898656ce06e368c6ab18027fd68f9 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 9 Mar 2018 02:13:30 +0100 Subject: [PATCH] Do not remove objects for commands --- src/makefile.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/makefile.c b/src/makefile.c index 00180b9..ac2ee16 100644 --- a/src/makefile.c +++ b/src/makefile.c @@ -60,6 +60,8 @@ typedef struct _Makefile /* accessors */ static String const * _makefile_get_config(Makefile * makefile, String const * section, String const * variable); +static TargetType _makefile_get_type(Makefile * makefile, + String const * target); static int _makefile_is_enabled(Makefile * makefile, char const * target); static unsigned int _makefile_is_flag_set(Makefile * makefile, @@ -1854,7 +1856,9 @@ static int _clean_targets(Makefile * makefile) continue; c = targets[i]; targets[i] = '\0'; - _makefile_print(makefile, "%s%s%s", " $(", targets, "_OBJS)"); + if(_makefile_get_type(makefile, targets) != TT_COMMAND) + _makefile_print(makefile, "%s%s%s", " $(", targets, + "_OBJS)"); if(c == '\0') break; targets[i] = c; @@ -2720,6 +2724,18 @@ static String const * _makefile_get_config(Makefile * makefile, } +/* makefile_get_type */ +static TargetType _makefile_get_type(Makefile * makefile, + String const * target) +{ + String const * type; + + if((type = _makefile_get_config(makefile, target, "type")) == NULL) + return TT_UNKNOWN; + return enum_string(TT_LAST, sTargetType, type); +} + + /* makefile_is_enabled */ static int _makefile_is_enabled(Makefile * makefile, char const * target) {