From 75587a4de41dbf0bdc8fabdd7b2c39e3a46613a8 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sun, 18 Jun 2023 04:27:22 -0300 Subject: build: standardize clean/distclean targets in src Changes: * clean: remove the same types of files in src/prog.mk and src/so.mk * distclean: remove unused recipes and DISTCLEANFILES variable --- src/prog.mk | 6 +++--- src/so.mk | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/prog.mk b/src/prog.mk index d138fc7ee..5ed706da9 100644 --- a/src/prog.mk +++ b/src/prog.mk @@ -3,7 +3,7 @@ # Note: $(ROOT)/config.mk must be included before this file. # # The includer should probably define PROG and TARGET and may also want to -# define EXTRA_HDRS, EXTRA_OBJS, CLEANFILES and DISTCLEANFILES. +# define EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES. HDRS := $(sort $(wildcard *.h)) $(EXTRA_HDRS) SRCS := $(sort $(wildcard *.c)) @@ -33,7 +33,7 @@ $(PROG): $(OBJS) $(ROOT)/config.mk $(CC) $(PROG_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) .PHONY: clean -clean:; rm -fr *.o $(PROG) *.gcov *.gcda *.gcno *.plist $(CLEANFILES) +clean:; rm -fr $(PROG) $(CLEANFILES) .PHONY: distclean -distclean: clean; rm -fr $(DISTCLEANFILES) +distclean: clean diff --git a/src/so.mk b/src/so.mk index f78f2aea6..ee5d94a0f 100644 --- a/src/so.mk +++ b/src/so.mk @@ -3,7 +3,7 @@ # Note: $(ROOT)/config.mk must be included before this file. # # The includer should probably define SO and TARGET and may also want to define -# EXTRA_HDRS, EXTRA_OBJS, CLEANFILES and DISTCLEANFILES. +# EXTRA_HDRS and EXTRA_OBJS and extend CLEANFILES. HDRS := $(sort $(wildcard *.h)) $(EXTRA_HDRS) SRCS := $(sort $(wildcard *.c)) @@ -28,7 +28,7 @@ $(SO): $(OBJS) $(ROOT)/config.mk $(CC) $(SO_LDFLAGS) -shared -fPIC -z relro $(LDFLAGS) -o $@ $(OBJS) -ldl .PHONY: clean -clean:; rm -fr $(OBJS) $(SO) *.plist $(CLEANFILES) +clean:; rm -fr $(SO) $(CLEANFILES) .PHONY: distclean -distclean: clean; rm -fr $(DISTCLEANFILES) +distclean: clean -- cgit v1.2.3-54-g00ecf