diff --git a/Makefile.am b/Makefile.am index ccdf669f..61a71247 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,52 +8,30 @@ bin_PROGRAMS=rofi dist_bin_SCRIPTS=script/rofi-sensible-terminal -LIBS=\ - @glib_LIBS@\ - @x11_LIBS@\ - @xinerama_LIBS@\ - @libsn_LIBS@\ - @pango_LIBS@\ - @cairo_LIBS@ - -AM_CFLAGS=\ - @EXTRA_CFLAGS@\ - @glib_CFLAGS@\ - @x11_CFLAGS@\ - @xinerama_CFLAGS@\ - @pango_CFLAGS@\ - @libsn_CFLAGS@\ - @cairo_CFLAGS@\ - -DMANPAGE_PATH="\"$(mandir)/\""\ - -I$(top_srcdir)/include/\ - -I$(top_srcdir)/config/\ - -I$(top_builddir)/\ - -Werror=missing-prototypes - rofi_SOURCES=\ - source/rofi.c\ + source/rofi.c\ source/view.c\ source/mode.c\ source/keyb.c\ - config/config.c\ + config/config.c\ source/helper.c\ source/widget.c\ - source/textbox.c\ + source/textbox.c\ source/timings.c\ - source/history.c\ - source/scrollbar.c\ + source/history.c\ + source/scrollbar.c\ source/i3-support.c\ - source/xrmoptions.c\ + source/xrmoptions.c\ source/x11-helper.c\ source/x11-event-source.c\ - source/dialogs/run.c\ - source/dialogs/ssh.c\ - source/dialogs/drun.c\ - source/dialogs/dmenu.c\ - source/dialogs/combi.c\ - source/dialogs/window.c\ - source/dialogs/script.c\ - include/rofi.h\ + source/dialogs/run.c\ + source/dialogs/ssh.c\ + source/dialogs/drun.c\ + source/dialogs/dmenu.c\ + source/dialogs/combi.c\ + source/dialogs/window.c\ + source/dialogs/script.c\ + include/rofi.h\ include/mode.h\ include/mode-private.h\ include/settings.h\ @@ -62,35 +40,58 @@ rofi_SOURCES=\ include/view-internal.h\ include/helper.h\ include/timings.h\ - include/history.h\ + include/history.h\ include/widget.h\ - include/textbox.h\ - include/scrollbar.h\ - include/xrmoptions.h\ - include/i3-support.h\ + include/textbox.h\ + include/scrollbar.h\ + include/xrmoptions.h\ + include/i3-support.h\ include/x11-helper.h\ include/x11-event-source.h\ - include/dialogs/ssh.h\ - include/dialogs/run.h\ - include/dialogs/drun.h\ - include/dialogs/dmenu.h\ - include/dialogs/combi.h\ - include/dialogs/script.h\ - include/dialogs/window.h\ - include/dialogs/dialogs.h + include/dialogs/ssh.h\ + include/dialogs/run.h\ + include/dialogs/drun.h\ + include/dialogs/dmenu.h\ + include/dialogs/combi.h\ + include/dialogs/script.h\ + include/dialogs/window.h\ + include/dialogs/dialogs.h + +rofi_CFLAGS=\ + $(AM_CFLAGS)\ + $(glib_CFLAGS)\ + $(x11_CFLAGS)\ + $(xinerama_CFLAGS)\ + $(pango_CFLAGS)\ + $(libsn_CFLAGS)\ + $(cairo_CFLAGS)\ + -DMANPAGE_PATH="\"$(mandir)/\""\ + -I$(top_srcdir)/include/\ + -I$(top_srcdir)/config/\ + -I$(top_builddir)/\ + -Werror=missing-prototypes + +rofi_LDADD=\ + $(glib_LIBS)\ + $(x11_LIBS)\ + $(xinerama_LIBS)\ + $(libsn_LIBS)\ + $(pango_LIBS)\ + $(cairo_LIBS)\ + $(LIBS) ## # Manpage ## -man1_MANS=\ - doc/rofi.1\ +dist_man1_MANS=\ + doc/rofi.1\ doc/rofi-sensible-terminal.1 ## # Readme.md ## markdown_SC_FILES=\ - README.md + README.md # want the html to show up in release. md_verbose = $(md_verbose_@AM_V@) @@ -98,7 +99,7 @@ md_verbose_ = $(md_verbose_@AM_DEFAULT_V@) md_verbose_0 = @echo " MD" $@; markdown_FILES=\ - README.html + README.html README.html: README.md $(md_verbose) markdown $< > $@ @@ -107,19 +108,18 @@ README.html: README.md ## # config directory ## -${top_builddir}/config/config.c: ${top_srcdir}/config/config.def.c - cp ${top_srcdir}/config/config.def.c $@ +$(top_builddir)/config/config.c: $(top_srcdir)/config/config.def.c + cp $(top_srcdir)/config/config.def.c $@ ## # Extra DIST ## EXTRA_DIST=\ - $(man1_MANS)\ - $(markdown_FILES)\ - $(markdown_SC_FILES)\ - Examples/i3_switch_workspaces.sh\ - ${top_srcdir}/config/config.def.c\ - INSTALL.md\ + $(markdown_FILES)\ + $(markdown_SC_FILES)\ + Examples/i3_switch_workspaces.sh\ + $(top_srcdir)/config/config.def.c\ + INSTALL.md\ AUTHORS\ doc/rofi.doxy.in\ Changelog @@ -129,40 +129,40 @@ EXTRA_DIST=\ ## -update-manpage: ${top_srcdir}/doc/rofi-manpage.markdown - ronn --roff --pipe $^ > ${top_srcdir}/doc/rofi.1 +update-manpage: $(top_srcdir)/doc/rofi-manpage.markdown + ronn --roff --pipe $^ > $(top_srcdir)/doc/rofi.1 ## # Rofi test program ## -noinst_PROGRAMS=rofi_test textbox_test helper_test +check_PROGRAMS=rofi_test textbox_test helper_test rofi_test_SOURCES=\ - source/history.c\ - config/config.c\ - include/rofi.h\ + source/history.c\ + config/config.c\ + include/rofi.h\ include/mode.h\ include/mode-private.h\ include/settings.h\ - include/history.h\ + include/history.h\ test/history-test.c textbox_test_SOURCES=\ source/widget.c\ - source/textbox.c\ - config/config.c\ + source/textbox.c\ + config/config.c\ source/keyb.c\ source/x11-helper.c\ source/xrmoptions.c\ source/helper.c\ include/keyb.h\ - include/rofi.h\ + include/rofi.h\ include/mode.h\ include/mode-private.h\ include/settings.h\ include/widget.h\ - include/textbox.h\ + include/textbox.h\ include/widget.h\ include/x11-helper.h\ include/xrmoptions.h\ @@ -170,23 +170,22 @@ textbox_test_SOURCES=\ test/textbox-test.c helper_test_SOURCES=\ - config/config.c\ - include/rofi.h\ + config/config.c\ + include/rofi.h\ include/mode.h\ include/mode-private.h\ - source/helper.c\ - include/helper.h\ + source/helper.c\ + include/helper.h\ include/xrmoptions.h\ source/xrmoptions.c\ - test/helper-test.c + test/helper-test.c -.PHONY: test -test: ${bin_PROGRAMS} ${noinst_PROGRAMS} - ./rofi_test - ./helper_test +TESTS=\ + rofi_test\ + helper_test .PHONY: test-x -test-x: ${bin_PROGRAMS} +test-x: $(bin_PROGRAMS) echo "Test 1" $(top_srcdir)/test/run_test.sh 123 $(top_builddir)/textbox_test $(top_builddir) echo "Test 2" @@ -230,28 +229,28 @@ test-x: ${bin_PROGRAMS} echo "Test issue 333" $(top_srcdir)/test/run_test.sh 221 $(top_srcdir)/test/run_issue333_test.sh $(top_builddir) -test-x1: ${bin_PROGRAMS} +test-x1: $(bin_PROGRAMS) echo "Test dmenu-normal-window" $(top_srcdir)/test/run_test.sh 219 $(top_srcdir)/test/run_dmenu_normal_window_test.sh $(top_builddir) echo "Test window" - $(top_srcdir)/test/run_test.sh 220 $(top_srcdir)/test/run_window_test.sh $(top_builddir) $(top_srcdir) + $(top_srcdir)/test/run_test.sh 220 $(top_srcdir)/test/run_window_test.sh $(top_builddir) $(top_srcdir) echo "End tests" .PHONY: indent -indent: ${rofi_SOURCES} ${top_srcdir}/config/config.def.c ${helper_test_SOURCES} ${textbox_test_SOURCES} ${rofi_test_SOURCES} - uncrustify -c ${top_srcdir}/data/uncrustify.cfg --replace $^ +indent: $(rofi_SOURCES) $(top_srcdir)/config/config.def.c $(helper_test_SOURCES) $(textbox_test_SOURCES) $(rofi_test_SOURCES) + uncrustify -c $(top_srcdir)/data/uncrustify.cfg --replace $^ .PHONY: cppcheck -cppcheck: ${rofi_SOURCES} - cppcheck --std=c99 --platform=unix64 --enable=all -Uerror_dialog -I ${top_srcdir}/include/ $^ +cppcheck: $(rofi_SOURCES) + cppcheck --std=c99 --platform=unix64 --enable=all -Uerror_dialog -I $(top_srcdir)/include/ $^ .PHONY: ohcount -ohcount: ${rofi_SOURCES} - ohcount -i ${top_srcdir}/source/ ${top_srcdir}/include/ +ohcount: $(rofi_SOURCES) + ohcount -i $(top_srcdir)/source/ $(top_srcdir)/include/ -doxy: doc/rofi.doxy ${rofi_SOURCES} - doxygen ${top_builddir}/doc/rofi.doxy +doxy: doc/rofi.doxy $(rofi_SOURCES) + doxygen $(top_builddir)/doc/rofi.doxy diff --git a/configure.ac b/configure.ac index d1d0b7ce..0fa89fd6 100644 --- a/configure.ac +++ b/configure.ac @@ -30,13 +30,18 @@ dnl System extensions dnl --------------------------------------------------------------------- AC_USE_SYSTEM_EXTENSIONS +dnl --------------------------------------------------------------------- +dnl Base CFLAGS +dnl --------------------------------------------------------------------- +AM_CFLAGS="-Wall -Wextra -Wparentheses -Winline -pedantic" + dnl --------------------------------------------------------------------- dnl Enable source code coverage reporting for GCC dnl --------------------------------------------------------------------- AC_ARG_ENABLE(gcov, [ --enable-gcov Enable source code coverage testing using gcov], - [CFLAGS="$CFLAGS -coverage"]) + [AM_CFLAGS="${AM_CFLAGS} -coverage"]) dnl --------------------------------------------------------------------- dnl Disable window mode dnl --------------------------------------------------------------------- @@ -82,7 +87,7 @@ PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0]) dnl --------------------------------------------------------------------- dnl Add extra compiler flags dnl --------------------------------------------------------------------- -AC_SUBST([EXTRA_CFLAGS], ["-Wall -Wextra -Wparentheses -Winline -pedantic"]) +AC_SUBST([AM_CFLAGS]) AC_CONFIG_FILES([Makefile doc/rofi.doxy]) AC_OUTPUT