forked from askyrme/luaproc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.14 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Makefile for building luaproc
# lua version
LUA_VERSION=5.3
# path to lua header files
LUA_INCDIR=/usr/include/lua${LUA_VERSION}
# path to lua library
LUA_LIBDIR=/usr/lib/x86_64-linux-gnu/
# path to install library
LUA_CPATH=/usr/lib/lua/${LUA_VERSION}
# standard makefile variables
CC=gcc
SRCDIR=src
BINDIR=bin
THREADS=-DLUAPROC_USE_PTHREADS
CFLAGS=-c -O2 -Wall -fPIC -I${LUA_INCDIR} ${THREADS}
# MacOS X users should replace LIBFLAG with the following definition
# LIBFLAG=-bundle -undefined dynamic_lookup
LIBFLAG=-shared
#
LDFLAGS=${LIBFLAG} -L${LUA_LIBDIR} -lpthread
SOURCES=${SRCDIR}/lpsched.c ${SRCDIR}/luaproc.c
OBJECTS=${SOURCES:.c=.o}
# luaproc specific variables
LIBNAME=luaproc
LIB=${LIBNAME}.so
# build targets
all: ${BINDIR}/${LIB}
${BINDIR}/${LIB}: ${OBJECTS}
${CC} $^ -o $@ ${LDFLAGS}
lpsched.o: lpsched.c lpsched.h luaproc.h lpthread.h
${CC} ${CFLAGS} $^
luaproc.o: luaproc.c luaproc.h lpsched.h lpthread.h
${CC} ${CFLAGS} $^
install:
cp -v ${BINDIR}/${LIB} ${LUA_CPATH}
clean:
rm -f ${OBJECTS} ${BINDIR}/${LIB}
# list targets that do not create files (but not all makes understand .PHONY)
.PHONY: clean install
# (end of Makefile)