feat: improve makefile

- remove compile rule (implicit)
- no dependency tracking for install/check
This commit is contained in:
psykose 2022-08-11 22:27:56 +00:00
parent 1b32f5da9f
commit 1d084da21b
Signed by: psykose
SSH key fingerprint: SHA256:HwlGVJNLZqHoOvMtkshyGaXLkcdbEJahYMlepHFL+Uk

View file

@ -1,17 +1,20 @@
CC=gcc CC?=gcc
CFLAGS+=-D_GNU_SOURCE CFLAGS+=-D_GNU_SOURCE
LIBS+=-lskarnet LDLIBS+=-lskarnet
BINDIR=/usr/bin PREFIX?=/usr
MANDIR=/usr/share/man BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/share/man
all: fdcreate all: fdcreate
fdcreate: fdcreate.o clean:
$(CC) -o fdcreate fdcreate.o $(LIBS) @rm -f fdcreate fdcreate.o
check: fdcreate check:
./fdcreate test [ -f /proc/self/fd/3 ] ./fdcreate test [ -f /proc/self/fd/3 ]
install: fdcreate install:
install -Dm755 fdcreate -t $(DESTDIR)$(BINDIR) install -Dm755 fdcreate -t $(DESTDIR)$(BINDIR)
install -Dm644 fdcreate.1 -t $(DESTDIR)$(MANDIR)/man1 install -Dm644 fdcreate.1 -t $(DESTDIR)$(MANDIR)/man1
.PHONY := install check clean all