diff options
author | rofl0r <retnyg@gmx.net> | 2014-07-10 18:23:28 +0200 |
---|---|---|
committer | rofl0r <retnyg@gmx.net> | 2014-07-10 18:23:28 +0200 |
commit | 9c8309d4e129a994141871ffc5825b4f616c0b21 (patch) | |
tree | f76f69fcceabfa12f52e68fcb1adc691e9299d68 /Makefile | |
parent | 80f68a7bfc41e4c27c291e3c152870e215fdbb2d (diff) | |
download | libnl-tiny-9c8309d4e129a994141871ffc5825b4f616c0b21.tar.gz |
move files into toplevel dir
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 80 |
1 files changed, 28 insertions, 52 deletions
@@ -1,52 +1,28 @@ -# -# Copyright (C) 2006-2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=libnl-tiny -PKG_VERSION:=0.1 -PKG_RELEASE:=3 - -include $(INCLUDE_DIR)/package.mk - -define Package/libnl-tiny - SECTION:=libs - CATEGORY:=Libraries - TITLE:=netlink socket library -endef - -define Package/libnl-tiny/description - This package contains a stripped down version of libnl -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) - $(CP) ./src/* $(PKG_BUILD_DIR)/ -endef - -TARGET_CFLAGS += $(FPIC) - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS)" \ - all -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(1)/usr/include/libnl-tiny - $(CP) $(PKG_BUILD_DIR)/include/* $(1)/usr/include/libnl-tiny - $(CP) $(PKG_BUILD_DIR)/libnl-tiny.so $(1)/usr/lib/ - $(CP) ./files/libnl-tiny.pc $(1)/usr/lib/pkgconfig -endef - -define Package/libnl-tiny/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_BUILD_DIR)/libnl-tiny.so $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,libnl-tiny)) +prefix=/usr/local +CC=gcc +WFLAGS=-Wall +CFLAGS?=-O2 +INCLUDES=-Iinclude + +LIBNAME=libnl-tiny.so + +-include config.mak + +all: $(LIBNAME) + +%.o: %.c + $(CC) $(WFLAGS) -c -o $@ $(INCLUDES) $(CFLAGS) $< + +LIBNL_OBJ=nl.o handlers.o msg.o attr.o cache.o cache_mngt.o object.o socket.o error.o +GENL_OBJ=genl.o genl_family.o genl_ctrl.o genl_mngt.o unl.o + +$(LIBNAME): $(LIBNL_OBJ) $(GENL_OBJ) + $(CC) -shared -o $@ $^ + +libnl-tiny.a: $(LIBNL_OBJ) $(GENL_OBJ) + ar rc $@ $^ + ranlib libnl-tiny.a + +libnl-tiny.pc: libnl-tiny.pc.in + sed s,@prefix@,$(prefix),g $< > $@ + |