From c7299d9c862cccf92b0036678bba715bba69ef0d Mon Sep 17 00:00:00 2001 From: Carsten Schoenert Date: Tue, 13 Jan 2015 21:52:50 +0100 Subject: [PATCH] adding install target for public header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To develop something libcoap related people need the public header files to include the function definitions into their projects. The public libcoap headers will be installed into the system by the current order like . └── include    └── coap    ├── address.h    ├── async.h    ├── bits.h    ├── block.h    ├── coap.h    ├── coap_io.h    ├── coap_time.h    ├── debug.h    ├── encode.h    ├── hashkey.h    ├── mem.h    ├── net.h    ├── option.h    ├── pdu.h    ├── prng.h    ├── resource.h    ├── str.h    ├── subscribe.h    ├── t_list.h    ├── uri.h    ├── uthash.h    └── utlist.h That's not final! Currently the public header files include the locally by the autoconf generated coap_config.h header file. These includes have to be removed before we can call the header really public headers! --- Makefile.am | 2 ++ configure.ac | 6 ++++-- include/Makefile.am | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 include/Makefile.am diff --git a/Makefile.am b/Makefile.am index 2a8bc4bb..a331fabf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,8 @@ # This file is part of the CoAP C library libcoap. Please see README and # COPYING for terms of use. +SUBDIRS = include + ## Place generated object files (.o) into the same directory as their source ## files, in order to avoid collisions when non-recursive make is used. AUTOMAKE_OPTIONS = subdir-objects diff --git a/configure.ac b/configure.ac index 179e1c11..4fac3b55 100644 --- a/configure.ac +++ b/configure.ac @@ -37,8 +37,10 @@ AC_FUNC_MALLOC AC_CHECK_FUNCS([memset select socket strcasecmp strrchr getaddrinfo \ strnlen]) -# Override the various template files, currently just one makefile. -AC_CONFIG_FILES([Makefile]) +# Override the various template files, currently just makefiles. +AC_CONFIG_FILES([ +Makefile +include/Makefile]) AC_OUTPUT diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 00000000..29ae624d --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,32 @@ +## Makefile.am for include/ + +## Define the list of public header files and their install location. The +## nobase_ prefix instructs Automake to not strip the directory part from each +## filename, in order to avoid the need to define separate file lists for each +## installation directory. This only works if the directory hierarchy in the +## source tree matches the hierarchy at the install location, however. +libcoap_includedir = $(includedir) +nobase_libcoap_include_HEADERS = \ + coap/address.h \ + coap/async.h \ + coap/bits.h \ + coap/block.h \ + coap/coap.h \ + coap/coap_io.h \ + coap/coap_time.h \ + coap/debug.h \ + coap/encode.h \ + coap/hashkey.h \ + coap/mem.h \ + coap/net.h \ + coap/option.h \ + coap/pdu.h \ + coap/prng.h \ + coap/resource.h \ + coap/str.h \ + coap/subscribe.h \ + coap/t_list.h \ + coap/uri.h \ + coap/uthash.h \ + coap/utlist.h +# lwipppools.h