luci-lib-px5g: add missing src Makefile and fix depends
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 9 Jan 2015 12:19:28 +0000 (13:19 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 9 Jan 2015 12:19:28 +0000 (13:19 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
libs/luci-lib-px5g/Makefile
libs/luci-lib-px5g/src/Makefile [new file with mode: 0644]

index 906a1052e33232a369e0e7a140a9ba76bcab9d7e..ee07ba0f5cfdfc2d481df6b4fd5a97acee1e844d 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 LUCI_TITLE:=RSA/X.509 Key Generator (required for LuCId SSL support)
-LUCI_DEPENDS:=+luci-lib-nixio
+LUCI_DEPENDS:=+liblua
 
 include ../../luci.mk
 
diff --git a/libs/luci-lib-px5g/src/Makefile b/libs/luci-lib-px5g/src/Makefile
new file mode 100644 (file)
index 0000000..755565e
--- /dev/null
@@ -0,0 +1,17 @@
+PX5G_CFLAGS = -I. -include polarssl/rsa.h -include polarssl/x509.h -std=gnu99
+PX5G_LDFLAGS = -llua -lm
+PX5G_OBJ = px5g.o library/bignum.o library/havege.o library/rsa.o library/sha1.o library/timing.o library/x509write.o
+PX5G_LIB = px5g.so
+
+%.o: %.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(LUA_CFLAGS) $(PX5G_CFLAGS) $(FPIC) -c -o $@ $<
+
+compile: $(PX5G_OBJ)
+       $(CC) $(LDFLAGS) -shared -o $(PX5G_LIB) $(PX5G_OBJ) $(PX5G_LDFLAGS)
+
+install: compile
+       mkdir -p $(DESTDIR)/usr/lib/lua
+       cp $(PX5G_LIB) $(DESTDIR)/usr/lib/lua/$(PX5G_LIB)
+
+clean:
+       rm -f *.o *.so