Changeset ca1fb26a for Makefile.am


Ignore:
Timestamp:
Aug 11, 2013, 4:36:03 PM (8 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master
Children:
f1a71c8, 441fd42, 883b421
Parents:
685cca7
git-author:
Anders Kaseorg <andersk@mit.edu> (06/20/13 12:08:41)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/11/13 16:36:03)
Message:
Be smarter about rebuilding on version number changes

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r685cca7 rca1fb26a  
    11ACLOCAL_AMFLAGS = -I m4
    22
    3 GIT_DESCRIPTION := $(if $(wildcard .git),$(shell git describe --match='barnowl-*' HEAD 2>/dev/null))
    4 GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%))
     3GIT_DESCRIPTION := $(if $(wildcard $(srcdir)/.git),$(shell cd $(srcdir) && git describe --match='barnowl-*' HEAD 2>/dev/null))
     4VERSION = $(if $(GIT_DESCRIPTION),$(GIT_DESCRIPTION:barnowl-%=%),@VERSION@)
     5-include BUILD_VERSION.mk
     6
     7FORCE:
     8BUILD_VERSION.mk: $(if $(filter-out $(BUILD_VERSION),$(VERSION)),FORCE)
     9        echo 'BUILD_VERSION = $(VERSION)' > $@
    510
    611bin_PROGRAMS = bin/barnowl
     
    914endif
    1015
    11 zcrypt_SOURCES = zcrypt.c filterproc.c
     16zcrypt_SOURCES = zcrypt.c filterproc.c version.c
    1217
    1318check_PROGRAMS = bin/tester
     
    4752           -I$(top_srcdir)/libfaim/ \
    4853           -DDATADIR='"$(pkgdatadir)"' \
    49            -DBINDIR='"$(bindir)"' \
    50            $(GIT_FLAGS)
     54           -DBINDIR='"$(bindir)"'
    5155
    5256CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \
     
    6468BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
    6569
    66 GEN_C = varstubs.c perlglue.c gmarshal_funcs.c
     70GEN_C = varstubs.c perlglue.c gmarshal_funcs.c version.c version.c.new
    6771GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h
    6872
     
    7074
    7175# Only copy file into place if file.new is different
    72 %: %.new
     76owl_prototypes.h version.c: %: %.new
    7377        @diff -U0 $@ $< || { \
    7478         test -f $@ && echo '$@ changed!'; \
     
    8791        $(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
    8892
     93version.c.new: Makefile BUILD_VERSION.mk
     94        $(AM_V_GEN)echo 'const char *version = "$(VERSION)";' > $@
     95
    8996gmarshal_funcs.h: marshal_types
    9097        glib-genmarshal --header $< > $@
     
    96103        $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES)
    97104
    98 CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS)
     105CLEANFILES = $(BUILT_SOURCES) $(GEN_C) $(noinst_SCRIPTS) $(check_SCRIPTS) BUILD_VERSION.mk
    99106EXTRA_DIST = \
    100107    autogen.sh \
Note: See TracChangeset for help on using the changeset viewer.