aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-07-14 09:56:59 +0000
committerJohn Crispin <blogic@openwrt.org>2015-07-14 09:56:59 +0000
commitfe2d481b93d5066c12c887db37ae0d3820b930e2 (patch)
tree2b77901e084d0244c0918efef46c0f930b41474c
parent2c793fead68f663d7b7ffef9dfc0434abb7e60d0 (diff)
downloadmaster-187ad058-fe2d481b93d5066c12c887db37ae0d3820b930e2.tar.gz
master-187ad058-fe2d481b93d5066c12c887db37ae0d3820b930e2.tar.bz2
master-187ad058-fe2d481b93d5066c12c887db37ae0d3820b930e2.zip
swconfig: Split libsw out of swconfig for reuse in other packages
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46358 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/network/config/swconfig/Makefile9
-rw-r--r--package/network/config/swconfig/src/Makefile9
2 files changed, 15 insertions, 3 deletions
diff --git a/package/network/config/swconfig/Makefile b/package/network/config/swconfig/Makefile
index 7d0f30e7bb..3c2ec3e387 100644
--- a/package/network/config/swconfig/Makefile
+++ b/package/network/config/swconfig/Makefile
@@ -42,9 +42,18 @@ define Build/Compile
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
diff --git a/package/network/config/swconfig/src/Makefile b/package/network/config/swconfig/src/Makefile
index 0d56f43156..1176bf0e40 100644
--- a/package/network/config/swconfig/src/Makefile
+++ b/package/network/config/swconfig/src/Makefile
@@ -6,7 +6,10 @@ LIBS=-lnl -lnl-genl
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