Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[makefile] Do not silence doxygen warnings
Doxygen is noisy and can't be asked to be less verbose, but
hiding all output from it to a log file hides any real issues
it is facing.

Redirect only stdout which is where doxygen writes progress
noise, let warnings and such output to stderr stay visible.

Also follow makefile conventions by adding standard make
targets and using DESTDIR macro only in install rule.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Nov 18, 2017
1 parent f22c9e2 commit b40c427
Showing 1 changed file with 55 additions and 25 deletions.
80 changes: 55 additions & 25 deletions Makefile
Expand Up @@ -5,38 +5,68 @@
# Author: David Weinehall <david.weinehall@nokia.com>
# Modified by: Ilya Dogolazky, Tuomo Tanskanen

INSTALL_DIR := install -d
# ----------------------------------------------------------------------------
# TOP LEVEL TARGETS
# ----------------------------------------------------------------------------

.PHONY: build doc install clean distclean mostlyclean

build::

doc::

install::

mostlyclean::
$(RM) *.bak *~
$(RM) mce/include/*.bak mce/include/*~

clean:: mostlyclean

distclean:: clean

# ----------------------------------------------------------------------------
# INSTALL CONFIG
# ----------------------------------------------------------------------------

DESTDIR ?= /tmp/test-mce-dev

PCDIR := /usr/lib/pkgconfig
INCLUDEDIR := /usr/include/mce

INSTALL_DIR := install --mode=755 --directory
INSTALL_DATA := install --mode=644

DOXYGEN := doxygen

PCDIR := $(DESTDIR)/usr/lib/pkgconfig
INCLUDEDIR := $(DESTDIR)/usr/include/mce
# ----------------------------------------------------------------------------
# FILES TO BUILD / INSTALL
# ----------------------------------------------------------------------------

TOPDIR := $(shell /bin/pwd)
INCDIR := $(TOPDIR)/include/mce
DOCDIR := $(TOPDIR)/doc
PCFILE += mce.pc
INCLUDE_FILES += include/mce/dbus-names.h
INCLUDE_FILES += include/mce/mode-names.h

PCFILE := mce.pc
INCLUDE_FILES := $(INCDIR)/dbus-names.h $(INCDIR)/mode-names.h
# ----------------------------------------------------------------------------
# DOCUMENTATION RULES
# ----------------------------------------------------------------------------

.PHONY: doc
doc: doc/warnings
doc:: doc/doxygen.log

doc/warnings: $(INCLUDE_FILES) Doxyfile
@if [ ! -d "$(DOCDIR)" ]; then mkdir "$(DOCDIR)"; fi
@$(DOXYGEN) 2> $(TOPDIR)/doc/warnings > /dev/null
doc/doxygen.log: $(INCLUDE_FILES) Doxyfile
mkdir -p doc
doxygen 1> $@ # stdout=noise stderr=warnings

clean:
@if [ x"$(DOCDIR)" != x"" ]; then \
rm -rf "$(DOCDIR)"; \
fi
clean::
$(RM) -rf doc

.PHONY: install
install: doc
$(INSTALL_DIR) $(PCDIR) $(INCLUDEDIR) &&\
$(INSTALL_DATA) $(PCFILE) $(PCDIR) &&\
$(INSTALL_DATA) $(INCLUDE_FILES) $(INCLUDEDIR)
# ----------------------------------------------------------------------------
# INSTALL RULES
# ----------------------------------------------------------------------------

.PHONY: distclean
distclean: clean
install::
# package config files
$(INSTALL_DIR) $(DESTDIR)$(PCDIR)
$(INSTALL_DATA) $(PCFILE) $(DESTDIR)$(PCDIR)/
# header files
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
$(INSTALL_DATA) $(INCLUDE_FILES) $(DESTDIR)$(INCLUDEDIR)

0 comments on commit b40c427

Please sign in to comment.