Add dist-hook to ensure that every file gets distributed.
[sliver-openvswitch.git] / Makefile.am
1 # Copyright (C) 2007, 2008, 2009, 2010 Nicira Networks, Inc.
2 #
3 # Copying and distribution of this file, with or without modification,
4 # are permitted in any medium without royalty provided the copyright
5 # notice and this notice are preserved.  This file is offered as-is,
6 # without warranty of any kind.
7
8 AUTOMAKE_OPTIONS = foreign subdir-objects
9 ACLOCAL_AMFLAGS = -I m4
10 SUBDIRS = datapath
11
12 AM_CPPFLAGS = $(SSL_CFLAGS)
13 AM_CPPFLAGS += $(NCURSES_CFLAGS)
14 AM_CPPFLAGS += $(PCRE_CFLAGS)
15 AM_CPPFLAGS += -I $(top_srcdir)/include
16 AM_CPPFLAGS += -I $(top_srcdir)/lib
17
18 AM_CFLAGS = -Wstrict-prototypes
19 AM_CFLAGS += $(WARNING_FLAGS)
20
21 if NDEBUG
22 AM_CPPFLAGS += -DNDEBUG
23 AM_CFLAGS += -fomit-frame-pointer
24 else
25 AM_LDFLAGS = -export-dynamic
26 endif
27
28 BUILT_SOURCES =
29 CLEANFILES =
30 DISTCLEANFILES =
31 EXTRA_DIST = \
32         CodingStyle \
33         INSTALL.KVM \
34         INSTALL.Linux \
35         INSTALL.OpenFlow \
36         INSTALL.SSL \
37         INSTALL.XenServer \
38         INSTALL.bridge \
39         INSTALL.userspace \
40         NOTICE \
41         README-gcov \
42         REPORTING-BUGS \
43         SubmittingPatches \
44         boot.sh
45 bin_PROGRAMS =
46 sbin_PROGRAMS =
47 bin_SCRIPTS =
48 DIST_HOOKS =
49 dist_man_MANS =
50 dist_pkgdata_DATA =
51 dist_pkgdata_SCRIPTS =
52 dist_sbin_SCRIPTS =
53 man_MANS =
54 noinst_DATA =
55 noinst_HEADERS =
56 noinst_LIBRARIES =
57 noinst_PROGRAMS =
58 noinst_SCRIPTS =
59 OVSIDL_BUILT =
60 SUFFIXES =
61
62 EXTRA_DIST += \
63         build-aux/update-debian-changelog \
64         soexpand.pl
65
66 ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
67
68 SUFFIXES += .in
69 .in:
70         $(PERL) $(srcdir)/soexpand.pl -I$(srcdir) < $< | \
71             sed \
72                 -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
73                 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
74                 -e 's,[@]PERL[@],$(PERL),g' \
75                 -e 's,[@]PYTHON[@],$(PYTHON),g' \
76                 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
77                 -e 's,[@]VERSION[@],$(VERSION),g' \
78                 -e 's,[@]localstatedir[@],$(localstatedir),g' \
79                 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
80                 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
81                 -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
82                 -e 's,[@]ovsdbmonitordir[@],$(ovsdbmonitordir),g' \
83             > $@.tmp
84         @if head -n 1 $@.tmp | grep -q '#!'; then \
85             echo chmod +x $@.tmp; \
86             chmod +x $@.tmp; \
87         fi
88         mv $@.tmp $@
89
90 # If we're checked out from a Git repository, make sure that every
91 # file that is in Git is distributed.
92 dist-hook-git:
93         if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then    \
94           rc=0;                                                               \
95           for d in `cd $(srcdir) && git ls-files`; do                         \
96             if test ! -e $(distdir)/$$d; then                                 \
97               case $$d in # (                                                 \
98                 .gitignore|*/.gitignore) ;; # (                               \
99                 *)                                                            \
100                    if test $$rc = 0; then                                     \
101                      echo "The distribution is missing the following files:"; \
102                      rc=1;                                                    \
103                    fi;                                                        \
104                    echo "$$d";                                                \
105                    ;;                                                         \
106               esac;                                                           \
107             fi                                                                \
108           done;                                                               \
109           exit $$rc;                                                          \
110         fi
111 DIST_HOOKS += dist-hook-git
112
113 dist-hook: $(DIST_HOOKS)
114 .PHONY: $(DIST_HOOKS)
115
116 include lib/automake.mk
117 include ofproto/automake.mk
118 include utilities/automake.mk
119 include tests/automake.mk
120 include include/automake.mk
121 include third-party/automake.mk
122 include debian/automake.mk
123 include vswitchd/automake.mk
124 include ovsdb/automake.mk
125 include xenserver/automake.mk
126 include extras/ezio/automake.mk
127