chiark / gitweb /
@@@ fltfmt wip
[mLib] / vars.am
1 ### -*-Makefile-*-
2 ###
3 ### Common build-system definition
4 ###
5 ### (c) 1998 Straylight/Edgeware
6 ###
7
8 ###----- Licensing notice ---------------------------------------------------
9 ###
10 ### This file is part of the mLib utilities library.
11 ###
12 ### mLib is free software; you can redistribute it and/or modify
13 ### it under the terms of the GNU Library General Public License as
14 ### published by the Free Software Foundation; either version 2 of the
15 ### License, or (at your option) any later version.
16 ###
17 ### mLib is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ### GNU Library General Public License for more details.
21 ###
22 ### You should have received a copy of the GNU Library General Public
23 ### License along with mLib; if not, write to the Free
24 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 ### MA 02111-1307, USA.
26
27 ###--------------------------------------------------------------------------
28 ### Miscellaneous useful definitions.
29
30 ## Installation directories.
31 pkglibexecdir            = $(libexecdir)/$(PACKAGE)
32
33 ###--------------------------------------------------------------------------
34 ### Initial values for common variables.
35
36 EXTRA_DIST               =
37 CLEANFILES               =
38 DISTCLEANFILES           =
39 MAINTAINERCLEANFILES     =
40 BUILT_SOURCES            =
41
42 bin_PROGRAMS             =
43 check_PROGRAMS           =
44 pkginclude_HEADERS       =
45 noinst_DATA              =
46
47 PROGMANS                 =
48 LIBMANS                  =
49
50 SUFFIXES                 =
51
52 ###--------------------------------------------------------------------------
53 ### Machinery for precomputations.
54
55 ## Location of precomputed tables.
56 precomp                  = $(top_srcdir)/precomp
57
58 ## Precomputed source code files.
59 PRECOMPS                 =
60 EXTRA_DIST              += $(PRECOMPS)
61 BUILT_SOURCES           += $(PRECOMPS)
62 MAINTAINERCLEANFILES    += $(PRECOMPS)
63
64 ###--------------------------------------------------------------------------
65 ### Include path.
66
67 MLIB_INCLUDES            = \
68         -I$(top_srcdir)/buf \
69         -I$(top_srcdir)/codec \
70         -I$(top_srcdir)/hash \
71         -I$(top_srcdir)/mem \
72         -I$(top_srcdir)/net \
73         -I$(top_srcdir)/struct \
74         -I$(top_srcdir)/sys \
75         -I$(top_srcdir)/test \
76         -I$(top_srcdir)/trace \
77         -I$(top_srcdir)/ui \
78         -I$(top_srcdir)/utils
79
80 AM_CPPFLAGS              = $(MLIB_INCLUDES)
81
82 ###--------------------------------------------------------------------------
83 ### Standard configuration substitutions.
84
85 ## Substitute tags in files.
86 confsubst                = $(top_srcdir)/config/confsubst
87
88 SUBSTITUTIONS = \
89         prefix=$(prefix) exec_prefix=$(exec_prefix) \
90         libdir=$(libdir) includedir=$(includedir) \
91         bindir=$(bindir) sbindir=$(sbindir) \
92         PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
93         MLIB_LIBS="$(MLIB_LIBS)"
94
95 V_SUBST                  = $(V_SUBST_@AM_V@)
96 V_SUBST_                 = $(V_SUBST_@AM_DEFAULT_V@)
97 V_SUBST_0                = @echo "  SUBST    $@";
98 SUBST                    = $(V_SUBST)$(confsubst)
99
100 ###--------------------------------------------------------------------------
101 ### Building utilities.
102
103 ## Which libraries we need.
104 UTIL_LIBS = \
105         $(top_builddir)/ui/libui.la \
106         $(top_builddir)/utils/libutils.la
107
108 ###--------------------------------------------------------------------------
109 ### Testing.
110
111 TEST_CPPFLAGS            = -DTEST_RIG -DSRCDIR="\"$(srcdir)\"" $(AM_CPPFLAGS)
112 LDADD                    = $(top_builddir)/libmLib.la
113
114 check: tests
115 .PHONY: check tests
116
117 tests::;
118 .PHONY: tests
119
120 ###--------------------------------------------------------------------------
121 ### Manual.
122
123 noinst_DATA             += $(PROGMANS) $(LIBMANS)
124 CLEANFILES              += $(PROGMANS) $(LIBMANS)
125
126 SUFFIXES                += .1 .1.in
127 SUFFIXES                += .3 .3.in
128
129 mandefs                  = $(top_srcdir)/defs.man
130
131 V_MAN                    = $(V_MAN_@AM_V@)
132 V_MAN_                   = $(V_MAN_@AM_DEFAULT_V@)
133 V_MAN_0                  = @echo "  MAN      $@";
134
135 .1.in.1 .3.in.3:
136         $(V_MAN)
137         $(AM_V_at)sed '/^\.$$/ d; /^\.\\"/ d' $(mandefs) >$@.defs
138         $(AM_V_at)sed -e '/@@@PRE@@@/ {' -e 'r$@.defs' -e 'd' -e '}' \
139                 $< >$@.new
140         $(AM_V_at)rm -f $@.defs && mv $@.new $@
141
142 install-data-local: install-man
143 install-man: $(LIBMANS) $(PROGMANS)
144         @$(NORMAL_INSTALL)
145         $(mkdir_p) $(DESTDIR)$(mandir)
146         $(top_srcdir)/config/maninst \
147                 -d $(DESTDIR)$(mandir) -s . \
148                 -i "$(INSTALL)" \
149                 install $(PROGMANS)
150         $(top_srcdir)/config/maninst \
151                 -d $(DESTDIR)$(mandir) -s . \
152                 -i "$(INSTALL)" -e "$(manext)" \
153                 install $(LIBMANS)
154 .PHONY: install-man
155
156 uninstall-local: uninstall-man
157 uninstall-man:
158         @$(NORMAL_UNINSTALL)
159         $(top_srcdir)/config/maninst \
160                 -d $(DESTDIR)$(mandir) -s . \
161                 uninstall $(PROGMANS)
162         $(top_srcdir)/config/maninst \
163                 -d $(DESTDIR)$(mandir) -s . -e "$(manext)" \
164                 uninstall $(LIBMANS)
165 .PHONY: uninstall-man
166
167 ###----- That's all, folks --------------------------------------------------