]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* build.sh: Manage libgnu_a-prefixed source files
authorPaul Smith <psmith@gnu.org>
Sun, 26 Jun 2022 20:35:25 +0000 (16:35 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 9 Jul 2022 14:46:47 +0000 (10:46 -0400)
build.sh

index 5ccf64e301fd0aa196aa5d3adafec6ab3ad08f95..546601ad18dfc6c704d9b4a5459f65d5e361adf9 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -57,7 +57,12 @@ compile ()
 {
   objs=
   for ofile in "$@"; do
+    # We should try to use a Makefile variable like libgnu_a_SOURCES or
+    # something but just hardcode it.
     file="${ofile%.$OBJEXT}.c"
+    case $file in
+        (lib/libgnu_a-*.c) file="lib/${file#lib/libgnu_a-}" ;;
+    esac
     echo "compiling $file..."
     of="$OUTDIR/$ofile"
     mkdir -p "${of%/*}"
@@ -75,10 +80,13 @@ convert ()
   var="GENERATE_$(echo $base | tr 'a-z./+' A-Z__X)"
 
   # Is this file disabled?
-  grep "${var}_FALSE\"]=\"\"" config.status >/dev/null && return
+  grep "${var}_FALSE\"]=\"\"" config.status >/dev/null && return 0
 
-  # Not disabled, so create it
+  # If there's no .in file then no conversion needed
   in="$top_srcdir/lib/$(echo ${base%.*}.in.${base##*.} | tr / _)"
+  test -f "$in" || return 0
+
+  # Not disabled, so create it
   out="$OUTLIB/$base"
   mkdir -p "${out%/*}"