Author: blogic
Date: 2015-07-14 11:56:59 +0200 (Tue, 14 Jul 2015)
New Revision: 46358

Modified:
   trunk/package/network/config/swconfig/Makefile
   trunk/package/network/config/swconfig/src/Makefile
Log:
swconfig: Split libsw out of swconfig for reuse in other packages

Signed-off-by: Helmut Schaa <[email protected]>
Signed-off-by: Helmut Schaa <[email protected]>

Modified: trunk/package/network/config/swconfig/Makefile
===================================================================
--- trunk/package/network/config/swconfig/Makefile      2015-07-14 09:12:29 UTC 
(rev 46357)
+++ trunk/package/network/config/swconfig/Makefile      2015-07-14 09:56:59 UTC 
(rev 46358)
@@ -42,9 +42,18 @@
                LIBS="$(TARGET_LDFLAGS) -lnl-tiny -lm -luci"
 endef
 
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_BUILD_DIR)/swlib.h $(1)/usr/include/
+
+       $(INSTALL_DIR) $(1)/lib
+       $(CP) $(PKG_BUILD_DIR)/libsw.so $(1)/lib/
+endef
+
 define Package/swconfig/install
        $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/libsw.so $(1)/lib
        $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
 endef
 

Modified: trunk/package/network/config/swconfig/src/Makefile
===================================================================
--- trunk/package/network/config/swconfig/src/Makefile  2015-07-14 09:12:29 UTC 
(rev 46357)
+++ trunk/package/network/config/swconfig/src/Makefile  2015-07-14 09:56:59 UTC 
(rev 46358)
@@ -6,7 +6,10 @@
 all: swconfig
 
 %.o: %.c
-       $(CC) $(CFLAGS) -c -o $@ $^
+       $(CC) $(CFLAGS) -fPIC -c -o $@ $^
 
-swconfig: cli.o swlib.o uci.o
-       $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+libsw.so: swlib.o
+       $(CC) $(CFLAGS) -fPIC -shared -o $@ swlib.o
+
+swconfig: libsw.so cli.o uci.o
+       $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -L./ -lsw
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to