-TOUI = ui/file_open
-UIH := $(TOUI:%=%.h)
+# vim:syntax=make
+## Howto
+# For each Q_OBJECT:
+# - Add it without extension to TOMOC
+# - Add the moc.cpp to BUILT_SOURCES and nodist_SOURCES_qt4
+# - Add the cpp to SOURCES_qt4
+# - Add the hpp to EXTRA_DIST
+# For each UI
+# - Add it without extension to TOUI
+# - Add it to EXTRA_DIST
-TOMOC = main_interface dialogs_provider dialogs/playlist
-MOCCPP := $(TOMOC:%=%.moc.cpp)
+AUTOMAKE_OPTIONS = subdir-objects
+
+TOUI = \
+ ui/equalizer \
+ ui/file_open \
+ ui/input_stats \
+ ui/main_interface \
+ ui/sprefs_audio \
+ ui/sprefs_interface \
+ ui/sprefs_playlist \
+ ui/sprefs_subtitles \
+ ui/sprefs_trivial \
+ ui/sprefs_video \
+ ui/streampanel
+
+
+UIH = $(TOUI:%=%.h)
+
+TOMOC = main_interface \
+ menus \
+ dialogs_provider \
+ input_manager \
+ playlist_model \
+ dialogs/playlist \
+ dialogs/prefs_dialog \
+ dialogs/messages \
+ dialogs/errors \
+ dialogs/streaminfo \
+ dialogs/extended \
+ dialogs/interaction \
+ components/extended_panels \
+ components/infopanels \
+ components/preferences_widgets \
+ components/preferences \
+ components/simple_preferences \
+ components/open \
+ components/interface_widgets \
+ components/playlist/panels \
+ components/playlist/selector \
+ util/input_slider \
+ util/customwidgets
+MOCCPP = $(TOMOC:%=%.moc.cpp)
+
+nodist_SOURCES_qt4 = \
+ main_interface.moc.cpp \
+ menus.moc.cpp \
+ dialogs_provider.moc.cpp \
+ input_manager.moc.cpp \
+ playlist_model.moc.cpp \
+ dialogs/playlist.moc.cpp \
+ dialogs/streaminfo.moc.cpp \
+ dialogs/extended.moc.cpp \
+ dialogs/messages.moc.cpp \
+ dialogs/errors.moc.cpp \
+ dialogs/prefs_dialog.moc.cpp \
+ dialogs/interaction.moc.cpp \
+ components/extended_panels.moc.cpp \
+ components/infopanels.moc.cpp \
+ components/preferences_widgets.moc.cpp \
+ components/preferences.moc.cpp \
+ components/simple_preferences.moc.cpp \
+ components/open.moc.cpp \
+ components/interface_widgets.moc.cpp \
+ components/playlist/panels.moc.cpp \
+ components/playlist/selector.moc.cpp \
+ util/input_slider.moc.cpp \
+ util/customwidgets.moc.cpp \
+ resources.cpp
if ENABLE_QT4
+BUILT_SOURCES += $(UIH) $(nodist_SOURCES_qt4)
+endif
-BUILT_SOURCES += $(UIH)
-BUILT_SOURCES += $(MOCCPP)
+resources.cpp: res.qrc
+ $(RCC) -name vlc -o $@ $<
$(MOCCPP): %.moc.cpp: %.hpp
- @echo "MOC $< -> $@"
- moc -o $@ $<
+ @echo "$(MOC) $< -> $@"
+ $(MOC) -o $@ $<
-$(UIH): %.h: %.ui
- @echo "UIC $< -> $@"
- uic -tr _ -o $@ $<
+$(UIH): %.h: %.ui
+ $(install_sh) -d ui
+ @echo "$(UIC) $< -> $@"
+ rm -f $@
+ echo "#define Q_(a,b) QString::fromUtf8(_(a))" > $@
+ $(UIC) -tr "Q_" $< >> $@
+ sed -i -e 's/Q_(\"_(\\\"\(.*\)\\\")"/Q_("\1"/' $@
-endif
SOURCES_qt4 = qt4.cpp \
+ menus.cpp \
main_interface.cpp \
dialogs_provider.cpp \
+ input_manager.cpp \
+ playlist_model.cpp \
dialogs/playlist.cpp \
- main_interface.moc.cpp \
- dialogs_provider.moc.cpp \
- dialogs/playlist.moc.cpp
+ dialogs/prefs_dialog.cpp \
+ dialogs/streaminfo.cpp \
+ dialogs/extended.cpp \
+ dialogs/messages.cpp \
+ dialogs/errors.cpp \
+ dialogs/interaction.cpp \
+ components/extended_panels.cpp \
+ components/infopanels.cpp \
+ components/preferences_widgets.cpp \
+ components/preferences.cpp \
+ components/simple_preferences.cpp \
+ components/open.cpp \
+ components/interface_widgets.cpp \
+ components/playlist/standardpanel.cpp \
+ components/playlist/selector.cpp \
+ util/input_slider.cpp \
+ util/customwidgets.cpp \
$(NULL)
-# Why do I have to put it manually ??
-
EXTRA_DIST += \
qt4.hpp \
+ menus.hpp \
main_interface.hpp \
- dialogs_provider.hpp
+ dialogs_provider.hpp \
+ input_manager.hpp \
+ playlist_model.hpp \
+ res.qrc \
+ dialogs/playlist.hpp \
+ dialogs/streaminfo.hpp \
+ dialogs/extended.hpp \
+ dialogs/messages.hpp \
+ dialogs/errors.hpp \
+ dialogs/prefs_dialog.hpp \
+ dialogs/interaction.hpp \
+ components/extended_panels.hpp \
+ components/infopanels.hpp \
+ components/preferences_widgets.hpp \
+ components/preferences.hpp \
+ components/simple_preferences.hpp \
+ components/open.hpp \
+ components/interface_widgets.hpp \
+ components/playlist/panels.hpp \
+ components/playlist/selector.hpp \
+ util/input_slider.hpp \
+ util/directslider.hpp \
+ util/customwidgets.hpp \
+ util/qvlcframe.hpp \
+ ui/equalizer.ui \
+ ui/file_open.ui \
+ ui/input_stats.ui \
+ ui/main_interface.ui \
+ ui/sprefs_audio.ui \
+ ui/sprefs_interface.ui \
+ ui/sprefs_playlist.ui \
+ ui/sprefs_subtitles.ui \
+ ui/sprefs_trivial.ui \
+ ui/sprefs_video.ui \
+ ui/streampanel.ui \
+ pixmaps/advanced.xpm \
+ pixmaps/audio.xpm \
+ pixmaps/codec.xpm \
+ pixmaps/intf.xpm \
+ pixmaps/type_net.xpm \
+ pixmaps/type_playlist.xpm \
+ pixmaps/video.xpm \
+ pixmaps/advanced_50x50.xpm \
+ pixmaps/audio_50x50.xpm \
+ pixmaps/input_and_codecs_50x50.xpm \
+ pixmaps/interface_50x50.xpm \
+ pixmaps/playlist_50x50.xpm \
+ pixmaps/subtitles_50x50.xpm \
+ pixmaps/video_50x50.xpm