forked from jmslocum/ifstats
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 738 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (27 loc) · 738 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
CC = gcc
CFLAGS = --std=gnu99 -Wall -O3
OBJS = ifstats.o
PREFIX ?= /usr/local
BIN = $(DESTDIR)$(PREFIX)/bin
LIB = $(DESTDIR)$(PREFIX)/lib
INCLUDE = $(DESTDIR)$(PREFIX)/include
MAN = $(DESTDIR)$(PREFIX)/share/man/man3
all: staticlib
staticlib: $(OBJS)
ar -cr libifstats.a $(OBJS)
test: ifstats.c ifstats.h
$(CC) -c -DIFSTATS_TEST $(CFLAGS) -o ifstats.o ifstats.c
$(CC) $(CFLAGS) $(OBJS) -o ifstatstest
install:
cp libifstats.a $(LIB)
cp ifstats.h $(INCLUDE)
mkdir -p $(MAN)
install -g 0 -o 0 -m 644 man/ifstats.3 $(MAN)
gzip -f $(MAN)/ifstats.3
ln -f -s $(MAN)/ifstats.3.gz $(MAN)/getIfStats.3.gz
ln -f -s $(MAN)/ifstats.3.gz $(MAN)/releaseStats.3.gz
clean:
-rm -f *.o
-rm -f *.a
-rm -f ifstatstest
.PHONY : test clean