OSDN Git Service

Enable remake of lost LIBIMPL object files.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 18 Nov 2014 19:47:32 +0000 (19:47 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 18 Nov 2014 19:47:32 +0000 (19:47 +0000)
mingwrt/ChangeLog
mingwrt/Makefile.in

index 372c0ea..85a2e9f 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Enable remake of lost LIBIMPL object files.
+
+       * Makefile.in (libimpl_remake): New macro; define it, and...
+       (%.libimpl.$OBJEXT) [%.libimpl exists]: ...use it in build rule.
+
 2014-11-17  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Implement more robust _get_output_format fallback handling.
index 9555cbc..b6738c5 100644 (file)
@@ -564,9 +564,15 @@ LIBIMPL_CFLAGS = $(CFLAGS) $(INCLUDES) -fno-align-functions
        > $@
 
 # ...and ultimately discarded, after the requisite object file
-# has been compiled.
+# has been compiled; (note that this creates a vulnerability due
+# to possible loss of the object file, while the tracking file is
+# still in place; to circumvent this, we must be able to force a
+# remake of the tracking file, so also regenerating the .c file,
+# before it is compiled).
 #
+libimpl_remake = { $(RM) $1; $(MAKE) --no-print-directory $1; }
 %.libimpl.$(OBJEXT): %.libimpl
+       test -f $<.c || $(call libimpl_remake,$<)
        $(CC) -c $(CPPFLAGS) $(LIBIMPL_CFLAGS) -o $@ $<.c
        $(RM) $<.c