Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (36 sloc) 1.01 KB
# [g]make USE_xxxx=1
#
# USE_SHARED_CACHE : enable/disable a shared session cache (disabled by default)
DESTDIR =
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man
CFLAGS = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE
LDFLAGS = -lssl -lcrypto -lev
OBJS = stud.o ringbuffer.o
all: realall
# Shared cache feature
ifneq ($(USE_SHARED_CACHE),)
CFLAGS += -DUSE_SHARED_CACHE -DUSE_SYSCALL_FUTEX
OBJS += shctx.o ebtree/libebtree.a
ALL += ebtree
ebtree/libebtree.a: $(wildcard ebtree/*.c)
make -C ebtree
ebtree:
@[ -d ebtree ] || ( \
echo "*** Download libebtree at http://1wt.eu/tools/ebtree/" ; \
echo "*** Untar it and make a link named 'ebtree' to point on it"; \
exit 1 )
endif
ALL += stud
realall: $(ALL)
stud: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
install: $(ALL)
install -d $(DESTDIR)$(BINDIR)
install stud $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(MANDIR)/man8
install -m 644 stud.8 $(DESTDIR)$(MANDIR)/man8
clean:
rm -f stud $(OBJS)
.PHONY: all realall