-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (33 loc) · 948 Bytes
/
Makefile
File metadata and controls
47 lines (33 loc) · 948 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
38
39
40
41
42
43
44
45
46
47
##
# @file Makefile
# Make the micro eventlib, lua bindings and tests
#
# $Id$
#
# (C) Copyright 2012 flemming.madsen at madsensoft.dk. See libuevent.h
##
CROSS_COMPILE=
#CROSS_COMPILE=arm-linux-uclibc-
CC=$(CROSS_COMPILE)gcc
AR=$(CROSS_COMPILE)ar
INCLUDE += -I /usr/include/lua5.1/
LDFLAGS=-g
CFLAGS=-fPIC -g -Os $(INCLUDE)
MAJOR = 1
all: libuevent.a libuevent.so.$(MAJOR)
lua: luevent.so
libuevent.a: libuevent.o
$(AR) r $@ $^
libuevent.so.$(MAJOR): libuevent.o
$(CC) $(LDFLAGS) -shared -o $@ $^ -Wl,-soname=libuevent
luevent.so: luevent.o all
$(CC) $(LDFLAGS) -shared -o $@ luevent.o -L . -l uevent -Wl,-soname=luevent
stripped: all lua
$(CROSS_COMPILE)strip --strip-unneeded libuevent.a libuevent.so.$(MAJOR) luevent.so
test: all
$(CC) -g -o test -D NO_DEBUG test.c libuevent.c && ./test
luatest: lua
lua test.lua
clean:
rm -f libuevent.o luevent.o libuevent.so.$(MAJOR) luevent.so test
.PHONY: all test clean luatest lua