libt2n: (gerd) make codegen.make work with current autotools
[libt2n] / examples-codegen / example2 / codegen.make
index b6bbe1b..6d7f069 100644 (file)
@@ -23,7 +23,9 @@ libt2ngroup_%.P : Makefile.am
 # 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)) )
 
@@ -49,6 +51,7 @@ pkgconfig_DATA = $(CMDGROUPS:=.pc)
        $< >$*.pc
 
 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)