File tree 2 files changed +27
-11
lines changed
2 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 1
- CFLAGS = -fPIC -O3 -Wall -std=c99 -pedantic
2
- CFLAGS += $(INC )
3
-
4
1
INC = -Isrc
5
2
6
3
ifdef LUAPATH
7
4
INC += -I$(LUAPATH)
8
5
endif
9
6
10
- LFLAGS = -shared
7
+ UNAME_S := $( shell uname -s)
11
8
12
- NEWT_SRC = src/luanewt.c src/luanewt.h
13
- NEWT_SO = newt.so
14
- NEWT_LIB = -lnewt
9
+ ifeq ($(UNAME_S ) , Darwin)
10
+ INC += -I/usr/local/include
11
+ NEWT_LIB = -L/usr/local/lib -lnewt
12
+ SHARED_LIB = -dynamiclib -Wl,-undefined,dynamic_lookup
13
+ else
14
+ NEWT_LIB = -lnewt
15
+ SHARED_LIB = -shared
16
+ endif
15
17
18
+ CFLAGS = -fPIC -O3 -Wall -std=c99 -pedantic
19
+ CFLAGS += $(INC )
20
+
21
+ NEWT_SO = newt.so
16
22
17
23
all : $(NEWT_SO )
18
24
19
- $(NEWT_SO ) : $( NEWT_SRC )
20
- $(CC ) $(LFLAGS ) -o $@ $(CFLAGS ) $< $(NEWT_LIB )
25
+ $(NEWT_SO ) : src/luanewt.c src/luanewt.h
26
+ $(CC ) $(SHARED_LIB ) -o $@ $(CFLAGS ) $< $(NEWT_LIB )
21
27
22
28
clean :
23
29
$(RM ) $(NEWT_SO )
Original file line number Diff line number Diff line change 1
1
# a newt binding library for Lua 5.3
2
2
3
- this is a simple [ newt] [ newt ] binding library for lua 5.3,
4
- it is fork from [ luanewt] [ luanewt ] .
3
+ This is a simple [ newt] [ newt ] binding library for lua 5.3, fork from [ luanewt] [ luanewt ] .
4
+
5
+ It has been tested only on Mac OS X and Centos 6.
6
+
7
+ ## build
8
+
9
+ 1 . install deps
10
+
11
+ MacOS: ` brew install newt `
12
+ CentOS: ` yum install -y newt-devel `
13
+
14
+ 2 . make
5
15
6
16
## TODO
7
17
You can’t perform that action at this time.
0 commit comments