From bed4036653ce47a91b96dd0ead65341aa80d6b97 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 20 Jan 2020 12:09:56 +0000 Subject: [PATCH] Use automake. This simplifies rebuilding of files like config.status and run when the configuration changes. We still don't actually use make/automake for anything substantial - all rules are passed through to goals. --- .gitignore | 4 ++++ Makefile.in => Makefile.am | 41 ++++++++--------------------------------- autogen.sh | 8 ++++---- configure.ac | 6 ++++-- 4 files changed, 20 insertions(+), 39 deletions(-) rename Makefile.in => Makefile.am (66%) diff --git a/.gitignore b/.gitignore index 7e993ac..3007411 100644 --- a/.gitignore +++ b/.gitignore @@ -12,9 +12,11 @@ .depend Goalfile Makefile +Makefile.in /aclocal.m4 /autom4te.cache/ +/compile /configure /config.h /config.h.in @@ -26,6 +28,7 @@ Makefile /local* /man/*.? /man/*.?.txt +/missing /run /src/config.ml /src/goals @@ -35,3 +38,4 @@ Makefile /src/parser.mli /src/stamp-parser /stamp-h +/stamp-h1 diff --git a/Makefile.in b/Makefile.am similarity index 66% rename from Makefile.in rename to Makefile.am index 19e9c8c..e7b5171 100644 --- a/Makefile.in +++ b/Makefile.am @@ -1,6 +1,6 @@ # Goals -# Copyright (C) 2019 Richard W.M. Jones -# Copyright (C) 2019 Red Hat Inc. +# Copyright (C) 2019-2020 Richard W.M. Jones +# Copyright (C) 2019-2020 Red Hat Inc. # # 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 @@ -17,8 +17,13 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # Pass through normal targets to Goalfile.in +# +# These will override the automake targets printing warnings which +# can be ignored. -all clean depend install check maintainer-clean dist distcheck \ +all clean depend install check \ +dist distcheck \ +maintainer-clean \ maintainer-commit maintainer-tag \ maintainer-check-extra-dist maintainer-release \ maintainer-srpm maintainer-fedora-copr: src/goals @@ -28,13 +33,6 @@ maintainer-srpm maintainer-fedora-copr: src/goals # src/goals we can rebuild it and other parts of the project using # goals itself (see Goalfile.in). -MENHIR = @MENHIR@ -OCAMLDEP = @OCAMLDEP@ -OCAMLFIND = @OCAMLFIND@ -OCAMLLEX = @OCAMLLEX@ -OCAMLFLAGS = @OCAMLFLAGS@ -OCAMLPACKAGES = @OCAMLPACKAGES@ - src/goals: $(MENHIR) --explain src/parser.mly # Hack required to break circular dependencies. @@ -45,26 +43,3 @@ src/goals: src/utils-c.c \ $$($(OCAMLDEP) -sort src/*.mli src/*.ml) \ -linkpkg -o $@ - -# These rules are required by autoconf. -config.h: stamp-h -stamp-h: config.h.in config.status - ./config.status config.h - touch $@ - -Makefile: Makefile.in config.status - ./config.status $@ - -run: run.in config.status - ./config.status $@ - -$(srcdir)/configure: configure.ac aclocal.m4 - cd '$(srcdir)' && autoconf - -$(srcdir)/config.h.in: stamp-h.in -$(srcdir)/stamp-h.in: configure.ac aclocal.m4 - cd '$(srcdir)' && autoheader - echo timestamp > '$(srcdir)/stamp-h.in' - -config.status: configure - ./config.status --recheck diff --git a/autogen.sh b/autogen.sh index cccde30..9d94d07 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,7 @@ -autoreconf -i +#!/bin/sh - + +set -e -# Although we don't use automake, we have to run this in order to -# create or regenerate install-sh (PR automake/546). -automake --add-missing >/dev/null 2>&1 ||: +autoreconf -i ./configure "$@" diff --git a/configure.ac b/configure.ac index d6e1633..7b5ec53 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Goals -# Copyright (C) 2019 Richard W.M. Jones -# Copyright (C) 2019 Red Hat Inc. +# Copyright (C) 2019-2020 Richard W.M. Jones +# Copyright (C) 2019-2020 Red Hat Inc. # # 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 @@ -19,6 +19,8 @@ AC_INIT([goals], [0.2]) AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE(foreign) dnl Do not quote this parameter. + AC_PROG_INSTALL dnl Check for basic C environment. -- 1.8.3.1