Skip to contentSkip to conversation

fsverity-utils Makefile fixes

PATCH New Jes Sorensen 1 participant 3 messages May 20, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover fsverity-utils Makefile fixes

From: Jes Sorensen <[email protected]>

Hi,

This addresses the last comments, leaving the CPPFLAGS as override. I checked that it doesn't break the rpm build as well.

Cheers,
Jes

Jes Sorensen (2):
Fix Makefile to delete objects from the library on make clean Let package manager override CFLAGS and CPPFLAGS

 Makefile | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH v3 1/2 Fix Makefile to delete objects from the library on make clean

From: Jes Sorensen <[email protected]>

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 1a7be53..e7fb5cf 100644
@@ -180,8 +180,8 @@ help:
 	done
 
 clean:
-	rm -f $(DEFAULT_TARGETS) $(TEST_PROGRAMS) $(LIB_OBJS) $(ALL_PROG_OBJ) \
-		.build-config
+	rm -f $(DEFAULT_TARGETS) $(TEST_PROGRAMS) \
+		lib/*.o programs/*.o .build-config
 
 FORCE:
 
Signature · 1 line
2.26.2
#2 lore raw

PATCH v3 2/2 Let package manager override CFLAGS and CPPFLAGS

In reply to Jes Sorensen

From: Jes Sorensen <[email protected]>

Package managers such as RPM wants to build everything with their preferred flags, and we shouldn't hard override flags.

---
 Makefile | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Makefile +2 -6
index e7fb5cf..18f08c3 100644
@@ -29,16 +29,12 @@
 cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \
 	      then echo $(1); fi)
 
-#### Common compiler flags.  You can add additional flags by defining CFLAGS
-#### and/or CPPFLAGS in the environment or on the 'make' command line.
-
-override CFLAGS := -O2 -Wall -Wundef				\
+CFLAGS := -O2 -Wall -Wundef				\
 	$(call cc-option,-Wdeclaration-after-statement)		\
 	$(call cc-option,-Wmissing-prototypes)			\
 	$(call cc-option,-Wstrict-prototypes)			\
 	$(call cc-option,-Wvla)					\
-	$(call cc-option,-Wimplicit-fallthrough)		\
-	$(CFLAGS)
+	$(call cc-option,-Wimplicit-fallthrough)
 
 override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
 
Signature · 1 line
2.26.2