# gnu make (functions for transforming text)
# sed is available
-include_HEADERS = $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx)
+include_HEADERS += $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx)
# not needed but nice to have
# IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j)))
# todo use tmp file for xml file
for i in $($*_GROUP); do \
gccxml $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/$${i} -fxml=$${i%*.cpp}.xml; \
- done && $(LIBT2N_CODEGEN) $* $($*_GROUP:.cpp=.xml) && touch $@
+ done && $(LIBT2N_CODEGEN) $* $($*_GROUP:.cpp=.xml) && for i in $($*_GROUP); do \
+ rm $${i%*.cpp}.xml; \
+ done && touch $@
LIBT2N_CODEGEN_BUILT = $(foreach i, $(CMDGROUPS), $(foreach j, _common.hxx _common.cpp _client.hxx _client.cpp _server.hxx _server.cpp, $(i)$(j)) )
# using BUILT_SOURCES is a bit problematic (see also automake manual)
-BUILT_SOURCES = $(LIBT2N_CODEGEN_BUILT)
+BUILT_SOURCES += $(LIBT2N_CODEGEN_BUILT)
LIBT2N_STAMPS=$(CMDGROUPS:=.libt2nstamp)
$(BUILT_SOURCES) : $(LIBT2N_STAMPS)
-e 's,\@VERSION\@,$(VERSION),g' \
$< >$*.pc
-CLEANFILES = $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
+CLEANFILES += $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
+DISTCLEANFILES += $(foreach i, $(CMDGROUPS), libt2ngroup_$(i).P)
# didn't work (same problem as with _LTLIBRARIES [parsing by automake],
# this time _OBJECTS was not correct)
dist-hook: $(LIBT2N_CODEGEN_BUILT)
rm -vf $(foreach i, $(LIBT2N_CODEGEN_BUILT), $(distdir)/$(i))
-EXTRA_DIST = codegen.make
+EXTRA_DIST += codegen.make
# gnu make (functions for transforming text)
# sed is available
-include_HEADERS = $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx)
+include_HEADERS += $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx)
# not needed but nice to have
# IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j)))
# todo use tmp file for xml file
for i in $($*_GROUP); do \
gccxml $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/$${i} -fxml=$${i%*.cpp}.xml; \
- done && $(LIBT2N_CODEGEN) $* $($*_GROUP:.cpp=.xml) && touch $@
+ done && $(LIBT2N_CODEGEN) $* $($*_GROUP:.cpp=.xml) && for i in $($*_GROUP); do \
+ rm $${i%*.cpp}.xml; \
+ done && touch $@
LIBT2N_CODEGEN_BUILT = $(foreach i, $(CMDGROUPS), $(foreach j, _common.hxx _common.cpp _client.hxx _client.cpp _server.hxx _server.cpp, $(i)$(j)) )
# using BUILT_SOURCES is a bit problematic (see also automake manual)
-BUILT_SOURCES = $(LIBT2N_CODEGEN_BUILT)
+BUILT_SOURCES += $(LIBT2N_CODEGEN_BUILT)
LIBT2N_STAMPS=$(CMDGROUPS:=.libt2nstamp)
$(BUILT_SOURCES) : $(LIBT2N_STAMPS)
-e 's,\@VERSION\@,$(VERSION),g' \
$< >$*.pc
-CLEANFILES = $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
+CLEANFILES += $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
+DISTCLEANFILES += $(foreach i, $(CMDGROUPS), libt2ngroup_$(i).P)
# didn't work (same problem as with _LTLIBRARIES [parsing by automake],
# this time _OBJECTS was not correct)
dist-hook: $(LIBT2N_CODEGEN_BUILT)
rm -vf $(foreach i, $(LIBT2N_CODEGEN_BUILT), $(distdir)/$(i))
-EXTRA_DIST = codegen.make
+EXTRA_DIST += codegen.make
minimalistic-server.xml: minimalistic-server.cpp
gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(srcdir)/minimalistic-server.cpp -fxml=minimalistic-server.xml
+CLEANFILES = minimalistic-server.xml
LIBT2N_CLIENT_PCTEMPLATE="$LIBT2N_DATADIR/clientlib.pc.in"
AC_SUBST(LIBT2N_CODEGEN)
AC_SUBST(LIBT2N_CLIENT_PCTEMPLATE)
+
+ dnl newer automake versions do not allow to use += on undefined variables
+ dnl but we want to use += in codegen.make (s.a. examples-codegen/example1)
+ dnl as workaround we always define them
+ dnl see also:
+ dnl automake ml: subject: "automake conditional append"
+ dnl http://sourceware.org/ml/automake/2005-01/msg00019.html
+ dnl
+ dnl Note:
+ dnl if you update from libt2n 0.1 to 0.2
+ dnl you must take care to pick up the right libt2n.m4
+
+ AC_SUBST([include_HEADERS], [''])
+ AC_SUBST([BUILT_SOURCES], [''])
+ AC_SUBST([CLEANFILES], [''])
+ AC_SUBST([DISTCLEANFILES], [''])
+ AC_SUBST([EXTRA_DIST], [''])
])
mkdir "$BUILDDIR"
INSTPREFIX="$INSTDIR/usr"
MAKE="dmake"
-DOCLEAN="false"
+DOCLEAN="true"
function prepend() {
if [ "x$1" = "x" ]; then
}
function build() {
- # newer autoreconf (autoconf) versions don't have the -M option and no replacement :-(
+ # newer autoreconf (autoconf) versions don't have the -M option and no real replacement :-(
+ # (you can only set ACLOCAL_AMFLAGS in the Makefile.am)
# todo: this IMHO should be filed as bug against autoconf
# ugly workaround
- autoreconf -f -i $@ || (autoreconf -f -i && aclocal --force $(echo "$@"|sed 's,-M,-I,'))
+w autoreconf -f -i $@ || { aclocal --force $(echo "$@"|sed 's,-M,-I,') && libtoolize --copy --force && autoconf --force && automake --add-missing --copy --force-missing; }
./configure --prefix="$INSTPREFIX"
if $DOCLEAN; then
$MAKE distclean