projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix lua plugin linking
[project/uci.git]
/
lua
/
Makefile
diff --git
a/lua/Makefile
b/lua/Makefile
index
29d7fbd
..
9b6e728
100644
(file)
--- a/
lua/Makefile
+++ b/
lua/Makefile
@@
-1,27
+1,26
@@
-CC=gcc
-LD=ld
-CFLAGS=-O2 -Wall -Werror -pedantic --std=gnu99 -Wno-unused
-CPPFLAGS=-I..
-LIBS=-L.. -luci
-OS=$(shell uname)
-LINK=$(CC)
+include ../Makefile.inc
+
+CPPFLAGS=-I.. $(shell pkg-config --silence-errors --cflags lua5.1)
+LIBS=-L.. -luci $(shell pkg-config --silence-errors --libs lua5.1)
+
+PLUGIN_LD=$(CC)
ifeq ($(OS),Darwin)
ifeq ($(OS),Darwin)
-
SHLIB_
FLAGS=-bundle -undefined dynamic_lookup
+
PLUGIN_LD
FLAGS=-bundle -undefined dynamic_lookup
else
else
-
SHLIB_
FLAGS=-shared -Wl,-soname,$(SHLIB_FILE)
+
PLUGIN_LD
FLAGS=-shared -Wl,-soname,$(SHLIB_FILE)
endif
all: uci.so
uci.so: uci.o
endif
all: uci.so
uci.so: uci.o
- $(
LINK) $(SHLIB_
FLAGS) -o $@ $^ $(LIBS)
+ $(
PLUGIN_LD) $(PLUGIN_LD
FLAGS) -o $@ $^ $(LIBS)
%.o: %.c
%.o: %.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CPPFLAGS) $(CFLAGS)
$(FPIC)
-c -o $@ $<
install:
install:
- mkdir -p $(DESTDIR)
/usr/lib/lua
-
install -m0644 uci.so $(DESTDIR)/usr/lib/lua
/
+ mkdir -p $(DESTDIR)
$(prefix)/lib/lua/5.1
+
$(INSTALL) -m0644 uci.so $(DESTDIR)$(prefix)/lib/lua/5.1
/
clean:
rm -f *.so *.o uci.so
clean:
rm -f *.so *.o uci.so