feat: improve makefile #1
1 changed files with 11 additions and 8 deletions
19
Makefile
19
Makefile
|
@ -1,17 +1,20 @@
|
|||
CC=gcc
|
||||
CC?=gcc
|
||||
CFLAGS+=-D_GNU_SOURCE
|
||||
LIBS+=-lskarnet
|
||||
BINDIR=/usr/bin
|
||||
MANDIR=/usr/share/man
|
||||
LDLIBS+=-lskarnet
|
||||
PREFIX?=/usr
|
||||
BINDIR=$(PREFIX)/bin
|
||||
MANDIR=$(PREFIX)/share/man
|
||||
|
||||
all: fdcreate
|
||||
|
||||
fdcreate: fdcreate.o
|
||||
$(CC) -o fdcreate fdcreate.o $(LIBS)
|
||||
clean:
|
||||
@rm -f fdcreate fdcreate.o
|
||||
|
||||
check: fdcreate
|
||||
check:
|
||||
./fdcreate test [ -f /proc/self/fd/3 ]
|
||||
|
||||
install: fdcreate
|
||||
install:
|
||||
install -Dm755 fdcreate -t $(DESTDIR)$(BINDIR)
|
||||
install -Dm644 fdcreate.1 -t $(DESTDIR)$(MANDIR)/man1
|
||||
|
||||
.PHONY := install check clean all
|
||||
|
|
Loading…
Reference in a new issue