projects using libt2n-codegen must include the makefile snippet themselves.
[libt2n] / example-codegen / codegen.make
similarity index 82%
rename from codegen/codegen.make
rename to example-codegen/codegen.make
index 747ed31..add7355 100644 (file)
@@ -6,11 +6,12 @@
 
 include_HEADERS += $(foreach i, $(CMDGROUPS), $(i)_client.hxx $(i).hxx)
 
-#IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j)))
+# not needed but nice to have
+# IFILES=$(foreach i, $(CMDGROUPS), $(foreach j, $($(i)_GROUP), $(j)))
 
 -include $(foreach i, $(CMDGROUPS), libt2ngroup_$(i).P)
 
-libt2ngroup_%.P : Makefile
+libt2ngroup_%.P : Makefile.am
        echo $@ : $($*_GROUP) > libt2ngroup_$*.P
 
 %.libt2nstamp : libt2ngroup_%.P $(LIBT2N_CODEGEN)
@@ -45,10 +46,7 @@ pkgconfig_DATA = $(CMDGROUPS:=.pc)
        -e 's,\@includedir\@,$(includedir),g' \
        $< >$*.pc
 
-LIBT2N_SUGGESTED_CLEANFILES = $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
-
-# doesn't work
-# CLEANFILES = $(LIBT2N_SUGGESTED_CLEANFILES)
+CLEANFILES += $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconfig_DATA)
 
 # didn't work (same problem as with _LTLIBRARIES [parsing by automake],
 # this time _OBJECTS was not correct)
@@ -58,6 +56,7 @@ LIBT2N_SUGGESTED_CLEANFILES = $(LIBT2N_CODEGEN_BUILT) $(LIBT2N_STAMPS) $(pkgconf
 
 # we have got an old automake version (1.4-p5) which doesn't support nodist_
 # => we use the dist-hook
-# unfortunately dist-hook only works if directly visible for automake (=> not in this include)
-#dist-hook:
-#      rm -vf $(foreach i, $(BUILT_SOURCES), $(distdir)/$(i))
+dist-hook:
+       rm -vf $(foreach i, $(LIBT2N_CODEGEN_BUILT), $(distdir)/$(i))
+
+EXTRA_DIST += codegen.make