summaryrefslogtreecommitdiff
path: root/util/nvmutil/Makefile
blob: 3d2be47e50a35c490c9d1e18f14d72d9c36b1736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2022,2026 Leah Rowe <leah@libreboot.org>
# SPDX-FileCopyrightText: 2023 Riku Viitanen <riku.viitanen@protonmail.com>

CC?=cc
CFLAGS?=-Os -Wall -Wextra -Werror -pedantic -std=c99 -D_POSIX_C_SOURCE=200809L
DESTDIR?=
PREFIX?=/usr/local
INSTALL?=install

BIN=nvmutil

$(BIN): nvmutil.c
	$(CC) $(CFLAGS) nvmutil.c -o $(BIN)

install: $(BIN)
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	$(INSTALL) $(BIN) $(DESTDIR)$(PREFIX)/bin/

uninstall:
	rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)

clean:
	rm -f $(BIN)

distclean: clean

.PHONY: install uninstall clean distclean