commit efc6e5941647b9e76e5d45cce3735f5278353497
parent fe800e4efb67e6a5babcf2b5f51e764387501cc9
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 31 Oct 2024 21:59:34 +0100
build/libc: Fix amd64 Makefiles
Chaining of inference rules is not portable and it is better
to make explicit command lines.
Diffstat:
6 files changed, 26 insertions(+), 34 deletions(-)
diff --git a/src/libc/arch/amd64/darwin/Makefile b/src/libc/arch/amd64/darwin/Makefile
@@ -16,18 +16,17 @@ GENOBJS =\
__sigaction.$O\
__write.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
OBJS =\
$(GENOBJS)\
_sys_errlist.$O\
all: $(OBJS) $(CRT)
-crt.$O: ../crt-posix.s
+$(CRT): ../crt-posix.s
-$(GENSRC): syscall.lst
- ./gensys.sh $(@:.s=)
+$(GENOBJS): syscall.lst
+ ./gensys.sh $(@:.$O=)
+ $(AS) $(PROJ_ASFLAGS) $(@:.$O=.s)
clean:
- rm -f $(GENSRC) _sys_errlist.c
+ rm -f $(GENOBJS:.$O=.s) _sys_errlist.c
diff --git a/src/libc/arch/amd64/dragonfly/Makefile b/src/libc/arch/amd64/dragonfly/Makefile
@@ -20,16 +20,13 @@ OBJS =\
$(GENOBJS)\
_sys_errlist.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
-# Rules
-
all: $(OBJS) $(CRT)
-crt.$O: ../crt-posix.s
+$(CRT): ../crt-posix.s
-$(GENSRC): syscall.lst
- ./gensys.sh $(@:.s=)
+$(GENOBJS): syscall.lst
+ ./gensys.sh $(@:.$O=)
+ $(AS) $(PROJ_ASFLAGS) $(@:.$O=.s)
clean:
- rm -f $(GENSRC) _sys_errlist.c
+ rm -f $(GENOBJS:.$O=.s) _sys_errlist.c
diff --git a/src/libc/arch/amd64/freebsd/Makefile b/src/libc/arch/amd64/freebsd/Makefile
@@ -11,14 +11,13 @@ OBJS =\
$(GENOBJS)\
_sys_errlist.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
all: $(OBJS) $(CRT)
$(CRT): ../crt-posix.s
-$(GENSRC): syscall.lst
- ./gensys.sh $(@:.s=)
+$(GENOBJS): syscall.lst
+ ./gensys.sh $(@:.$O=)
+ $(AS) $(PROJ_ASFLAGS) $(@:.$O=.s)
clean:
- rm -f $(GENSRC) _sys_errlist.c
+ rm -f $(GENOBJS:.$O=.s) _sys_errlist.c
diff --git a/src/libc/arch/amd64/linux/Makefile b/src/libc/arch/amd64/linux/Makefile
@@ -31,14 +31,13 @@ OBJS =\
_cerrno.$O\
_sys_errlist.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
all: $(OBJS) $(CRT)
$(CRT): ../crt-posix.s
-$(GENSRC): syscall.lst
- ./gensys.sh $(@:.s=)
+$(GENOBJS): syscall.lst
+ ./gensys.sh $(@:.$O=)
+ $(AS) $(PROJ_ASFLAGS) $(@:.$O=.s)
clean:
- rm -f $(GENSRC) _sys_errlist.c
+ rm -f $(GENOBJS:.$O=.s) _sys_errlist.c
diff --git a/src/libc/arch/amd64/netbsd/Makefile b/src/libc/arch/amd64/netbsd/Makefile
@@ -24,14 +24,13 @@ OBJS =\
$(GENOBJS)\
_sys_errlist.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
all: $(OBJS) $(CRT)
crt.$O: ../crt-posix.s ../netbsd/crt.s
-$(GENSRC): syscall.lst
- ./gensys.sh $(@:.s=)
+$(GENOBJS): syscall.lst
+ ./gensys.sh $(@:.$O=)
+ $(AS) $(PROJ_ASFLAGS) $(@:.$O=.s)
clean:
- rm -f $(GENSRC) _sys_errlist.c
+ rm -f $(GENOBJS:.$O=.s) _sys_errlist.c
diff --git a/src/libc/arch/amd64/openbsd/Makefile b/src/libc/arch/amd64/openbsd/Makefile
@@ -28,14 +28,13 @@ OBJS =\
$(GENOBJS)\
_sys_errlist.$O\
-GENSRC = $(GENOBJS:.$O=.s)
-
all: $(OBJS) $(CRT)
$(CRT): ../crt-posix.s ../openbsd/crt.s
-$(GENSRC): syscall.lst
- ./gensys.sh $(@:.s=)
+$(GENOBJS): syscall.lst
+ ./gensys.sh $(@:.$O=)
+ $(AS) $(PROJ_ASFLAGS) $(@:.$O=.s)
clean:
- rm -f $(GENSRC) _sys_errlist.c
+ rm -f $(GENOBJS:.$O=.s) _sys_errlist.c