swconfig: replace the shared library with a static one

Reduces binary size

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2016-12-13 13:15:05 +01:00
parent e175a4d4f1
commit e82c8d6e20
2 changed files with 5 additions and 5 deletions

View File

@ -42,13 +42,12 @@ define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/swlib.h $(1)/usr/include/ $(CP) $(PKG_BUILD_DIR)/swlib.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libsw.so $(1)/usr/lib/ $(CP) $(PKG_BUILD_DIR)/libsw.a $(1)/usr/lib/
endef endef
define Package/swconfig/install define Package/swconfig/install
$(INSTALL_DIR) $(1)/sbin $(1)/lib/network $(INSTALL_DIR) $(1)/sbin $(1)/lib/network
$(INSTALL_BIN) $(PKG_BUILD_DIR)/swconfig $(1)/sbin/swconfig $(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/ $(INSTALL_DATA) ./files/switch.sh $(1)/lib/network/
endef endef

View File

@ -8,8 +8,9 @@ all: swconfig
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) -fPIC -c -o $@ $^ $(CC) $(CFLAGS) -fPIC -c -o $@ $^
libsw.so: swlib.o libsw.a: swlib.o
$(CC) $(CFLAGS) -fPIC -shared -o $@ swlib.o $(AR) rcu $@ swlib.o
$(RANLIB) $@
swconfig: libsw.so cli.o uci.o swconfig: libsw.a cli.o uci.o
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -L./ -lsw $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -L./ -lsw