summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2021-02-13 22:45:18 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-02-16 08:11:40 +0000
commit264e14b143aa4073c6c10df84cffabc5065b8a58 (patch)
tree1049ca869806c8b62f314a97e6a7dc73e80934b4
parent86d6816db21b9d8ecb3ae31f54542f721e893ebc (diff)
util/archive: Clean up Makefile
- Add warnings - Enable warnings as errors: - Add distclean target - Add help target BUG=None TEST=make help; make all; make all WERROR="" Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: I1ae8a837003491f3ab123b3761e220556258e0c5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50652 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
-rw-r--r--util/archive/Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/util/archive/Makefile b/util/archive/Makefile
index 7008cc2020..d4b58f765f 100644
--- a/util/archive/Makefile
+++ b/util/archive/Makefile
@@ -1,14 +1,24 @@
PROGRAM = archive
HOSTCC ?= gcc
+WERROR=-Werror
+CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
SRCS = $(PROGRAM).c
all: $(PROGRAM)
$(PROGRAM): $(SRCS)
- $(HOSTCC) -o $@ $^
+ $(HOSTCC) $(CFLAGS) -o $@ $^
clean:
rm -f $(PROGRAM) *.o
-.PHONY: all clean
+distclean: clean
+
+help:
+ @echo "${PROGRAM}: Concatenate files and create an archive"
+ @echo "Targets: all, clean, distclean, help"
+ @echo "To disable warnings as errors, run make as:"
+ @echo " make all WERROR=\"\""
+
+.PHONY: all clean distclean help