xref: /freebsd/contrib/dialog/makefile.in (revision 0f7f3352c8bc463607912e2463d13e52d44a4cae)
1# $Id: makefile.in,v 1.87 2013/09/02 19:51:58 tom Exp $
2# template makefile for DIALOG
3##############################################################################
4# Copyright (c) 1999-2012,2013 Thomas E. Dickey                              #
5#                                                                            #
6# Permission is hereby granted, free of charge, to any person obtaining a    #
7# copy of this software and associated documentation files (the "Software"), #
8# to deal in the Software without restriction, including without limitation  #
9# the rights to use, copy, modify, merge, publish, distribute, distribute    #
10# with modifications, sublicense, and/or sell copies of the Software, and to #
11# permit persons to whom the Software is furnished to do so, subject to the  #
12# following conditions:                                                      #
13#                                                                            #
14# The above copyright notice and this permission notice shall be included in #
15# all copies or substantial portions of the Software.                        #
16#                                                                            #
17# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
18# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
19# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
20# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
21# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
22# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
23# DEALINGS IN THE SOFTWARE.                                                  #
24#                                                                            #
25# Except as contained in this notice, the name(s) of the above copyright     #
26# holders shall not be used in advertising or otherwise to promote the sale, #
27# use or other dealings in this Software without prior written               #
28# authorization.                                                             #
29##############################################################################
30#
31SHELL		= /bin/sh
32
33srcdir		= @srcdir@
34VPATH		= @srcdir@
35
36prefix		= @prefix@
37exec_prefix	= @exec_prefix@
38datarootdir	= @datarootdir@
39
40top_builddir	= .
41
42x		= @EXEEXT@
43o		= .@OBJEXT@
44
45DESTDIR		=
46
47THIS		= dialog
48
49CFG_ROOTNAME	= @CFG_ROOTNAME@
50HDR_ROOTNAME	= @HDR_ROOTNAME@
51LIB_ROOTNAME	= @LIB_ROOTNAME@
52LIB_SUFFIX	= @LIB_SUFFIX@
53
54VERSION_MAJOR	= @VERSION_MAJOR@
55VERSION_MINOR	= @VERSION_MINOR@
56VERSION		= $(VERSION_MAJOR).$(VERSION_MINOR)
57REL_VERSION	= @REL_VERSION@
58ABI_VERSION	= @ABI_VERSION@
59LIB_ROOTNAME	= @LIB_ROOTNAME@
60@SET_SHLIB_VARS@
61
62bindir		= @bindir@
63includedir	= @includedir@
64libdir		= @libdir@
65mandir		= @mandir@
66
67BINDIR		= $(DESTDIR)$(bindir)
68INCLUDEDIR	= $(DESTDIR)$(includedir)
69LIBDIR		= $(DESTDIR)$(libdir)
70MANDIR		= $(DESTDIR)$(mandir)
71
72MAN1DIR		= $(MANDIR)/man1
73MAN3DIR		= $(MANDIR)/man3
74
75# see po/makefile
76localedir       = $(prefix)/@DATADIRNAME@/locale
77
78CFLAGS		= @CFLAGS@
79CPPFLAGS	= -I. -I$(srcdir) @CPPFLAGS@ @DEFS@ -DLOCALEDIR=\"$(localedir)\"
80EXTRA_CFLAGS	= @EXTRA_CFLAGS@
81CC		= @CC@
82CPP		= @CPP@
83AR		= @AR@
84LDFLAGS		= @EXTRA_LDFLAGS@ @LDFLAGS@
85LIBS		= @LIBS@ @INTLLIBS@
86RANLIB		= @LIB_PREP@
87
88RM		= rm -f
89LN_S		= @LN_S@
90LINT		= @LINT@
91LINT_OPTS	= @LINT_OPTS@
92
93CTAGS		= @CTAGS@
94ETAGS		= @ETAGS@
95
96LIBTOOL		= @LIBTOOL@ @ECHO_LT@
97LIBTOOL_OPTS	= @LIBTOOL_OPTS@
98LIBTOOL_CLEAN	= @LIB_CLEAN@
99LIBTOOL_COMPILE	= @LIB_COMPILE@
100LIBTOOL_CREATE	= @LIB_CREATE@
101LIBTOOL_LINK	= @LIB_LINK@
102LIBTOOL_INSTALL	= @LIB_INSTALL@
103LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
104LIBTOOL_VERSION = @LIBTOOL_VERSION@
105
106INSTALL		= @INSTALL@
107INSTALL_PROGRAM	= $(LIBTOOL_INSTALL) @INSTALL_PROGRAM@
108INSTALL_SCRIPT	= @INSTALL_SCRIPT@
109INSTALL_DATA	= @INSTALL_DATA@
110
111LINK		= $(LIBTOOL_LINK)
112
113# The library is always named for the package, but the program can be further
114# renamed at install time, starting with the package name.
115PACKAGE		= @PACKAGE@
116ACTUAL_PROG	= `echo $(PACKAGE) |sed @program_transform_name@`
117LIB_CONFIG	= $(CFG_ROOTNAME)-config
118
119# The library name $(LIB) is set at configure/make time, since it is used as a
120# makefile target.  Ditto for $(PROG).
121LIB		= @LIB_TARGET@
122PROG		= @PACKAGE@$x
123#
124# Standard .c to .o compile line.
125#
126.SUFFIXES: .c .i $o .html .1 .3 .man .ps .pdf .txt
127.c.i :
128	@RULE_CC@
129	@ECHO_CC@$(CPP) $(CPPFLAGS) -c $< >$@
130.c$o :
131	@RULE_CC@
132	@ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $<
133
134.1.html :
135	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | groff -P -o0 -I$*_ -Thtml -man" >$@
136
137.1.ps :
138	$(SHELL) -c "tbl $< | groff -man" >$@
139
140.1.txt :
141	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -Tascii -man | col -bx" >$@
142
143.ps.pdf :
144	ps2pdf $*.ps
145
146EXTRAOBJS = @EXTRAOBJS@
147OBJECTS = $(EXTRAOBJS) \
148	argv$o \
149	arrows$o \
150	buttons$o \
151	checklist$o \
152	columns$o \
153	dlg_keys$o \
154	editbox$o \
155	help$o \
156	inputbox$o \
157	inputstr$o \
158	menubox$o \
159	mouse$o \
160	mousewget$o \
161	msgbox$o \
162	textbox$o \
163	ui_getc$o \
164	util$o \
165	version$o \
166	yesno$o
167
168LIB_OBJECT = @LIB_OBJECT@
169
170SRCS = $(OBJECTS:$o=.c)
171HDRS = \
172	dialog.h \
173	dlg_colors.h \
174	dlg_config.h \
175	dlg_keys.h
176
177ALL		= $(LIB) $(PROG)
178
179BIN_DIRS	= $(BINDIR) $(MAN1DIR)
180LIB_DIRS	= $(LIBDIR) $(INCLUDEDIR)
181
182PO_DIR		= $(srcdir)/po
183
184all	:: $(ALL)
185
186@LIBTOOL_MAKE@install	:: install-lib
187@LIBTOOL_MAKE@uninstall	:: uninstall-lib
188
189@INTLDIR_MAKE@@INTLLIBS@ :
190@INTLDIR_MAKE@	@echo "Building GNU gettext library..."
191@INTLDIR_MAKE@	@cd intl && $(MAKE) @cf_cv_makeflags@
192
193dialog$o \
194$(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
195
196$(PROG)$x : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
197	$(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(LDFLAGS) $(LIBS)
198
199clean	\
200distclean \
201install \
202install-full \
203install-strip \
204uninstall ::
205	@echo making $@
206@INTLDIR_MAKE@	@-test -f intl/makefile && cd intl && $(MAKE) @cf_cv_makeflags@ $@
207@MSG_DIR_MAKE@	@-test -f po/makefile && cd po && $(MAKE) @cf_cv_makeflags@ $@
208
209clean	::
210	@- $(RM) -r autom4te.cache
211	- $(RM) *.*cov *.da *.bb *.bbg
212	- $(LIBTOOL_CLEAN) $(RM) *.i *$o $(ALL)
213	- $(RM) headers.sed
214	- $(RM) *.html *.pdf *.png *.ps *.txt dialog_lib.1
215	- $(RM) core *~ tags TAGS
216
217distclean :: clean
218	$(RM) intl/libintl.h intl/po2tbl.sed
219	$(RM) makefile dlg_config.h config.cache config.log config.status
220	$(RM) samples/install/makefile
221	$(RM) headers-sh
222	$(RM) dialog-config
223
224install :: install-bin install-man
225	@echo "made $@"
226
227install-full :: install-lib install-bin install-man
228	@echo "made $@"
229
230install-strip :: $(PROG) $(BINDIR)
231	$(INSTALL_PROGRAM) -s $(PROG) $(BINDIR)
232
233uninstall :: uninstall-bin uninstall-man
234	@echo "made $@"
235
236uninstall-full :: uninstall-bin uninstall-man uninstall-lib
237	@echo "made $@"
238
239install-bin : $(PROG) $(BINDIR)
240	$(INSTALL_PROGRAM) $(PROG) $(BINDIR)/$(ACTUAL_PROG)$x
241
242uninstall-bin :
243	$(RM) $(BINDIR)/$(ACTUAL_PROG)$x
244
245install-man :: $(MAN1DIR)
246	@ echo "** installing $(ACTUAL_PROG).1"
247	@ $(SHELL) $(srcdir)/rename.sh \
248		$(srcdir)/dialog.1 \
249		$(MAN1DIR)/$(ACTUAL_PROG).1 \
250		$(ACTUAL_PROG) \
251		@PACKAGE@ \
252		$(INSTALL_DATA)
253
254uninstall-man ::
255	$(RM) $(MAN1DIR)/$(ACTUAL_PROG).1
256
257# most users do not want/need the library, so the install rules are distinct.
258install-lib :: $(BINDIR) dialog-config
259	@ echo "** installing config script in $(BINDIR)"
260	@ $(INSTALL_SCRIPT) dialog-config $(BINDIR)/$(LIB_CONFIG)
261
262install-lib :: $(LIB_DIRS) $(LIB) headers.sed
263	@ echo "** installing library in $(LIBDIR)"
264	@ $(LIBTOOL_INSTALL) $(INSTALL_DATA) $(LIB) $(LIBDIR)
265	@ echo "** installing headers in $(INCLUDEDIR)"
266	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dialog.h
267	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_colors.h
268	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_keys.h
269	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) .         dlg_config.h
270
271uninstall-lib :: $(BINDIR)
272	$(RM) $(BINDIR)/$(LIB_CONFIG)
273
274uninstall-lib :: $(LIB_DIRS)
275	- $(LIBTOOL_UNINSTALL) $(RM) $(LIBDIR)/$(LIB)
276	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dialog.h
277	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_colors.h
278	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_keys.h
279	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) .         dlg_config.h
280
281install-lib :: $(MAN3DIR)
282	@ echo "** installing @PACKAGE@.3"
283	@ $(SHELL) $(srcdir)/rename.sh \
284		$(srcdir)/dialog.3 \
285		$(MAN3DIR)/@PACKAGE@.3 \
286		$(ACTUAL_PROG) \
287		@PACKAGE@ \
288		$(INSTALL_DATA)
289
290uninstall-lib ::
291	$(RM) $(MAN3DIR)/@PACKAGE@.3
292
293headers.sed : headers-sh
294	$(SHELL) headers-sh $(INCLUDEDIR) $(srcdir)
295
296################################################################################
297TOP_DOCS = \
298	dialog.html \
299	dialog.pdf \
300	dialog.ps \
301	dialog.txt
302dialog.html : dialog.1
303dialog.pdf : dialog.ps
304dialog.ps : dialog.1
305dialog.txt : dialog.1
306################################################################################
307# rename, to use suffix-rules
308dialog_lib.1 : dialog.3
309	-$(RM) $@
310	cp dialog.3 $@
311
312LIB_DOCS = \
313	dialog_lib.1 \
314	dialog_lib.html \
315	dialog_lib.pdf \
316	dialog_lib.ps \
317	dialog_lib.txt
318dialog_lib.html : dialog_lib.1
319dialog_lib.pdf : dialog_lib.ps
320dialog_lib.ps : dialog_lib.1
321dialog_lib.txt : dialog_lib.1
322################################################################################
323docs: $(TOP_DOCS) $(LIB_DOCS)
324clean-docs:
325	-$(RM) $(TOP_DOCS) $(LIB_DOCS)
326################################################################################
327
328$(MAN1DIR) \
329$(MAN3DIR) \
330$(BINDIR) \
331$(INCLUDEDIR) \
332$(LIBDIR) : ; mkdir -p $@
333
334@MAKE_LOWER_TAGS@tags :
335@MAKE_LOWER_TAGS@	$(CTAGS) $(SRCS) $(HDRS)
336
337@MAKE_LOWER_TAGS@TAGS :
338@MAKE_LOWER_TAGS@	$(ETAGS) $(SRCS) $(HDRS)
339
340update-po:
341	rsync -Lrtvz  translationproject.org::tp/latest/dialog/  $(PO_DIR)
342	test -f $(PO_DIR)/makefile && cd $(PO_DIR) && $(MAKE) $@
343
344lint:
345	$(LINT) $(LINT_OPTS) $(CPPFLAGS) *.c
346