diff --git a/src/configure.c b/src/configure.c index b9474d6..66fe1a9 100644 --- a/src/configure.c +++ b/src/configure.c @@ -123,8 +123,8 @@ const HostKernelMap mHostKernel[] = { HO_UNKNOWN, "unknown", NULL, NULL } }; -const String * sTargetType[TT_COUNT] = { "binary", "library", "libtool", - "object", "plugin", "script", NULL }; +const String * sTargetType[TT_COUNT] = { "binary", "command", "library", + "libtool", "object", "plugin", "script", NULL }; const struct ExtensionType _sExtensionType[] = { { "c", OT_C_SOURCE }, diff --git a/src/configure.h b/src/configure.h index fdb64c1..7db619a 100644 --- a/src/configure.h +++ b/src/configure.h @@ -87,8 +87,8 @@ extern const HostKernelMap sHostKernel[HK_COUNT]; typedef enum _TargetType { - TT_BINARY = 0, TT_LIBRARY, TT_LIBTOOL, TT_OBJECT, TT_PLUGIN, TT_SCRIPT, - TT_UNKNOWN + TT_BINARY = 0, TT_COMMAND, TT_LIBRARY, TT_LIBTOOL, TT_OBJECT, TT_PLUGIN, + TT_SCRIPT, TT_UNKNOWN } TargetType; # define TT_LAST TT_UNKNOWN # define TT_COUNT (TT_LAST + 1) diff --git a/src/makefile.c b/src/makefile.c index 4dec742..00180b9 100644 --- a/src/makefile.c +++ b/src/makefile.c @@ -335,6 +335,10 @@ static int _variables_targets(Makefile * makefile) " $(OBJDIR)%s$(EXEEXT)", prints); break; + case TT_COMMAND: + _makefile_print(makefile, " %s", + prints); + break; case TT_LIBRARY: ret |= _variables_targets_library( makefile, prints); @@ -490,6 +494,8 @@ static void _executables_variables(Makefile * makefile, _variables_binary(makefile, done); done[TT_OBJECT] = 1; break; + case TT_COMMAND: + break; case TT_OBJECT: _variables_binary(makefile, done); done[TT_BINARY] = 1; @@ -897,6 +903,7 @@ static int _targets_subdirs(Makefile * makefile) static int _target_objs(Makefile * makefile, String const * target); static int _target_binary(Makefile * makefile, String const * target); +static int _target_command(Makefile * makefile, String const * target); static int _target_library(Makefile * makefile, String const * target); static int _target_library_static(Makefile * makefile, String const * target); static int _target_libtool(Makefile * makefile, String const * target); @@ -919,6 +926,8 @@ static int _targets_target(Makefile * makefile, String const * target) { case TT_BINARY: return _target_binary(makefile, target); + case TT_COMMAND: + return _target_command(makefile, target); case TT_LIBRARY: return _target_library(makefile, target); case TT_LIBTOOL: @@ -1174,6 +1183,20 @@ static void _flags_verilog(Makefile * makefile, String const * target) _makefile_print(makefile, "%c", '\n'); } +static int _target_command(Makefile * makefile, String const * target) +{ + String const * p; + + _makefile_print(makefile, "\n%s:", target); + if((p = _makefile_get_config(makefile, target, "depends")) != NULL + && _makefile_expand(makefile, p) != 0) + return error_print(PROGNAME); + if((p = _makefile_get_config(makefile, target, "command")) == NULL) + return error_print(PROGNAME); + _makefile_print(makefile, "\n\t%s\n", p); + return 0; +} + static int _target_library(Makefile * makefile, String const * target) { String const * p; @@ -2103,6 +2126,8 @@ static int _install_target(Makefile * makefile, String const * target) case TT_BINARY: _install_target_binary(makefile, target); break; + case TT_COMMAND: + break; case TT_LIBRARY: ret = _install_target_library(makefile, target); break; @@ -2572,6 +2597,8 @@ static int _uninstall_target(Makefile * makefile, _makefile_print(makefile, "\t%s%s/%s%s\n", rm_destdir, path, target, "$(EXEEXT)"); break; + case TT_COMMAND: + break; case TT_LIBRARY: if(_uninstall_target_library(makefile, target, path) != 0)