blob: 98f731449e9ce12d04bccad57254af393a25d76a [file] [log] [blame]
Arthur Heymansa29498f2017-01-24 20:27:43 +01001CC:=gcc
2OBJ:=bucts.o
Martin Roth12201142021-02-14 14:32:07 -07003TARGET=bucts
Arthur Heymansa29498f2017-01-24 20:27:43 +01004VERSION:=$(shell git describe)
Martin Roth12201142021-02-14 14:32:07 -07005WERROR=-Werror
6CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR}
Arthur Heymansa29498f2017-01-24 20:27:43 +01007
8ifeq ($(shell uname), FreeBSD)
9 CFLAGS += -I/usr/local/include
10 LDFLAGS += -L/usr/local/lib
11endif
12
Martin Roth12201142021-02-14 14:32:07 -070013all: $(TARGET)
Arthur Heymansa29498f2017-01-24 20:27:43 +010014
Martin Roth12201142021-02-14 14:32:07 -070015$(TARGET): $(OBJ)
Arthur Heymansa29498f2017-01-24 20:27:43 +010016 $(CC) -o $@ $(OBJ) $(LDFLAGS) -lpci
17
18%.o: %.c
19 $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $<
20
Arthur Heymansa29498f2017-01-24 20:27:43 +010021clean:
22 rm -f bucts $(OBJ)
Martin Roth12201142021-02-14 14:32:07 -070023
24distclean: clean
25
26help:
27 @echo "${TARGET}: tool to manipulate the BUC.TS bit on Intel targets."
28 @echo "Targets: all, clean, distclean, help"
29 @echo "To disable warnings as errors, run make as:"
30 @echo " make all WERROR=\"\""
31
32.PHONY: all clean distclean help