bug-recutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-recutils] [PATCH] Simplify makefile rules.


From: Ralf Wildenhues
Subject: [bug-recutils] [PATCH] Simplify makefile rules.
Date: Fri, 30 Jul 2010 19:35:50 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

---

Not using per-target compile flags like *_CPPFLAGS or *_LDFLAGS but
instead their per-Makefile equivalents AM_CPPFLAGS, AM_LDFLAGS lets
automake not rename object files, makes for smaller makefiles, and in
this case smaller Makefile.am files too.  :-)

Cheers,
Ralf

 ChangeLog         |    4 ++++
 src/Makefile.am   |    6 +++---
 utils/Makefile.am |   35 ++++++++++-------------------------
 3 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5984b3b..2ef6692 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-07-30  Ralf Wildenhues  <address@hidden>
 
+       Simplify makefile rules.
+       * utils/Makefile.am: Simplify.
+       * src/Makefile.am: Likewise.
+
        Typos and formatting nits.
        * configure.ac: Fix typo.
        * doc/recutils.texi: Fix typo, add some @noindents.
diff --git a/src/Makefile.am b/src/Makefile.am
index d23f4a3..95cdb1b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
 # src/ Makefile.am
 # GNU rec
 
-# Copyright (C) 2009 Jose E. Marchesi
+# Copyright (C) 2009, 2010 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
@@ -45,8 +45,8 @@ librec_la_SOURCES = rec-mset.h \
                     rec-fex.c \
                     rec-types.c
 
-librec_la_LDFLAGS =
-librec_la_CPPFLAGS = -I$(top_srcdir)/lib
+AM_LDFLAGS =
+AM_CPPFLAGS = -I$(top_srcdir)/lib
 librec_la_LIBADD = $(top_builddir)/lib/libgnu.la \
                    $(LIB_CLOCK_GETTIME)
 
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 94939ea..5de6ccd 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -1,7 +1,7 @@
 # utils/ Makefile.am
 # GNU rec
 
-# Copyright (C) 2009 Jose E. Marchesi
+# Copyright (C) 2009, 2010 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
@@ -19,47 +19,32 @@
 bin_PROGRAMS = recinf recsel recins recdel recset recfix
 
 COMMONSRC = recutl.h recutl.c
+COMMONLIBS = $(top_builddir)/lib/libgnu.la $(top_builddir)/src/librec.la
+
+AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/src
 
 recinf_SOURCES = $(COMMONSRC) \
                  recinf.c
-
-recinf_LDFLAGS = -L$(top_builddir)/src
-recinf_CPPFLAGS = -I$(top_srcdir)/lib
-recinf_LDADD = $(top_builddir)/lib/libgnu.la -lrec
+recinf_LDADD = $(COMMONLIBS)
 
 recsel_SOURCES = $(COMMONSRC) \
                  recsel.c
-
-recsel_LDFLAGS = -L$(top_builddir)/src
-recsel_CPPFLAGS = -I$(top_srcdir)/lib
-recsel_LDADD = $(top_builddir)/lib/libgnu.la -lrec
+recsel_LDADD = $(COMMONLIBS)
 
 recins_SOURCES = $(COMMONSRC) \
                  recins.c
-
-recins_LDFLAGS = -L$(top_builddir)/src
-recins_CPPFLAGS = -I$(top_srcdir)/lib
-recins_LDADD = $(top_builddir)/lib/libgnu.la -lrec
+recins_LDADD = $(COMMONLIBS)
 
 recdel_SOURCES = $(COMMONSRC) \
                  recdel.c
-
-recdel_LDFLAGS = -L$(top_builddir)/src
-recdel_CPPFLAGS = -I$(top_srcdir)/lib
-recdel_LDADD = $(top_builddir)/lib/libgnu.la -lrec
+recdel_LDADD = $(COMMONLIBS)
 
 recset_SOURCES = $(COMMONSRC) \
                  recset.c
-
-recset_LDFLAGS = -L$(top_builddir)/src
-recset_CPPFLAGS = -I$(top_srcdir)/lib
-recset_LDADD = $(top_builddir)/lib/libgnu.la -lrec
+recset_LDADD = $(COMMONLIBS)
 
 recfix_SOURCES = $(COMMONSRC) \
                  recfix.c
-
-recfix_LDFLAGS = -L$(top_builddir)/src
-recfix_CPPFLAGS = -I$(top_srcdir)/lib
-recfix_LDADD = $(top_builddir)/lib/libgnu.la -lrec
+recfix_LDADD = $(COMMONLIBS)
 
 # End of Makefile.am
-- 
1.7.2.rc3.47.g996ce




reply via email to

[Prev in Thread] Current Thread [Next in Thread]