-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
37 lines (30 loc) · 1 KB
/
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
32
33
34
35
36
37
CC ?= cc
RM ?= rm -rf
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m 644
LUA_V ?= 5.4
LUA_LDIR ?= /usr/share/lua/$(LUA_V)
LUA_CDIR ?= /usr/lib/lua/$(LUA_V)
T = lxp
LIBNAME = $(T).so
COMMON_CFLAGS = -g -pedantic -Wall -O2 -fPIC -DPIC
LUA_INC ?= -I/usr/include/lua$(LUA_V)
EXPAT_INC ?= -I/usr/include
CF = $(LUA_INC) $(EXPAT_INC) $(COMMON_CFLAGS) $(CFLAGS)
EXPAT_LIB = -lexpat
COMMON_LDFLAGS = -shared
LF = $(COMMON_LDFLAGS) $(EXPAT_LIB) $(LDFLAGS)
OBJS = src/lxplib.o
lib: src/$(LIBNAME)
src/$(LIBNAME):
export MACOSX_DEPLOYMENT_TARGET="10.3";
$(CC) $(CF) $(RPM_OPT_FLAGS) $(RPM_LD_FLAGS) -o $@ src/$(T)lib.c $(LF)
install:
$(INSTALL_PROGRAM) -D src/$(LIBNAME) $(DESTDIR)$(LUA_CDIR)/$(LIBNAME)
$(INSTALL_DATA) -D src/$T/lom.lua $(DESTDIR)$(LUA_LDIR)/$T/lom.lua
$(INSTALL_DATA) -D src/$T/totable.lua $(DESTDIR)$(LUA_LDIR)/$T/totable.lua
$(INSTALL_DATA) -D src/$T/threat.lua $(DESTDIR)$(LUA_LDIR)/$T/threat.lua
clean:
$(RM) src/$(LIBNAME) $(OBJS)
$(RM) ./$(LIBNAME)