forked from DanielAdolfsson/ndppd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 899 Bytes
/
Makefile
File metadata and controls
38 lines (29 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
ifdef DEBUG
CFLAGS ?= -g -DDEBUG
else
CFLAGS ?= -Os
LDFLAGS ?= -s -w
endif
PREFIX ?= /usr/local
CC ?= gcc
GZIP ?= /bin/gzip
MANDIR ?= ${DESTDIR}${PREFIX}/share/man
SBINDIR ?= ${DESTDIR}${PREFIX}/sbin
ASCIIDOCTOR ?= /usr/bin/asciidoctor
CFLAGS := ${CFLAGS} -Werror -Wall -Wextra -Wno-missing-braces -Wno-missing-field-initializers -Wno-address-of-packed-member
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
all: ndppd ndppd.8.gz ndppd.conf.5.gz
install: all
mkdir -p ${SBINDIR} ${MANDIR} ${MANDIR}/man8 ${MANDIR}/man5
cp ndppd ${SBINDIR}
chmod +x ${SBINDIR}/ndppd
cp ndppd.8.gz ${MANDIR}/man8
cp ndppd.conf.5.gz ${MANDIR}/man5
%.gz: %.adoc
${ASCIIDOCTOR} -b manpage $< -o - | ${GZIP} > $@
ndppd: ${OBJS}
${CC} -o ndppd ${LDFLAGS} ${OBJS} ${LIBS}
%.o: %.c
${CC} -c ${CPPFLAGS} $(CFLAGS) -o $@ $<
clean:
rm -f ndppd ndppd.conf.5.gz ndppd.8.gz ${OBJS}