Merge pull request #2755 from mrdudz/quietagain

Some more Makefile woes
This commit is contained in:
Bob Andrews
2025-06-30 00:15:19 +02:00
committed by GitHub
17 changed files with 112 additions and 18 deletions

View File

@@ -4,11 +4,29 @@ ifneq ($(SILENT),s)
$(info Using Makefile: $(realpath $(firstword $(MAKEFILE_LIST))) $(MAKECMDGOALS)) $(info Using Makefile: $(realpath $(firstword $(MAKEFILE_LIST))) $(MAKECMDGOALS))
endif endif
.PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util checkstyle check .PHONY: all mostlyclean clean install zip avail unavail bin lib doc html info samples test util checkstyle check checkprefix
.SUFFIXES: .SUFFIXES:
all install zip: all:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
@$(MAKE) checkprefix --no-print-directory
zip:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@
@$(MAKE) -C util --no-print-directory $@
@$(MAKE) -C samples --no-print-directory $@
install:
ifndef PREFIX
$(error Error: PREFIX must be set for install to work)
endif
@$(MAKE) -C src --no-print-directory $@ @$(MAKE) -C src --no-print-directory $@
@$(MAKE) -C libsrc --no-print-directory $@ @$(MAKE) -C libsrc --no-print-directory $@
@$(MAKE) -C doc --no-print-directory $@ @$(MAKE) -C doc --no-print-directory $@
@@ -24,9 +42,17 @@ mostlyclean clean:
@$(MAKE) -C test --no-print-directory $@ @$(MAKE) -C test --no-print-directory $@
@$(MAKE) -C targettest --no-print-directory $@ @$(MAKE) -C targettest --no-print-directory $@
avail unavail bin: avail unavail:
# FIXME: actually not true, PREFIX is ignored?
#ifndef PREFIX
# $(error Error: PREFIX must be set for avail/unavail to work)
#endif
@$(MAKE) -C src --no-print-directory $@ @$(MAKE) -C src --no-print-directory $@
bin:
@$(MAKE) -C src --no-print-directory $@
@$(MAKE) checkprefix --no-print-directory
lib libtest: lib libtest:
@$(MAKE) -C libsrc --no-print-directory $@ @$(MAKE) -C libsrc --no-print-directory $@
@@ -45,6 +71,11 @@ util:
%: %:
@$(MAKE) -C libsrc --no-print-directory $@ @$(MAKE) -C libsrc --no-print-directory $@
checkprefix:
ifndef PREFIX
$(warning Warning: PREFIX is empty - make install will not work)
endif
# check the code style # check the code style
checkstyle: checkstyle:
@$(MAKE) -C .github/checks --no-print-directory $@ @$(MAKE) -C .github/checks --no-print-directory $@

View File

@@ -101,6 +101,11 @@ ifdef CROSS_COMPILE
endif endif
all bin: $(PROGS) all bin: $(PROGS)
ifeq ($(MAKELEVEL),0)
ifndef PREFIX
$(warning Warning: PREFIX is empty - make install will not work)
endif
endif
mostlyclean: mostlyclean:
$(call RMDIR,../wrk) $(call RMDIR,../wrk)

View File

@@ -55,6 +55,9 @@ ifdef QUIET
.SILENT: .SILENT:
PQ = "QUIET=1" PQ = "QUIET=1"
PD = --no-print-directory PD = --no-print-directory
ifndef CMD_EXE
CATERR = 2> $$@.errlog || (cat $$@.errlog && false)
endif
endif endif
ifneq ($(filter disk testcode.%,$(MAKECMDGOALS)),) ifneq ($(filter disk testcode.%,$(MAKECMDGOALS)),)
@@ -131,12 +134,12 @@ DISK_atarixl = testcode.atr
.c.o: .c.o:
$(if $(QUIET),echo $(SYS):$*.c) $(if $(QUIET),echo $(SYS):$*.c)
$(CC) $(CFLAGS) -Ors --codesize 500 -T -g -t $(SYS) $< $(CC) $(CFLAGS) -Ors --codesize 500 -T -g -t $(SYS) $< $(CATERR)
$(AS) $(<:.c=.s) $(AS) $(<:.c=.s) $(CATERR)
.s.o: .s.o:
$(if $(QUIET),echo $(SYS):$*.s) $(if $(QUIET),echo $(SYS):$*.s)
$(AS) $(ASFLAGS) -t $(SYS) $< $(AS) $(ASFLAGS) -t $(SYS) $< $(CATERR)
.PRECIOUS: %.o .PRECIOUS: %.o

View File

@@ -20,6 +20,9 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:

View File

@@ -24,6 +24,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -28,6 +28,10 @@ else
NULLDEV = /dev/null NULLDEV = /dev/null
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -26,6 +26,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -20,6 +20,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -22,6 +22,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -22,6 +22,10 @@ else
NULLDEV = /dev/null NULLDEV = /dev/null
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -24,6 +24,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -26,6 +26,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -27,6 +27,10 @@ else
COPY = cp $1 $2 COPY = cp $1 $2
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -22,6 +22,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -24,6 +24,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -24,6 +24,10 @@ else
RMDIR = $(RM) -r $1 RMDIR = $(RM) -r $1
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)

View File

@@ -24,6 +24,10 @@ else
CATRES = > $(WORKDIR)/$$@.out 2> $(WORKDIR)/$$@.out || (cat $(WORKDIR)/$$@.out && false) CATRES = > $(WORKDIR)/$$@.out 2> $(WORKDIR)/$$@.out || (cat $(WORKDIR)/$$@.out && false)
endif endif
ifeq ($(SILENT),s)
QUIET = 1
endif
ifdef QUIET ifdef QUIET
.SILENT: .SILENT:
NULLOUT = >$(NULLDEV) NULLOUT = >$(NULLDEV)