Martin Roth | adaab4a | 2022-10-28 22:38:44 -0600 | [diff] [blame] | 1 | ## SPDX-License-Identifier: GPL-2.0-only |
Arthur Heymans | a29498f | 2017-01-24 20:27:43 +0100 | [diff] [blame] | 2 | CC:=gcc |
| 3 | OBJ:=bucts.o |
Martin Roth | 1220114 | 2021-02-14 14:32:07 -0700 | [diff] [blame] | 4 | TARGET=bucts |
Arthur Heymans | a29498f | 2017-01-24 20:27:43 +0100 | [diff] [blame] | 5 | VERSION:=$(shell git describe) |
Martin Roth | 1220114 | 2021-02-14 14:32:07 -0700 | [diff] [blame] | 6 | WERROR=-Werror |
| 7 | CFLAGS=-O2 -Wall -Wextra -Wshadow ${WERROR} |
Arthur Heymans | a29498f | 2017-01-24 20:27:43 +0100 | [diff] [blame] | 8 | |
| 9 | ifeq ($(shell uname), FreeBSD) |
| 10 | CFLAGS += -I/usr/local/include |
| 11 | LDFLAGS += -L/usr/local/lib |
| 12 | endif |
| 13 | |
Martin Roth | 1220114 | 2021-02-14 14:32:07 -0700 | [diff] [blame] | 14 | all: $(TARGET) |
Arthur Heymans | a29498f | 2017-01-24 20:27:43 +0100 | [diff] [blame] | 15 | |
Martin Roth | 1220114 | 2021-02-14 14:32:07 -0700 | [diff] [blame] | 16 | $(TARGET): $(OBJ) |
Arthur Heymans | a29498f | 2017-01-24 20:27:43 +0100 | [diff] [blame] | 17 | $(CC) -o $@ $(OBJ) $(LDFLAGS) -lpci |
| 18 | |
| 19 | %.o: %.c |
| 20 | $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $< |
| 21 | |
Arthur Heymans | a29498f | 2017-01-24 20:27:43 +0100 | [diff] [blame] | 22 | clean: |
| 23 | rm -f bucts $(OBJ) |
Martin Roth | 1220114 | 2021-02-14 14:32:07 -0700 | [diff] [blame] | 24 | |
| 25 | distclean: clean |
| 26 | |
| 27 | help: |
| 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 |