diff options
author | bbergeron <[email protected]> | 2024-04-29 18:53:03 -0400 |
---|---|---|
committer | bbergeron <[email protected]> | 2024-04-29 18:53:03 -0400 |
commit | df3d81128887209e083218bf1e3942d13df2e57e (patch) | |
tree | b2e98b7febfc7769ca1b34fe3ca3f5a978032520 /Makefile |
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9482f1a --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +# See LICENSE file for copyright and license details. +.POSIX: + +VERSION ?= 0.1 + +PREFIX ?= /usr/local +MANPREFIX ?= $(PREFIX)/share/man + +CFLAGS = -Wall -pedantic -DMNTRUN_VERSION=\"$(VERSION)\" -std=c99 + +mntrun: main.c mount.c + $(CC) $(CFLAGS) main.c -o mntrun + +clean: + rm mntrun + +install: mntrun + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f mntrun $(DESTDIR)$(PREFIX)/bin + chmod 4755 $(DESTDIR)$(PREFIX)/bin/mntrun + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + sed "s/VERSION/$(VERSION)/g" < mntrun.1 > $(DESTDIR)$(MANPREFIX)/man1/mntrun.1 + chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mntrun.1 + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/bin/mntrun + rm -f $(DESTDIR)$(MANPREFIX)/man1/mntrun.1 + +.PHONY: clean install uninstall |