diff --git a/src/Makefile b/src/Makefile index 3372229ead2da687bccc43ae312264c7011628c1..879235a9fd29daae8470f34d38f683208c4bd567 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 0000000000000000000000000000000000000000..0fc9c60bd057b35d382d9c3d10c895c8abcb76c5 --- /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 fba99d39c9b6fc3198cb04dbe8f129b852b2725f..e2fbb716931708200ba27b9fb8ffc436287a3c06 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 ca2366f44191c5cef3839922ad433928fa95dff4..49fecb56da4ddbe7933730cc4d29173188bc61f4 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_ */