blob: d32258d1ec660b20bf741b2536502d9572eb7046 [file] [log] [blame]
Martin Rothadaab4a2022-10-28 22:38:44 -06001## SPDX-License-Identifier: GPL-2.0-only
Arthur Heymansa29498f2017-01-24 20:27:43 +01002CC:=gcc
3OBJ:=bucts.o
Martin Roth12201142021-02-14 14:32:07 -07004TARGET=bucts
Arthur Heymansa29498f2017-01-24 20:27:43 +01005VERSION:=$(shell git describe)
Martin Roth12201142021-02-14 14:32:07 -07006WERROR=-Werror
7CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
Arthur Heymansa29498f2017-01-24 20:27:43 +01008
9ifeq ($(shell uname), FreeBSD)
10 CFLAGS += -I/usr/local/include
11 LDFLAGS += -L/usr/local/lib
12endif
13
Martin Roth12201142021-02-14 14:32:07 -070014all: $(TARGET)
Arthur Heymansa29498f2017-01-24 20:27:43 +010015
Martin Roth12201142021-02-14 14:32:07 -070016$(TARGET): $(OBJ)
Arthur Heymansa29498f2017-01-24 20:27:43 +010017 $(CC) -o $@ $(OBJ) $(LDFLAGS) -lpci
18
19%.o: %.c
20 $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $<
21
Arthur Heymansa29498f2017-01-24 20:27:43 +010022clean:
23 rm -f bucts $(OBJ)
Martin Roth12201142021-02-14 14:32:07 -070024
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