-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
31 lines (22 loc) · 869 Bytes
/
Makefile
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
CC ?= cc
CFLAGS=-O2 -I/usr/local/include
EXECUTABLE=bloom
LIBS=-levent -L/usr/local/lib
PKGCONF=pkg-config
OBJ=bloom.o sighandlers.o bf_storage.o util.o bf_ops.o commands.o handler.o bf_hash.o md6_nist.o md6_mode.o md6_compress.o
DEPS=globals.h sighandlers.h bf_storage.h bf_types.h util.h bf_ops.h commands.h handler.h bf_hash.h md6.h md6_nist.h
PREFIX=/usr/local
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJ)
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS) `$(PKGCONF) --libs libevent`
static: $(EXECUTABLE).static
$(EXECUTABLE).static: $(OBJ)
$(CC) -static -static-libgcc $(CFLAGS) -o $@ $(OBJ) $(LIBS) `$(PKGCONF) --static --libs libevent`
bloom.o: bloom.c $(DEPS) globals.c
$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.c $(DEPS)
$(CC) -c $(CFLAGS) -o $@ $<
clean:
rm -f $(EXECUTABLE) $(EXECUTABLE).static *.o
install: $(EXECUTABLE)
install -m 775 $(EXECUTABLE) $(PREFIX)/bin