handle -s and QUIET accordingly in libsrc too. those who never used make -s before might start doing it now :)

This commit is contained in:
mrdudz
2025-06-26 23:18:35 +02:00
parent 261180577c
commit 703b166b29

View File

@@ -8,6 +8,16 @@ ifneq ($(shell echo),)
CMD_EXE = 1 CMD_EXE = 1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET
.SILENT:
PQ = "QUIET=1"
PD = --no-print-directory
endif
CBMS = c128 \ CBMS = c128 \
c16 \ c16 \
c64 \ c64 \
@@ -134,7 +144,7 @@ zip:
$(foreach dir,$(OUTPUTDIRS),$(ZIP_recipe)) $(foreach dir,$(OUTPUTDIRS),$(ZIP_recipe))
$(TARGETS): | ../lib $(TARGETS): | ../lib
@$(MAKE) --no-print-directory $@ @$(MAKE) $(PD) $@ $(PQ)
# ../lib must be created globally before doing lib targets in parallel # ../lib must be created globally before doing lib targets in parallel
../lib: ../lib:
@@ -259,8 +269,8 @@ $1_DYNS = $$(patsubst $$($1_SRCPAT),$$($1_DYNPAT),$$($1_SRCS))
$1_DRVS = $$(patsubst $$($1_DYNPAT),$$($1_DRVPAT),$$($1_DYNS)) $1_DRVS = $$(patsubst $$($1_DYNPAT),$$($1_DRVPAT),$$($1_DYNS))
$$($1_STCPAT): $$($1_SRCPAT) $$($1_STCPAT): $$($1_SRCPAT)
@echo $$(TARGET) - $$< - static $$(if $$(QUIET),@echo $$(TARGET) - $$< - static)
@$$(CA65) -t $$(TARGET) -D DYN_DRV=0 $$(CA65FLAGS) --create-dep $$(@:.o=.d) -o $$@ $$< $$(CA65) -t $$(TARGET) -D DYN_DRV=0 $$(CA65FLAGS) --create-dep $$(@:.o=.d) -o $$@ $$<
OBJS += $$($1_STCS) OBJS += $$($1_STCS)
DEPS += $$($1_STCS:.o=.d) DEPS += $$($1_STCS:.o=.d)
@@ -268,8 +278,8 @@ DEPS += $$($1_STCS:.o=.d)
$$($1_DYNS): | $$($1_DYNDIR) $$($1_DYNS): | $$($1_DYNDIR)
$$($1_DRVPAT): $$($1_DYNPAT) $$(ZPOBJ) | $$($1_DRVDIR) $$($1_DRVPAT): $$($1_DYNPAT) $$(ZPOBJ) | $$($1_DRVDIR)
@echo $$(TARGET) - $$(<F) $$(if $$(QUIET),@echo $$(TARGET) - $$(<F))
@$$(LD65) -o $$@ -t module $$^ $$(LD65) -o $$@ -t module $$^
$$($1_DYNDIR) $$($1_DRVDIR): $$($1_DYNDIR) $$($1_DRVDIR):
@$$(call MKDIR,$$@) @$$(call MKDIR,$$@)
@@ -291,16 +301,16 @@ export CC65_HOME := $(abspath ..)
define ASSEMBLE_recipe define ASSEMBLE_recipe
$(if $(QUIET),,@echo $(TARGET) - $<) $(if $(QUIET),@echo $(TARGET) - $<)
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $< $(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
endef # ASSEMBLE_recipe endef # ASSEMBLE_recipe
define COMPILE_recipe define COMPILE_recipe
$(if $(QUIET),,@echo $(TARGET) - $<) $(if $(QUIET),@echo $(TARGET) - $<)
@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $< $(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s) $(CA65) -t $(TARGET) -o $@ $(@:.o=.s)
endef # COMPILE_recipe endef # COMPILE_recipe
@@ -311,12 +321,13 @@ endef # COMPILE_recipe
$(COMPILE_recipe) $(COMPILE_recipe)
$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../libwrk/$(TARGET) ../lib $(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../libwrk/$(TARGET) ../lib
@echo $(TARGET) - $(<F) $(if $(QUIET),@echo $(TARGET) - $(<F))
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:../lib/%.o=../libwrk/$(TARGET)/%.d) -o $@ $< @$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:../lib/%.o=../libwrk/$(TARGET)/%.d) -o $@ $<
$(EXTRA_OBJS): | ../lib $(EXTRA_OBJS): | ../lib
../lib/$(TARGET).lib: $(OBJS) | ../lib ../lib/$(TARGET).lib: $(OBJS) | ../lib
$(if $(QUIET),@echo $(TARGET) - $<)
$(AR65) a $@ $? $(AR65) a $@ $?
../libwrk/$(TARGET) ../target/$(TARGET)/util: ../libwrk/$(TARGET) ../target/$(TARGET)/util: