xref: /aosp_15_r20/external/coreboot/util/bucts/Makefile (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1## SPDX-License-Identifier: GPL-2.0-only
2CC:=gcc
3OBJ:=bucts.o
4TARGET=bucts
5VERSION:=$(shell git describe)
6WERROR=-Werror
7CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
8
9ifeq ($(shell uname), FreeBSD)
10	CFLAGS += -I/usr/local/include
11	LDFLAGS += -L/usr/local/lib
12endif
13
14all: $(TARGET)
15
16$(TARGET): $(OBJ)
17	$(CC) -o $@ $(OBJ) $(LDFLAGS) -lpci
18
19%.o: %.c
20	$(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $<
21
22clean:
23	rm -f bucts $(OBJ)
24
25distclean: clean
26
27help:
28	@echo "${TARGET}: tool to manipulate the BUC.TS bit on Intel targets."
29	@echo "Targets: all, clean, distclean, help"
30	@echo "To disable warnings as errors, run make as:"
31	@echo "  make all WERROR=\"\""
32
33.PHONY: all clean distclean help
34