-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathMakefile
48 lines (39 loc) · 863 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
CFLAGS=-g -Wall
# CFLAGS+=-DDEBUGLOG
LUAINC?=`pkgconf lua --cflags`
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
SHARED=--shared -fPIC
SO=so
LIBS=-lpthread
else ifeq ($(UNAME), Darwin)
SO=so
SHARED= -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup
else
# Windows
LIBS=-lwinmm -lws2_32 -D_WIN32_WINNT=0x0601 -lntdll
SHARED=--shared
SO=dll
LUALIB?=`pkgconf lua --libs`
endif
all : ltask.$(SO)
SRCS=\
src/ltask.c \
src/queue.c \
src/sysinfo.c \
src/service.c \
src/config.c \
src/lua-seri.c \
src/message.c \
src/systime.c \
src/timer.c \
src/sysapi.c \
src/logqueue.c \
src/debuglog.c \
src/threadsig.c
ltask.$(SO) : $(SRCS)
$(CC) $(CFLAGS) $(SHARED) $(LUAINC) -Isrc -o $@ $^ $(LUALIB) $(LIBS)
seri.$(SO) : src/lua-seri.c
$(CC) $(CFLAGS) $(SHARED) $(LUAINC) -Isrc -o $@ $^ $(LUALIB) -D TEST_SERI
clean :
rm -rf *.$(SO)