commit 984d55a4eb4af8b1de1213078bf5960c63dfb812
parent 3efee8c3a8224f16d8b52c610fd97bb6cf12e6b5
Author: Sebastian <sebastian@sebsite.pw>
Date: Sat, 28 May 2022 22:26:39 -0400
Makefile: don't use var in printf format str
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
3 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/Makefile b/Makefile
@@ -9,15 +9,15 @@ all:
.SUFFIXES: .ha .ssa .s .o .scd .1
.ssa.s:
- @printf 'QBE\t$@\n'
+ @printf 'QBE\t%s\n' "$@"
@$(QBE) -o $@ $<
.s.o:
- @printf 'AS\t$@\n'
+ @printf 'AS\t%s\n' "$@"
@$(AS) -g -o $@ $<
.scd.1:
- @printf 'SCDOC\t$@\n'
+ @printf 'SCDOC\t%s\n' "$@"
@$(SCDOC) < $< > $@
include stdlib.mk
@@ -44,7 +44,7 @@ haredoc_srcs = \
./cmd/haredoc/resolver.ha
$(HARECACHE)/hare.ssa: $(hare_srcs) $(stdlib_deps_any) $(stdlib_deps_$(PLATFORM))
- @printf 'HAREC\t$@\n'
+ @printf 'HAREC\t%s\n' "$@"
@HARECACHE=$(HARECACHE) $(HAREC) $(HAREFLAGS) \
-D PLATFORM:str='"'"$(PLATFORM)"'"' \
-D VERSION:str='"'"$$(./scripts/version)"'"' \
@@ -52,7 +52,7 @@ $(HARECACHE)/hare.ssa: $(hare_srcs) $(stdlib_deps_any) $(stdlib_deps_$(PLATFORM)
-o $@ $(hare_srcs)
$(TESTCACHE)/hare.ssa: $(hare_srcs) $(testlib_deps_any) $(testlib_deps_$(PLATFORM))
- @printf 'HAREC\t$@\n'
+ @printf 'HAREC\t%s\n' "$@"
@HARECACHE=$(TESTCACHE) $(HAREC) $(TESTHAREFLAGS) \
-D PLATFORM:str='"'"$(PLATFORM)"'"' \
-D VERSION:str='"'"$$(./scripts/version)"'"' \
@@ -61,25 +61,25 @@ $(TESTCACHE)/hare.ssa: $(hare_srcs) $(testlib_deps_any) $(testlib_deps_$(PLATFOR
.bin/hare: $(HARECACHE)/hare.o
@mkdir -p .bin
- @printf 'LD\t$@\n'
+ @printf 'LD\t%s\n' "$@"
@$(LD) --gc-sections -T $(rtscript) -o $@ \
$(HARECACHE)/hare.o $(stdlib_deps_any) $(stdlib_deps_$(PLATFORM))
.bin/hare-tests: $(TESTCACHE)/hare.o
@mkdir -p .bin
- @printf 'LD\t$@\n'
+ @printf 'LD\t%s\n' "$@"
@$(LD) -T $(rtscript) -o $@ \
$(TESTCACHE)/hare.o $(testlib_deps_any) $(testlib_deps_$(PLATFORM))
.bin/harec2: .bin/hare $(harec_srcs)
@mkdir -p .bin
- @printf 'HARE\t$@\n'
- @env HAREPATH=. HAREC=$(HAREC) QBE=$(QBE) ./.bin/hare build -o .bin/harec2 ./cmd/harec
+ @printf 'HARE\t%s\n' "$@"
+ @env HAREPATH=. HAREC=$(HAREC) QBE=$(QBE) .bin/hare build -o .bin/harec2 cmd/harec
.bin/haredoc: .bin/hare $(haredoc_srcs)
@mkdir -p .bin
- @printf 'HARE\t$@\n'
- @env HAREPATH=. HAREC=$(HAREC) QBE=$(QBE) ./.bin/hare build \
+ @printf 'HARE\t%s\n' "$@"
+ @env HAREPATH=. HAREC=$(HAREC) QBE=$(QBE) .bin/hare build \
-D HAREPATH:str='"'"$(HAREPATH)"'"' \
-o .bin/haredoc ./cmd/haredoc
diff --git a/scripts/gen-stdlib b/scripts/gen-stdlib
@@ -90,7 +90,7 @@ rt() {
gen_ssa -pfreebsd rt
cat <<EOF
\$($cache)/rt/start.o: \$(STDLIB)/rt/+\$(PLATFORM)/start+\$(ARCH)-libc.s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(PLATFORM)/start+\$(ARCH)-libc.s
@@ -104,46 +104,46 @@ ${stdlib}_asm = \$($cache)/rt/syscall.o \\
\$($cache)/rt/cpuid_native.o
\$($cache)/rt/syscall.o: \$(STDLIB)/rt/+\$(PLATFORM)/syscall+\$(ARCH).s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(PLATFORM)/syscall+\$(ARCH).s
\$($cache)/rt/setjmp.o: \$(STDLIB)/rt/+\$(ARCH)/setjmp.s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/setjmp.s
\$($cache)/rt/longjmp.o: \$(STDLIB)/rt/+\$(ARCH)/longjmp.s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/longjmp.s
\$($cache)/rt/restore.o: \$(STDLIB)/rt/+\$(ARCH)/restore.s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/restore.s
\$($cache)/rt/fenv.o: \$(STDLIB)/rt/+\$(ARCH)/fenv.s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/fenv.s
\$($cache)/rt/getfp.o: \$(STDLIB)/rt/+\$(ARCH)/getfp.s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/getfp.s
\$($cache)/rt/cpuid_native.o: \$(STDLIB)/rt/+\$(ARCH)/cpuid_native.s
- @printf 'AS \t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@mkdir -p \$($cache)/rt
@\$(AS) -o \$@ \$(STDLIB)/rt/+\$(ARCH)/cpuid_native.s
\$($cache)/rt/rt-linux.a: \$($cache)/rt/rt-linux.o \$(${stdlib}_asm)
- @printf 'AR\t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@\$(AR) -csr \$@ \$($cache)/rt/rt-linux.o \$(${stdlib}_asm)
\$($cache)/rt/rt-freebsd.a: \$($cache)/rt/rt-freebsd.o \$(${stdlib}_asm)
- @printf 'AR\t\$@\n'
+ @printf 'AS \t%s\n' "\$@"
@\$(AR) -csr \$@ \$($cache)/rt/rt-freebsd.o \$(${stdlib}_asm)
${stdlib}_rt = \$($cache)/rt/rt-\$(PLATFORM).a
diff --git a/stdlib.mk b/stdlib.mk
@@ -69,7 +69,7 @@ $(HARECACHE)/rt/rt-freebsd.ssa: $(stdlib_rt_freebsd_srcs) $(stdlib_rt)
-t$(HARECACHE)/rt/rt.td $(stdlib_rt_freebsd_srcs)
$(HARECACHE)/rt/start.o: $(STDLIB)/rt/+$(PLATFORM)/start+$(ARCH)-libc.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(PLATFORM)/start+$(ARCH)-libc.s
@@ -83,46 +83,46 @@ stdlib_asm = $(HARECACHE)/rt/syscall.o \
$(HARECACHE)/rt/cpuid_native.o
$(HARECACHE)/rt/syscall.o: $(STDLIB)/rt/+$(PLATFORM)/syscall+$(ARCH).s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(PLATFORM)/syscall+$(ARCH).s
$(HARECACHE)/rt/setjmp.o: $(STDLIB)/rt/+$(ARCH)/setjmp.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/setjmp.s
$(HARECACHE)/rt/longjmp.o: $(STDLIB)/rt/+$(ARCH)/longjmp.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/longjmp.s
$(HARECACHE)/rt/restore.o: $(STDLIB)/rt/+$(ARCH)/restore.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/restore.s
$(HARECACHE)/rt/fenv.o: $(STDLIB)/rt/+$(ARCH)/fenv.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/fenv.s
$(HARECACHE)/rt/getfp.o: $(STDLIB)/rt/+$(ARCH)/getfp.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/getfp.s
$(HARECACHE)/rt/cpuid_native.o: $(STDLIB)/rt/+$(ARCH)/cpuid_native.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(HARECACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/cpuid_native.s
$(HARECACHE)/rt/rt-linux.a: $(HARECACHE)/rt/rt-linux.o $(stdlib_asm)
- @printf 'AR\t$@\n'
+ @printf 'AS \t%s\n' "$@"
@$(AR) -csr $@ $(HARECACHE)/rt/rt-linux.o $(stdlib_asm)
$(HARECACHE)/rt/rt-freebsd.a: $(HARECACHE)/rt/rt-freebsd.o $(stdlib_asm)
- @printf 'AR\t$@\n'
+ @printf 'AS \t%s\n' "$@"
@$(AR) -csr $@ $(HARECACHE)/rt/rt-freebsd.o $(stdlib_asm)
stdlib_rt = $(HARECACHE)/rt/rt-$(PLATFORM).a
@@ -2186,7 +2186,7 @@ $(TESTCACHE)/rt/rt-freebsd.ssa: $(testlib_rt_freebsd_srcs) $(testlib_rt)
-t$(TESTCACHE)/rt/rt.td $(testlib_rt_freebsd_srcs)
$(TESTCACHE)/rt/start.o: $(STDLIB)/rt/+$(PLATFORM)/start+$(ARCH)-libc.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(PLATFORM)/start+$(ARCH)-libc.s
@@ -2200,46 +2200,46 @@ testlib_asm = $(TESTCACHE)/rt/syscall.o \
$(TESTCACHE)/rt/cpuid_native.o
$(TESTCACHE)/rt/syscall.o: $(STDLIB)/rt/+$(PLATFORM)/syscall+$(ARCH).s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(PLATFORM)/syscall+$(ARCH).s
$(TESTCACHE)/rt/setjmp.o: $(STDLIB)/rt/+$(ARCH)/setjmp.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/setjmp.s
$(TESTCACHE)/rt/longjmp.o: $(STDLIB)/rt/+$(ARCH)/longjmp.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/longjmp.s
$(TESTCACHE)/rt/restore.o: $(STDLIB)/rt/+$(ARCH)/restore.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/restore.s
$(TESTCACHE)/rt/fenv.o: $(STDLIB)/rt/+$(ARCH)/fenv.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/fenv.s
$(TESTCACHE)/rt/getfp.o: $(STDLIB)/rt/+$(ARCH)/getfp.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/getfp.s
$(TESTCACHE)/rt/cpuid_native.o: $(STDLIB)/rt/+$(ARCH)/cpuid_native.s
- @printf 'AS \t$@\n'
+ @printf 'AS \t%s\n' "$@"
@mkdir -p $(TESTCACHE)/rt
@$(AS) -o $@ $(STDLIB)/rt/+$(ARCH)/cpuid_native.s
$(TESTCACHE)/rt/rt-linux.a: $(TESTCACHE)/rt/rt-linux.o $(testlib_asm)
- @printf 'AR\t$@\n'
+ @printf 'AS \t%s\n' "$@"
@$(AR) -csr $@ $(TESTCACHE)/rt/rt-linux.o $(testlib_asm)
$(TESTCACHE)/rt/rt-freebsd.a: $(TESTCACHE)/rt/rt-freebsd.o $(testlib_asm)
- @printf 'AR\t$@\n'
+ @printf 'AS \t%s\n' "$@"
@$(AR) -csr $@ $(TESTCACHE)/rt/rt-freebsd.o $(testlib_asm)
testlib_rt = $(TESTCACHE)/rt/rt-$(PLATFORM).a