Skip to content

Commit

Permalink
Join recursive Makefile.am in a top level Makefile.am
Browse files Browse the repository at this point in the history
Recursive Makefiles are considered harmfull (http://aegis.sourceforge.net/auug97.pdf)

Signed-off-by: Guilherme Maciel Ferreira <[email protected]>
  • Loading branch information
guilhermeferreira committed Apr 3, 2017
1 parent 2c2df37 commit 5642ecc
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 192 deletions.
131 changes: 126 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,140 @@
# Guilherme Maciel Ferreira - initial contribuition
#*******************************************************************************/

AUTOMAKE_OPTIONS = subdir-objects color-tests
ACLOCAL_AMFLAGS = -I m4

###############################################################################
# Sub directories
# Library: name
###############################################################################

SUBDIRS = src
SUBDIRS += src/mqtt
lib_LTLIBRARIES = libpaho-mqttpp3.la

###############################################################################
# Library: source code
###############################################################################

libpaho_mqttpp3_la_SOURCES = src/async_client.cpp
libpaho_mqttpp3_la_SOURCES += src/client.cpp
libpaho_mqttpp3_la_SOURCES += src/disconnect_options.cpp
libpaho_mqttpp3_la_SOURCES += src/iclient_persistence.cpp
libpaho_mqttpp3_la_SOURCES += src/message.cpp
libpaho_mqttpp3_la_SOURCES += src/response_options.cpp
libpaho_mqttpp3_la_SOURCES += src/token.cpp
libpaho_mqttpp3_la_SOURCES += src/topic.cpp
libpaho_mqttpp3_la_SOURCES += src/connect_options.cpp
libpaho_mqttpp3_la_SOURCES += src/will_options.cpp
libpaho_mqttpp3_la_SOURCES += src/ssl_options.cpp

###############################################################################
# Library compiler flags
###############################################################################

libpaho_mqttpp3_la_CXXFLAGS = $(CXXFLAGS)
libpaho_mqttpp3_la_CXXFLAGS += -fPIC
libpaho_mqttpp3_la_CXXFLAGS += -I $(srcdir)/src -I src

###############################################################################
# Library: linker flags
###############################################################################

# Create SONAME entry. Same as -Wl,-soname,libname.so.major
VERSION_INFO = `echo '$(PACKAGE_VERSION)' | $(SED) -e "s/\(.*\)\.\(.*\\)\.\(.*\)/\1:\3:\2/g" `
libpaho_mqttpp3_la_LDFLAGS = -version-info $(VERSION_INFO)

libpaho_mqttpp3_la_LDFLAGS += $(LDFLAGS)
libpaho_mqttpp3_la_LDFLAGS += $(LIBS)


###############################################################################
# Library: headers to install
###############################################################################

include_HEADERS = src/mqtt/async_client.h
include_HEADERS += src/mqtt/callback.h
include_HEADERS += src/mqtt/client.h
include_HEADERS += src/mqtt/connect_options.h
include_HEADERS += src/mqtt/delivery_token.h
include_HEADERS += src/mqtt/disconnect_options.h
include_HEADERS += src/mqtt/exception.h
include_HEADERS += src/mqtt/iaction_listener.h
include_HEADERS += src/mqtt/iasync_client.h
include_HEADERS += src/mqtt/iclient_persistence.h
include_HEADERS += src/mqtt/ipersistable.h
include_HEADERS += src/mqtt/message.h
include_HEADERS += src/mqtt/response_options.h
include_HEADERS += src/mqtt/token.h
include_HEADERS += src/mqtt/topic.h
include_HEADERS += src/mqtt/will_options.h
include_HEADERS += src/mqtt/ssl_options.h


###############################################################################
# Samples
###############################################################################

if PAHO_BUILD_SAMPLES
SUBDIRS += src/samples

###############################################################################
# Samples: binaries to build
###############################################################################

bin_PROGRAMS = async_publish
bin_PROGRAMS += async_subscribe
bin_PROGRAMS += sync_publish

###############################################################################
# Samples: source code
###############################################################################

async_publish_SOURCES = src/samples/async_publish.cpp

async_subscribe_SOURCES = src/samples/async_subscribe.cpp

sync_publish_SOURCES = src/samples/sync_publish.cpp

###############################################################################
# Samples: compiler flags
###############################################################################

COMMONCXXFLAGS = $(CXXFLAGS)
COMMONCXXFLAGS += -I$(top_srcdir)/src/

async_publish_CXXFLAGS = $(COMMONCXXFLAGS)

async_subscribe_CXXFLAGS = $(COMMONCXXFLAGS)

sync_publish_CXXFLAGS = $(COMMONCXXFLAGS)

###############################################################################
# Samples: linker flags
###############################################################################

COMMONLDFLAGS = $(LDFLAGS)
COMMONLDFLAGS += $(LIBS)
COMMONLDFLAGS += libpaho-mqttpp3.la

async_publish_LDADD = $(COMMONLDFLAGS)

async_subscribe_LDADD = $(COMMONLDFLAGS)

sync_publish_LDADD = $(COMMONLDFLAGS)

endif

###############################################################################
# Documentation
###############################################################################

if PAHO_BUILD_DOC
SUBDIRS += doc
doxyfile.stamp:
$(MKDIR_P) @top_builddir@/doc
cd doc && $(DOXYGEN) Doxyfile
echo Timestamp > doxyfile.stamp

CLEANFILES = doxyfile.stamp

all-local: doxyfile.stamp
clean-local:
rm -rf $(top_srcdir)/docs/man
endif
7 changes: 0 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ AC_ARG_ENABLE(
enable_samples=no
)

AS_IF([test "x$enable_samples" = "xyes"], [
AC_CONFIG_FILES([src/samples/Makefile])
])

AM_CONDITIONAL([PAHO_BUILD_SAMPLES], [test "$enable_samples" = yes])


Expand Down Expand Up @@ -168,9 +164,6 @@ AC_CHECK_HEADER([MQTTAsync.h], , AC_MSG_ERROR([missing paho.mqtt.c headers]))

AC_CONFIG_HEADERS([config.h])

AC_CONFIG_FILES([doc/Makefile])
AC_CONFIG_FILES([src/mqtt/Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([Makefile])

AC_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ PROJECT_LOGO = "@top_srcdir@/doc/pahologo.png"
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.

OUTPUT_DIRECTORY = @top_srcdir@/doc
OUTPUT_DIRECTORY = @top_builddir@/doc

# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
Expand Down
27 changes: 0 additions & 27 deletions doc/Makefile.am

This file was deleted.

55 changes: 0 additions & 55 deletions src/Makefile.am

This file was deleted.

37 changes: 0 additions & 37 deletions src/mqtt/Makefile.am

This file was deleted.

60 changes: 0 additions & 60 deletions src/samples/Makefile.am

This file was deleted.

0 comments on commit 5642ecc

Please sign in to comment.