-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (28 loc) · 774 Bytes
/
Makefile
File metadata and controls
37 lines (28 loc) · 774 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
#
LIBNAME =lua-libmemcached
LIBSUFFIX =.so
# common prefix
INCS =-I/usr/local/include -I/usr/include -I/usr/local/include/luvit/luajit -I.
LIBSDIR =-L/usr/local/lib -L/usr/lib
# basic setup
CC =gcc
LIBS =$(LIBSDIR) -lm -lmemcached
OPTS =-O3 -Wall
LIBOPT =-c
SHARE =-shared
CFLAGS =$(LIBOPT) $(OPTS) $(INCS) -fPIC
CFLAGS_LIB =$(SHARE) $(OPTS) $(LIBS) $(INCS)
.PHONY: all release clean debug
all: $(LIBNAME)$(LIBSUFFIX) $(LIBNAME).o
[ -f $(LIBNAME).o ] && \rm $(LIBNAME).o
$(LIBNAME)$(LIBSUFFIX): $(LIBNAME).o
$(CC) -o $@ $^ $(CFLAGS_LIB)
$(LIBNAME).o: $(LIBNAME).c
$(CC) -o $@ $^ $(CFLAGS)
release: $(LIBNAME)$(LIBSUFFIX)
$(if $(shell which strip), strip $<)
$(if $(shell which upx), upx --best $<)
clean:
\rm -f *.o *.dll *.so
debug: CC += -DDEBUG
debug: all