34 lines
839 B
Makefile
34 lines
839 B
Makefile
DESTDIR ?=
|
|
PREFIX ?= /usr/local
|
|
EXEC_PREFIX ?= $(PREFIX)
|
|
BINDIR ?= $(DESTDIR)$(EXEC_PREFIX)/bin
|
|
DATAROOTDIR ?= $(PREFIX)/share
|
|
MANDIR ?= $(DATAROOTDIR)/man
|
|
|
|
CFLAGS += -std=c11 -Os -g -Wall -Wextra -pedantic
|
|
CPPFLAGS +=
|
|
LDFLAGS +=
|
|
|
|
all: pidfilewrapper setruid
|
|
|
|
pidfilewrapper: pidfilewrapper.c
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
|
|
|
|
setruid: setruid.c
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $<
|
|
|
|
.PHONY: all install uninstall clean distclean
|
|
|
|
install: all pidfilewrapper.1 setruid.1
|
|
mkdir -p $(BINDIR)
|
|
install pidfilewrapper setruid $(BINDIR)
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
|
cp pidfilewrapper.1 setruid.1 $(DESTDIR)$(MANDIR)/man1
|
|
|
|
uninstall:
|
|
rm -f $(BINDIR)/pidfilewrapper $(BINDIR)/setruid $(DESTDIR)$(MANDIR)/man1/pidfilewrapper.1 $(DESTDIR)$(MANDIR)/man1/setruid.1
|
|
|
|
clean:
|
|
rm -f pidfilewrapper
|
|
|
|
distclean: clean
|