summaryrefslogtreecommitdiff
path: root/util/nvmutil/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'util/nvmutil/Makefile')
-rw-r--r--util/nvmutil/Makefile33
1 files changed, 14 insertions, 19 deletions
diff --git a/util/nvmutil/Makefile b/util/nvmutil/Makefile
index 91b5ba1c..22376c70 100644
--- a/util/nvmutil/Makefile
+++ b/util/nvmutil/Makefile
@@ -3,33 +3,28 @@
# SPDX-FileCopyrightText: 2023 Riku Viitanen <riku.viitanen@protonmail.com>
CC?=cc
-CFLAGS?=-Os -Wall -Wextra -Werror -pedantic
+CFLAGS?=-Os -Wall -Wextra -Werror -pedantic -std=c99
DESTDIR?=
PREFIX?=/usr/local
INSTALL?=install
-# nvm is the old binary name,
-# but it was renamed to nvmutil
-# to avoid conflict with a certain
-# package manager by that name!
+PROG=nvmutil
-nvm: nvmutil.c
- rm -f nvm
- $(CC) $(CFLAGS) nvmutil.c -o nvmutil
+all: $(PROG)
-install:
- $(INSTALL) nvmutil $(DESTDIR)$(PREFIX)/bin/nvmutil
+$(PROG): nvmutil.c
+ $(CC) $(CFLAGS) nvmutil.c -o $(PROG)
-# do not delete *bin/nvm because
-# there is a package manager by
-# that name. this makefile now
-# treats nvmutil as the binary
+install: $(PROG)
+ mkdir -p $(DESTDIR)$(PREFIX)/bin/
+ install $(PROG) $(DESTDIR)$(PREFIX)/bin/
uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/nvmutil
-
-distclean:
- rm -f nvm nvmutil
+ rm -f $(DESTDIR)$(PREFIX)/bin/$(PROG)
clean:
- rm -f nvm nvmutil
+ rm -f $(PROG)
+
+distclean: clean
+
+.PHONY: all install uninstall clean distclean