-# vim:syntax=make
+# vim:syntax=automake
## 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
+# - 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
+# - Add the .h to nodist_SOURCES_qt4
AUTOMAKE_OPTIONS = subdir-objects
-
-TOUI = \
- ui/equalizer \
- ui/video_effects \
- ui/open_file \
- ui/open_disk \
- ui/open_net \
- ui/open_capture \
- ui/open \
- ui/main_interface \
- ui/sprefs_audio \
- ui/sprefs_input \
- ui/sprefs_interface \
- ui/sprefs_subtitles \
- ui/sprefs_video \
- ui/sprefs_hotkeys \
- ui/streampanel \
- ui/sout
-
-
-UIH = $(TOUI:%=%.h)
-
-TOMOC = main_interface \
- menus \
- dialogs_provider \
- input_manager \
- playlist_model \
- dialogs/playlist \
- dialogs/preferences \
- dialogs/messages \
- dialogs/errors \
- dialogs/mediainfo \
- dialogs/extended \
- dialogs/interaction \
- dialogs/sout \
- dialogs/help \
- dialogs/gototime \
- dialogs/open \
- components/extended_panels \
- components/infopanels \
- components/preferences_widgets \
- components/complete_preferences \
- components/simple_preferences \
- components/open \
- components/interface_widgets \
- components/playlist/panels \
- components/playlist/selector \
- util/input_slider \
- util/customwidgets
-MOCCPP = $(TOMOC:%=%.moc.cpp)
+MOSTLYCLEANFILES = $(UIH)
+SUFFIXES += .ui .h .hpp .moc.cpp
nodist_SOURCES_qt4 = \
main_interface.moc.cpp \
components/playlist/selector.moc.cpp \
util/input_slider.moc.cpp \
util/customwidgets.moc.cpp \
- resources.cpp
+ resources.cpp \
+ ui/equalizer.h \
+ ui/video_effects.h \
+ ui/open_file.h \
+ ui/open_disk.h \
+ ui/open_net.h \
+ ui/open_capture.h \
+ ui/open.h \
+ ui/main_interface.h \
+ ui/sprefs_audio.h \
+ ui/sprefs_input.h \
+ ui/sprefs_interface.h \
+ ui/sprefs_subtitles.h \
+ ui/sprefs_video.h \
+ ui/sprefs_hotkeys.h \
+ ui/streampanel.h \
+ ui/sout.h
if ENABLE_QT4
-BUILT_SOURCES += $(UIH) $(nodist_SOURCES_qt4)
+BUILT_SOURCES += $(nodist_SOURCES_qt4)
endif
resources.cpp: res.qrc
$(RCC) -name vlc -o $@ $<
-$(MOCCPP): %.moc.cpp: %.hpp
- @echo "$(MOC) $< -> $@"
+.hpp.moc.cpp:
$(MOC) -o $@ $<
-$(UIH): %.h: %.ui
+.ui.h:
mkdir -p -- ui
- @echo "$(UIC) $< -> $@"
- rm -f $@
- echo "#define Q_(a,b) QString::fromUtf8(_(a))" > $@.uih-tmp
- $(UIC) -tr "Q_" $< >> $@.uih-tmp
- sed -i -e 's/Q_(\"_(\\\"\(.*\)\\\")"/Q_("\1"/' $@.uih-tmp
- mv $@.uih-tmp $@
+ rm -f $@ $@.tmp
+ echo "#define Q_(a,b) QString::fromUtf8(_(a))" > $@.tmp
+ $(UIC) -tr "Q_" $< >> $@.tmp
+ sed -i -e 's/Q_(\"_(\\\"\(.*\)\\\")"/Q_("\1"/' $@.tmp
+ mv -f $@.tmp $@
SOURCES_qt4 = qt4.cpp \
menus.cpp \
components/playlist/standardpanel.cpp \
components/playlist/selector.cpp \
util/input_slider.cpp \
- util/customwidgets.cpp \
- $(NULL)
+ util/customwidgets.cpp
-EXTRA_DIST += \
+noinst_HEADERS = \
qt4.hpp \
menus.hpp \
main_interface.hpp \
dialogs_provider.hpp \
input_manager.hpp \
playlist_model.hpp \
- res.qrc \
dialogs/playlist.hpp \
dialogs/mediainfo.hpp \
dialogs/extended.hpp \
util/input_slider.hpp \
util/directslider.hpp \
util/customwidgets.hpp \
- util/qvlcframe.hpp \
+ util/qvlcframe.hpp
+
+EXTRA_DIST += \
+ res.qrc \
ui/equalizer.ui \
ui/video_effects.ui \
ui/open_file.ui \