Follow-up Comment #9, bug #57676 (project make): make should not claim "cannot make the included makefile" having successfully read the makefile. Here is a patch which fixes the issue.
regards, Dmitry diff --git a/src/makeint.h b/src/makeint.h index c428a36..327849b 100644 --- a/src/makeint.h +++ b/src/makeint.h @@ -566,6 +566,8 @@ void print_dir_data_base (void); void dir_setup_glob (glob_t *); void hash_init_directories (void); +FILE_TIMESTAMP name_mtime (const char *name); + void define_default_variables (void); void undefine_default_variables (void); void set_default_suffixes (void); diff --git a/src/read.c b/src/read.c index db52a55..84e9f97 100644 --- a/src/read.c +++ b/src/read.c @@ -417,6 +417,10 @@ eval_makefile (const char *filename, unsigned short flags) /* Success; clear errno. */ deps->error = 0; + /* Managed to read the file. Update mtime, if needed. + https://savannah.gnu.org/bugs/?57676. */ + if (deps->file->last_mtime == NONEXISTENT_MTIME) + deps->file->last_mtime = name_mtime(deps->file->name); /* Avoid leaking the makefile to children. */ fd_noinherit (fileno (ebuf.fp)); diff --git a/src/remake.c b/src/remake.c index fb237c5..956ca4c 100644 --- a/src/remake.c +++ b/src/remake.c @@ -67,7 +67,6 @@ static enum update_status check_dep (struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make); static enum update_status touch_file (struct file *file); static void remake_file (struct file *file); -static FILE_TIMESTAMP name_mtime (const char *name); static const char *library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr); @@ -1462,7 +1461,7 @@ f_mtime (struct file *file, int search) This causes one duplicate stat() when -L is being used, but the code is much cleaner. */ -static FILE_TIMESTAMP +FILE_TIMESTAMP name_mtime (const char *name) { FILE_TIMESTAMP mtime; _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?57676> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/