From a0a225558731f105b89c258750ff31600fb0981c Mon Sep 17 00:00:00 2001 From: Anjan Chanda <anjan.chanda@genexis.eu> Date: Tue, 10 Jun 2025 16:08:56 +0200 Subject: [PATCH] install public headers for extension work --- src/Makefile | 11 +++++++++++ src/Makefile.inc | 38 ++++++++++++++++++++++++++++++++++++++ src/cntlr_commands.h | 2 +- src/wifi_opclass.h | 13 ++++++++++--- 4 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 src/Makefile.inc diff --git a/src/Makefile b/src/Makefile index 3372229e..879235a9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -38,6 +38,12 @@ OBJS = \ steer_module.o +INCDIR=/usr/include/map-controller +header-files=cntlr_commands.h cntlr_commands_impl.h \ + wifi_dataelements.h timer.h timer_impl.h \ + cntlr_apis.h wifi_opclass.h steer_module.h \ + utils/debug.h + ifneq (,$(findstring EASYMESH_VENDOR_EXT,$(CFLAGS))) OBJS += cntlr_extension.o endif @@ -83,6 +89,11 @@ plugins: @echo "$(plugin_subdirs)" for i in $(plugin_subdirs); do [ -d $$i ] && CFLAGS="$(CFLAGS)" $(MAKE) -C $$i all; done + +-include Makefile.inc + +install: install-headers install-libs install-bins + install-hooks: $(foreach hook, $(HOOKS), ln -s -f ../../hooks/$(hook) ../.git/hooks/$(hook);) diff --git a/src/Makefile.inc b/src/Makefile.inc new file mode 100644 index 00000000..0fc9c60b --- /dev/null +++ b/src/Makefile.inc @@ -0,0 +1,38 @@ +CP ?= cp -fpPR +INSTALL ?= install +INSTALL_DIR = $(INSTALL) -d -m 755 +INSTALL_BIN = $(INSTALL) -m 755 +INSTALL_DATA = $(INSTALL) -m 644 +INSTALL_CONF = $(INSTALL) -m 600 +INSTALL_LIB = $(CP) + +ROOTDIR:=$(shell pwd) +INCDIR ?= /usr/include +LIBDIR ?= /usr/lib +BINDIR ?= /usr/sbin + +CNTLR_PLUGINS_DIR:=$(DESTDIR)/$(LIBDIR)/mapcontroller + +header-files ?= $(wildcard *.h) +library-files ?= $(wildcard *.so*) +bin-files ?= + + +$(DESTDIR)/$(INCDIR)/%: % + $(INSTALL_DATA) -D $< $@ + +$(DESTDIR)/$(LIBDIR)/%: % + $(INSTALL_DIR) $(DESTDIR)/$(LIBDIR) + $(INSTALL_LIB) $< $@ + +$(DESTDIR)/$(BINDIR)/%: % + $(INSTALL_DIR) $(DESTDIR)/$(BINDIR) + $(INSTALL_BIN) $< $@ + +export + +install-headers: $(addprefix $(DESTDIR)/$(INCDIR)/,$(header-files)) + +install-libs: $(addprefix $(DESTDIR)/$(LIBDIR)/,$(library-files)) + +install-bins: $(addprefix $(DESTDIR)/$(BINDIR)/,$(bin-files)) diff --git a/src/cntlr_commands.h b/src/cntlr_commands.h index fba99d39..e2fbb716 100644 --- a/src/cntlr_commands.h +++ b/src/cntlr_commands.h @@ -12,7 +12,7 @@ #include <stddef.h> -struct blob_attr; +#include "cntlr_commands_impl.h" /** * @defgroup cmdattrs Controller command attributes diff --git a/src/wifi_opclass.h b/src/wifi_opclass.h index ca2366f4..49fecb56 100644 --- a/src/wifi_opclass.h +++ b/src/wifi_opclass.h @@ -4,9 +4,11 @@ #include <stdint.h> #include <stdbool.h> -struct wifi_radio_opclass; -struct wifi_radio_opclass_channel; -struct wifi_radio_opclass_entry; +#include "wifi_dataelements.h" + +#ifdef __cplusplus +extern "C" { +#endif const struct wifi_radio_opclass *wifi_opclass_e4(struct wifi_radio_opclass *dst); @@ -77,4 +79,9 @@ int wifi_opclass_get_max_bw(struct wifi_radio_opclass *opclass, uint8_t *id, uint8_t *channel); uint32_t wifi_opclass_highest_bandwidth(struct wifi_radio_opclass *opclass, bool available_only); + +#ifdef __cplusplus +} +#endif + #endif /* _WIFI_RADIO_OPCLASS_H_ */ -- GitLab