comparison libgui/module.mk @ 31642:670f3f17c280 stable

use sed to preprocess OCTAVE_(BEGIN|END)_NAMESPACE macros for Qt moc * libgui/module.mk (moc-h-command): New macro. (moc-%.h : %.h): New rule. (moc-%.cc): Depend on moc-%.h instead of %.h. * libgui/graphics/module.mk (libgraphics_MOC_H): New variable. Add it to the $(libgui_CLEANFILES) list. * libgui/qterminal/module.mk (%canon_reldir%_libqterminal_la_MOC_H): New variable. Add it to the $(libgui_CLEANFILES) list. * libgui/src/module.mk (octave_gui_MOC_H): New variable. Add it to the $(libgui_CLEANFILES) list.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Dec 2022 14:19:16 -0500
parents 12030ead051f
children 29d734430e5f
comparison
equal deleted inserted replaced
31635:7d3467f8d713 31642:670f3f17c280
89 echo "#endif"; \ 89 echo "#endif"; \
90 $(MOC) $(MOCFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MOC_OCTAVE_CPPFLAGS) $(MOC_CPPFLAGS) $(%canon_reldir%_liboctgui_la_CPPFLAGS) $< ) > $@-t && \ 90 $(MOC) $(MOCFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(MOC_OCTAVE_CPPFLAGS) $(MOC_CPPFLAGS) $(%canon_reldir%_liboctgui_la_CPPFLAGS) $< ) > $@-t && \
91 mv $@-t $@ 91 mv $@-t $@
92 endef 92 endef
93 93
94 define moc-h-command
95 $(SED) -e 's/OCTAVE_BEGIN_NAMESPACE *(\([^)]*\))/namespace \1 {/' \
96 -e 's/OCTAVE_END_NAMESPACE *([^)]*)/}/' $< > $@
97 endef
98
94 define rcc-command 99 define rcc-command
95 rm -f $@-t $@ && \ 100 rm -f $@-t $@ && \
96 ( echo "#if defined (HAVE_CONFIG_H)"; \ 101 ( echo "#if defined (HAVE_CONFIG_H)"; \
97 echo '# include "config.h"'; \ 102 echo '# include "config.h"'; \
98 echo "#endif"; \ 103 echo "#endif"; \
102 echo "#endif"; \ 107 echo "#endif"; \
103 QT_HASH_SEED=0 $(RCC) $(RCCFLAGS) -name $(@D) $< ) > $@-t && \ 108 QT_HASH_SEED=0 $(RCC) $(RCCFLAGS) -name $(@D) $< ) > $@-t && \
104 mv $@-t $@ 109 mv $@-t $@
105 endef 110 endef
106 111
107 moc-%.cc: %.h 112 .PRECIOUS: moc-%.h
113
114 moc-%.h: %.h
115 $(AM_V_GEN)$(moc-h-command)
116
117 moc-%.cc: moc-%.h
108 $(AM_V_GEN)$(moc-command) 118 $(AM_V_GEN)$(moc-command)
109 119
110 ui-%.h: %.ui 120 ui-%.h: %.ui
111 $(AM_V_GEN)$(UIC) $(UICFLAGS) -o $@ $< 121 $(AM_V_GEN)$(UIC) $(UICFLAGS) -o $@ $<
112 122