# Makefile.am for godcc/man

# Copyright (C) 2026 Jose E. Marchesi

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# In the rules to build manpages below, please depend on the source,
# not the binary; we don't need to regenerate the binary when any
# source file changes, only the main one.  Use -o so that the
# `missing' program can infer the output file.

if NATIVE_BUILD

man_MANS = godcc.1
godcc.1: $(top_srcdir)/src/godcc.a68 $(common_mandeps)
	$(MAKE) $(AM_MAKEFLAGS) $(builddir)/../src/godcc$(EXEEXT)
	$(HELP2MAN) -p godcc --name="A command-line interface to Compiler Explorer" \
	      $(builddir)/../src/godcc$(EXEEXT) -o $(srcdir)/godcc.1
EXTRA_DIST = godcc.1
MAINTAINERCLEANFILES = godcc.1

endif
