luci-lib-luaneightbl: add src Makefile and fix dependencies (#282)
[project/luci.git] / libs / luci-lib-luaneightbl / src / Makefile
diff --git a/libs/luci-lib-luaneightbl/src/Makefile b/libs/luci-lib-luaneightbl/src/Makefile
new file mode 100644 (file)
index 0000000..f856d2f
--- /dev/null
@@ -0,0 +1,17 @@
+NEIGHTBL_CFLAGS = -std=gnu99
+NEIGHTBL_LDFLAGS = -llua -lm
+NEIGHTBL_OBJ = neightbl.o
+NEIGHTBL_LIB = neightbl.so
+
+%.o: %.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LUA_CFLAGS) $(NEIGHTBL_CFLAGS) $(FPIC) -c -o $@ $<
+
+compile: $(NEIGHTBL_OBJ)
+       $(CC) $(LDFLAGS) -shared -o $(NEIGHTBL_LIB) $(NEIGHTBL_OBJ) $(NEIGHTBL_LDFLAGS)
+
+install: compile
+       mkdir -p $(DESTDIR)/usr/lib/lua
+       cp $(NEIGHTBL_LIB) $(DESTDIR)/usr/lib/lua/$(NEIGHTBL_LIB)
+
+clean:
+       rm -f *.o *.so