summaryrefslogtreecommitdiff
path: root/util/bucts
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2021-02-14 14:32:07 -0700
committerPatrick Georgi <pgeorgi@google.com>2021-02-25 10:03:00 +0000
commit122011453d9d805cb487e98d377c26db6812f031 (patch)
tree2d38ab6a869fbb769d61da116fa4a6cb9c74b0f2 /util/bucts
parent90a43067dda7a0c330b8a29a08ab3de6d1eae695 (diff)
downloadcoreboot-122011453d9d805cb487e98d377c26db6812f031.tar.xz
util/bucts: Clean up Makefile to match others
- Add a TARGET variable - Enable optimization and additional warnings - Add distclean target - Add help target Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: I8eb190abd1ab20da7dd1ae43ef0358ba91df000e Reviewed-on: https://review.coreboot.org/c/coreboot/+/50847 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'util/bucts')
-rw-r--r--util/bucts/Makefile19
1 files changed, 15 insertions, 4 deletions
diff --git a/util/bucts/Makefile b/util/bucts/Makefile
index 3bc73ee3d6..98f731449e 100644
--- a/util/bucts/Makefile
+++ b/util/bucts/Makefile
@@ -1,21 +1,32 @@
CC:=gcc
OBJ:=bucts.o
+TARGET=bucts
VERSION:=$(shell git describe)
-CFLAGS+=-Wall
+WERROR=-Werror
+CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
ifeq ($(shell uname), FreeBSD)
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
endif
-all: bucts
+all: $(TARGET)
-bucts: $(OBJ)
+$(TARGET): $(OBJ)
$(CC) -o $@ $(OBJ) $(LDFLAGS) -lpci
%.o: %.c
$(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $<
-.PHONY: clean
clean:
rm -f bucts $(OBJ)
+
+distclean: clean
+
+help:
+ @echo "${TARGET}: tool to manipulate the BUC.TS bit on Intel targets."
+ @echo "Targets: all, clean, distclean, help"
+ @echo "To disable warnings as errors, run make as:"
+ @echo " make all WERROR=\"\""
+
+.PHONY: all clean distclean help