xref: /freebsd/contrib/dialog/makefile.in (revision a25896ca1270e25b657ceaa8d47d5699515f5c25)
1# $Id: makefile.in,v 1.97 2018/06/09 01:05:18 tom Exp $
2# template makefile for DIALOG
3##############################################################################
4# Copyright (c) 1999-2017,2018 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@
34top_srcdir	= @top_srcdir@
35VPATH		= @srcdir@
36
37prefix		= @prefix@
38exec_prefix	= @exec_prefix@
39datarootdir	= @datarootdir@
40
41top_builddir	= .
42
43x		= @EXEEXT@
44o		= .@OBJEXT@
45
46DESTDIR		= @DESTDIR@
47
48THIS		= dialog
49
50CFG_ROOTNAME	= @CFG_ROOTNAME@
51HDR_ROOTNAME	= @HDR_ROOTNAME@
52LIB_ROOTNAME	= @LIB_ROOTNAME@
53LIB_PREFIX	= @LIB_PREFIX@
54LIB_SUFFIX	= @LIB_SUFFIX@
55
56VERSION_MAJOR	= @VERSION_MAJOR@
57VERSION_MINOR	= @VERSION_MINOR@
58VERSION		= $(VERSION_MAJOR).$(VERSION_MINOR)
59REL_VERSION	= @REL_VERSION@
60ABI_VERSION	= @ABI_VERSION@
61LIB_ROOTNAME	= @LIB_ROOTNAME@
62
63RESULTING_SYMS	= @RESULTING_SYMS@
64VERSIONED_SYMS	= @VERSIONED_SYMS@
65
66@SET_SHLIB_VARS@
67
68bindir		= @bindir@
69includedir	= @includedir@
70libdir		= @libdir@
71mandir		= @mandir@
72manext		= 1
73libext		= 3
74
75BINDIR		= $(DESTDIR)$(bindir)
76INCLUDEDIR	= $(DESTDIR)$(includedir)
77LIBDIR		= $(DESTDIR)$(libdir)
78MANDIR		= $(DESTDIR)$(mandir)
79
80MAN1DIR		= $(MANDIR)/man1
81MAN3DIR		= $(MANDIR)/man3
82
83# see po/makefile
84localedir       = $(prefix)/@DATADIRNAME@/locale
85
86CFLAGS		= @CFLAGS@
87CPPFLAGS	= -I. -I$(srcdir) @CPPFLAGS@ @DEFS@ -DLOCALEDIR=\"$(localedir)\"
88EXTRA_CFLAGS	= @EXTRA_CFLAGS@
89CC		= @CC@
90CPP		= @CPP@
91AR		= @AR@
92ARFLAGS		= @ARFLAGS@
93LDFLAGS		= @EXTRA_LDFLAGS@ @LDFLAGS@
94LIBS		= @LIBS@ @INTLLIBS@
95RANLIB		= @LIB_PREP@
96
97RM		= rm -f
98LN_S		= @LN_S@
99LINT		= @LINT@
100LINT_OPTS	= @LINT_OPTS@
101
102CTAGS		= @CTAGS@
103ETAGS		= @ETAGS@
104
105LIBTOOL		= @LIBTOOL@ @ECHO_LT@
106LIBTOOL_OPTS	= @LIBTOOL_OPTS@
107LIBTOOL_CLEAN	= @LIB_CLEAN@
108LIBTOOL_COMPILE	= @LIB_COMPILE@
109LIBTOOL_CREATE	= @LIB_CREATE@
110LIBTOOL_LINK	= @LIB_LINK@
111LIBTOOL_INSTALL	= @LIB_INSTALL@
112LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
113LIBTOOL_VERSION = @LIBTOOL_VERSION@
114
115INSTALL		= @INSTALL@
116INSTALL_PROGRAM	= $(LIBTOOL_INSTALL) @INSTALL_PROGRAM@
117INSTALL_SCRIPT	= @INSTALL_SCRIPT@
118INSTALL_DATA	= @INSTALL_DATA@
119
120LINK		= $(LIBTOOL_LINK)
121
122# The library is always named for the package, but the program can be further
123# renamed at install time, starting with the package name.
124PACKAGE		= @PACKAGE@
125ACTUAL_PROG	= `echo $(PACKAGE) |sed @program_transform_name@`
126LIB_CONFIG	= $(CFG_ROOTNAME)-config
127
128# The library name $(LIB) is set at configure/make time, since it is used as a
129# makefile target.  Ditto for $(PROG).
130LIB		= @LIB_TARGET@
131PROG		= @PACKAGE@$x
132#
133# Standard .c to .o compile line.
134#
135.SUFFIXES: .c .i $o .1 .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf
136.c.i :
137	@RULE_CC@
138	@ECHO_CC@$(CPP) $(CPPFLAGS) -c $< >$@
139.c$o :
140	@RULE_CC@
141	@ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $<
142
143@NROFF_NOTE@.1.txt :
144@NROFF_NOTE@	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -Tascii -man | col -bx" >$@
145
146@MAN2HTML_NOTE@.1.html :
147@MAN2HTML_NOTE@	./@MAN2HTML_TEMP@ $* 1 man >$@
148@MAN2HTML_NOTE@
149@GROFF_NOTE@.1.ps :
150@GROFF_NOTE@	$(SHELL) -c "tbl $< | groff -man" >$@
151@GROFF_NOTE@
152@GROFF_NOTE@.ps.pdf :
153@GROFF_NOTE@	ps2pdf $*.ps
154
155EXTRAOBJS = @EXTRAOBJS@
156OBJECTS = $(EXTRAOBJS) \
157	argv$o \
158	arrows$o \
159	buttons$o \
160	checklist$o \
161	columns$o \
162	dlg_keys$o \
163	editbox$o \
164	help$o \
165	inputbox$o \
166	inputstr$o \
167	menubox$o \
168	mouse$o \
169	mousewget$o \
170	msgbox$o \
171	textbox$o \
172	ttysize$o \
173	ui_getc$o \
174	util$o \
175	version$o \
176	yesno$o
177
178LIB_OBJECT = @LIB_OBJECT@
179
180SRCS = $(OBJECTS:$o=.c)
181HDRS = \
182	dialog.h \
183	dlg_colors.h \
184	dlg_config.h \
185	dlg_keys.h
186
187ALL		= $(LIB) $(PROG)
188
189BIN_DIRS	= $(BINDIR) $(MAN1DIR)
190LIB_DIRS	= $(LIBDIR) $(INCLUDEDIR)
191
192PO_DIR		= $(srcdir)/po
193
194all	:: $(ALL)
195
196@LIBTOOL_MAKE@install	:: install-lib
197@LIBTOOL_MAKE@uninstall	:: uninstall-lib
198
199@INTLDIR_MAKE@@INTLLIBS@ :
200@INTLDIR_MAKE@	@echo "Building GNU gettext library..."
201@INTLDIR_MAKE@	@cd intl && $(MAKE) @cf_cv_makeflags@
202
203dialog$o \
204$(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
205
206$(PROG)$x : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
207	$(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(CFLAGS) $(LDFLAGS) $(LIBS)
208
209clean	\
210distclean \
211install \
212install-full \
213install-strip \
214uninstall ::
215	@echo making $@
216@INTLDIR_MAKE@	@-test -f intl/makefile && cd intl && $(MAKE) @cf_cv_makeflags@ $@
217@MSG_DIR_MAKE@	@-test -f po/makefile && cd po && $(MAKE) @cf_cv_makeflags@ $@
218
219clean	::
220	@- $(RM) -r autom4te.cache
221	- $(RM) *.*cov *.da *.bb *.bbg
222	- $(LIBTOOL_CLEAN) $(RM) *.i *$o $(ALL)
223	- $(RM) headers.sed
224	- $(RM) *.html *.pdf *.png *.ps *.txt dialog_lib.1
225	- $(RM) core *~ tags TAGS
226
227distclean :: clean
228	$(RM) intl/libintl.h intl/po2tbl.sed
229	$(RM) makefile dlg_config.h config.cache config.log config.status
230	$(RM) samples/install/makefile
231	$(RM) headers-sh
232	$(RM) man2html.*
233	$(RM) dialog-config
234
235install :: install-bin install-man
236	@echo "made $@"
237
238install-full :: install-lib install-bin install-man
239	@echo "made $@"
240
241install-strip :: $(PROG) $(BINDIR)
242	$(INSTALL_PROGRAM) -s $(PROG) $(BINDIR)
243
244uninstall :: uninstall-bin uninstall-man
245	@echo "made $@"
246
247uninstall-full :: uninstall-bin uninstall-man uninstall-lib
248	@echo "made $@"
249
250install-bin : $(PROG) $(BINDIR)
251	$(INSTALL_PROGRAM) $(PROG) $(BINDIR)/$(ACTUAL_PROG)$x
252
253uninstall-bin :
254	$(RM) $(BINDIR)/$(ACTUAL_PROG)$x
255
256install-man :: $(MAN1DIR)
257	@ echo "** installing $(ACTUAL_PROG).$(manext)"
258	@ $(SHELL) $(srcdir)/rename.sh \
259		$(srcdir)/dialog.1 \
260		$(MAN1DIR)/$(ACTUAL_PROG).$(manext) \
261		$(ACTUAL_PROG) \
262		@PACKAGE@ \
263		$(INSTALL_DATA)
264
265uninstall-man ::
266	$(RM) $(MAN1DIR)/$(ACTUAL_PROG).$(manext)
267
268# most users do not want/need the library, so the install rules are distinct.
269install-lib :: $(BINDIR) dialog-config
270	@ echo "** installing config script in $(BINDIR)"
271	@ $(INSTALL_SCRIPT) dialog-config $(BINDIR)/$(LIB_CONFIG)
272
273install-lib :: $(LIB_DIRS) $(LIB) headers.sed
274	@ echo "** installing library in $(LIBDIR)"
275	@ $(LIBTOOL_INSTALL) $(INSTALL_DATA) $(LIB) $(LIBDIR)
276	@ echo "** installing headers in $(INCLUDEDIR)"
277	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dialog.h
278	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_colors.h
279	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_keys.h
280	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) .         dlg_config.h
281
282uninstall-lib :: $(BINDIR)
283	$(RM) $(BINDIR)/$(LIB_CONFIG)
284
285uninstall-lib :: $(LIB_DIRS)
286	- $(LIBTOOL_UNINSTALL) $(RM) $(LIBDIR)/$(LIB)
287	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dialog.h
288	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_colors.h
289	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_keys.h
290	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) .         dlg_config.h
291
292install-lib :: $(MAN3DIR)
293	@ echo "** installing @PACKAGE@.$(libext)"
294	@ $(SHELL) $(srcdir)/rename.sh \
295		$(srcdir)/dialog.3 \
296		$(MAN3DIR)/@PACKAGE@.$(libext) \
297		$(ACTUAL_PROG) \
298		@PACKAGE@ \
299		$(INSTALL_DATA)
300
301uninstall-lib ::
302	$(RM) $(MAN3DIR)/@PACKAGE@.$(libext)
303
304headers.sed : headers-sh
305	$(SHELL) headers-sh $(INCLUDEDIR) $(srcdir)
306
307################################################################################
308TOP_DOCS = \
309@NROFF_NOTE@	dialog.txt \
310@MAN2HTML_NOTE@	dialog.html \
311@GROFF_NOTE@	dialog.pdf \
312@GROFF_NOTE@	dialog.ps
313
314dialog.html : dialog.1
315dialog.pdf : dialog.ps
316dialog.ps : dialog.1
317dialog.txt : dialog.1
318################################################################################
319# rename, to use suffix-rules
320dialog_lib.1 : dialog.3
321	-$(RM) $@
322	cp dialog.3 $@
323
324LIB_DOCS = \
325	dialog_lib.1 \
326@NROFF_NOTE@	dialog_lib.txt \
327@MAN2HTML_NOTE@	dialog_lib.html \
328@GROFF_NOTE@	dialog_lib.pdf \
329@GROFF_NOTE@	dialog_lib.ps
330
331dialog_lib.html : dialog_lib.1
332dialog_lib.pdf : dialog_lib.ps
333dialog_lib.ps : dialog_lib.1
334dialog_lib.txt : dialog_lib.1
335################################################################################
336docs: $(TOP_DOCS) $(LIB_DOCS)
337clean-docs:
338	-$(RM) $(TOP_DOCS) $(LIB_DOCS)
339################################################################################
340
341$(MAN1DIR) \
342$(MAN3DIR) \
343$(BINDIR) \
344$(INCLUDEDIR) \
345$(LIBDIR) : ; mkdir -p $@
346
347@MAKE_LOWER_TAGS@tags :
348@MAKE_LOWER_TAGS@	$(CTAGS) $(SRCS) $(HDRS)
349
350@MAKE_LOWER_TAGS@TAGS :
351@MAKE_LOWER_TAGS@	$(ETAGS) $(SRCS) $(HDRS)
352
353update-po:
354	rsync -Lrtvz  translationproject.org::tp/latest/dialog/  $(PO_DIR)
355	test -f $(PO_DIR)/makefile && cd $(PO_DIR) && $(MAKE) $@
356
357lint:
358	$(LINT) $(LINT_OPTS) $(CPPFLAGS) *.c
359