Merge pull request #2746 from mrdudz/bequiet

Fix -s vs QUIET in the makefiles
This commit is contained in:
Bob Andrews
2025-06-27 16:43:13 +02:00
committed by GitHub
46 changed files with 552 additions and 140 deletions

View File

@@ -16,6 +16,15 @@ else
RMDIR = $(RM) -r $1
endif
ifeq ($(SILENT),s)
QUIET := 1
endif
ifdef QUIET
PQ = "QUIET=1"
PD = --no-print-directory
endif
WORKDIR = ../testwrk/asm
.PHONY: all continue mostlyclean clean
@@ -23,20 +32,20 @@ WORKDIR = ../testwrk/asm
all: mostlyclean continue
continue: mostlyclean
@$(MAKE) -C cpudetect all
@$(MAKE) -C opcodes all
@$(MAKE) -C listing all
@$(MAKE) -C val all
@$(MAKE) -C err all
@$(MAKE) -C misc all
@$(MAKE) $(PD) -C cpudetect all $(PQ)
@$(MAKE) $(PD) -C opcodes all $(PQ)
@$(MAKE) $(PD) -C listing all $(PQ)
@$(MAKE) $(PD) -C val all $(PQ)
@$(MAKE) $(PD) -C err all $(PQ)
@$(MAKE) $(PD) -C misc all $(PQ)
mostlyclean:
@$(MAKE) -C cpudetect clean
@$(MAKE) -C opcodes clean
@$(MAKE) -C listing clean
@$(MAKE) -C val clean
@$(MAKE) -C err clean
@$(MAKE) -C misc clean
@$(MAKE) $(PD) -C cpudetect clean $(PQ)
@$(MAKE) $(PD) -C opcodes clean $(PQ)
@$(MAKE) $(PD) -C listing clean $(PQ)
@$(MAKE) $(PD) -C val clean $(PQ)
@$(MAKE) $(PD) -C err clean $(PQ)
@$(MAKE) $(PD) -C misc clean $(PQ)
clean: mostlyclean
@$(call RMDIR,$(WORKDIR))

View File

@@ -20,8 +20,14 @@ else
RMDIR = $(RM) -r $1
endif
ifdef QUIET
.SILENT:
NULLOUT = >$(NULLDEV)
NULLERR = 2>$(NULLDEV)
ifndef CMD_EXE
CATERR = 2> $(WORKDIR)/$$@.errlog || (cat $(WORKDIR)/$$@.errlog && false)
endif
endif
CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)
@@ -52,8 +58,8 @@ define CPUDETECT_template
$(WORKDIR)/$1-cpudetect.bin: cpudetect.s $1-cpudetect.ref $(ISEQUAL)
$(if $(QUIET),echo asm/$1-cpudetect.bin)
$(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$<
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib
$(CA65) -t none --cpu $1 -l $$(@:.bin=.lst) -o $$(@:.bin=.o) $$< $(CATERR)
$(LD65) -t none -o $$@ $$(@:.bin=.o) none.lib $(CATERR)
$(ISEQUAL) $1-cpudetect.ref $$@
endef # CPUDETECT_template
@@ -61,7 +67,7 @@ endef # CPUDETECT_template
$(foreach cpu,$(CPUDETECT_CPUS),$(eval $(call CPUDETECT_template,$(cpu))))
$(WORKDIR)/%.o: %.s | $(WORKDIR)
$(CA65) -l $(@:.o=.lst) -o $@ $<
$(CA65) -l $(@:.o=.lst) -o $@ $< $(NULLOUT) $(CATERR)
clean:
@$(call RMDIR,$(WORKDIR))

View File

@@ -26,7 +26,11 @@ endif
ifdef QUIET
.SILENT:
NULLOUT = >$(NULLDEV)
NULLERR = 2>$(NULLDEV)
ifndef CMD_EXE
CATERR = 2> $(WORKDIR)/$$@.errlog || (cat $(WORKDIR)/$$@.errlog && false)
endif
endif
CA65 := $(if $(wildcard ../../../bin/ca65*),..$S..$S..$Sbin$Sca65,ca65)

View File

@@ -17,6 +17,7 @@ ifdef CMD_EXE
RMDIR = -rmdir /q /s $(subst /,\,$1)
TRUE = exit 0
CAT = type $(subst /,\,$1)
NULLDEV = nul:
else
S = /
EXE =
@@ -24,10 +25,16 @@ else
RMDIR = $(RM) -r $1
TRUE = true
CAT = cat $1
NULLDEV = /dev/null
endif
ifdef QUIET
# .SILENT:
.SILENT:
NULLOUT = >$(NULLDEV)
NULLERR = 2>$(NULLDEV)
ifndef CMD_EXE
CATERR = 2> $(WORKDIR)/$$@.errlog || (cat $(WORKDIR)/$$@.errlog && false)
endif
endif
CA65 := $(if $(wildcard ../../../bin/ca65*),..$S..$S..$Sbin$Sca65,ca65)
@@ -82,48 +89,52 @@ endif
endif
ifneq ($(wildcard ref/$1.err-ref),)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.err)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.err) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.err)
$(ISEQUAL) --empty $$(@:.bin=.err) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.err2-ref),)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.err2)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.err2) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.err2)
$(ISEQUAL) --empty $$(@:.bin=.err2) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.bin-ref),)
$(ISEQUAL) --binary ref/$1.bin-ref $$@
$(ISEQUAL) --binary ref/$1.bin-ref $$@ $(NULLERR)
endif
# rem $(indfo $(CAT) $(subst /,$$S,$$$(@:.bin=.ld65-err)))
ifneq ($(wildcard ref/$1.ld65err-ref),)
ifndef QUIET
@echo $(CAT) $$(@:.bin=.ld65-err)
# FIXME: somehow this refuses to work in cmd.exe
ifndef CMD_EXE
$(call CAT,$$(@:.bin=.ld65-err))
-diff -u ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.ld65-err)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.ld65-err) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.ld65-err),)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err) $(NULLERR)
endif
endif
ifneq ($(wildcard ref/$1.ld65err2-ref),)
ifndef QUIET
@echo $(CAT) $$(@:.bin=.ld65-err2)
# FIXME: somehow this refuses to work in cmd.exe
ifndef CMD_EXE
$(call CAT,$$(@:.bin=.ld65-err2))
-diff -u ref/$1.ld65err2-ref $$(@:.bin=.ld65-err2)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.ld65-err2)
endif
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.ld65-err2) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.ld65-err2),)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err2)
$(ISEQUAL) --empty $$(@:.bin=.ld65-err2) $(NULLERR)
endif
endif
@@ -149,37 +160,37 @@ endif
endif
ifneq ($(wildcard ref/$1.err-ref),)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.list-err)
$(ISEQUAL) ref/$1.err-ref $$(@:.bin=.list-err) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.list-err)
$(ISEQUAL) --empty $$(@:.bin=.list-err) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.ld65err-ref),)
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.list-ld65-err)
$(ISEQUAL) --wildcards ref/$1.ld65err-ref $$(@:.bin=.list-ld65-err) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.list-ld65-err),)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err) $(NULLERR)
endif
endif
ifneq ($(wildcard ref/$1.err2-ref),)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.list-err2)
$(ISEQUAL) ref/$1.err2-ref $$(@:.bin=.list-err2) $(NULLERR)
else
$(ISEQUAL) --empty $$(@:.bin=.list-err2)
$(ISEQUAL) --empty $$(@:.bin=.list-err2) $(NULLERR)
endif
ifneq ($(wildcard ref/$1.ld65err2-ref),)
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.list-ld65-err2)
$(ISEQUAL) --wildcards ref/$1.ld65err2-ref $$(@:.bin=.list-ld65-err2) $(NULLERR)
else
ifneq ($(wildcard $(WORKDIR)/$1.list-ld65-err2),)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err2)
$(ISEQUAL) --empty $$(@:.bin=.list-ld65-err2) $(NULLERR)
endif
endif
# check if the result bin is the same as without listing file
ifeq ($(wildcard control/$1.err),)
ifeq ($(wildcard control/$1.err2),)
$(ISEQUAL) $$@ $$(@:.bin=.list-bin)
$(ISEQUAL) $$@ $$(@:.bin=.list-bin) $(NULLERR)
endif
endif
@@ -187,7 +198,7 @@ ifneq ($(wildcard ref/$1.list-ref),)
# we have a reference file, compare that, too
# remove first line which contains a version number
$(ISEQUAL) --skip=1 ref/$1.list-ref $$(@:.bin=.list-lst)
$(ISEQUAL) --skip=1 ref/$1.list-ref $$(@:.bin=.list-lst) $(NULLERR)
endif
endef # LISTING_template

View File

@@ -30,6 +30,9 @@ ifdef QUIET
.SILENT:
NULLOUT = >$(NULLDEV)
NULLERR = 2>$(NULLDEV)
ifndef CMD_EXE
CATERR = 2> $(WORKDIR)/$$@.errlog || (cat $(WORKDIR)/$$@.errlog && false)
endif
endif
SIM65FLAGS = -x 200000000

View File

@@ -22,6 +22,11 @@ endif
ifdef QUIET
.SILENT:
NULLOUT = >$(NULLDEV)
NULLERR = 2>$(NULLDEV)
ifndef CMD_EXE
CATERR = 2> $(WORKDIR)/$$@.errlog || (cat $(WORKDIR)/$$@.errlog && false)
endif
endif
CA65 := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)

View File

@@ -51,8 +51,8 @@ define PRG_template
$(WORKDIR)/%.$1.prg: %.s | $(WORKDIR)
$(if $(QUIET),echo asm/val/$$*.$1.prg)
$(CA65) -t sim$1 -o $$(@:.prg=.o) $$< $(NULLERR)
$(LD65) -C sim6502-asmtest.cfg -o $$@ $$(@:.prg=.o) sim$1.lib $(NULLERR)
$(CA65) -t sim$1 -o $$(@:.prg=.o) $$< $(NULLOUT) $(NULLERR)
$(LD65) -C sim6502-asmtest.cfg -o $$@ $$(@:.prg=.o) sim$1.lib $(NULLOUT) $(NULLERR)
$(SIM65) $(SIM65FLAGS) $$@ $(NULLOUT)
endef # PRG_template