xref: /freebsd/contrib/dialog/makefile.in (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1# $Id: makefile.in,v 1.103 2021/01/11 09:03:36 tom Exp $
2# template makefile for DIALOG
3##############################################################################
4# Copyright (c) 1999-2020,2021 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
105RPATH_LIST	= @RPATH_LIST@
106LIBTOOL		= @LIBTOOL@ @ECHO_LT@
107LIBTOOL_OPTS	= @LIBTOOL_OPTS@
108LIBTOOL_CLEAN	= @LIB_CLEAN@
109LIBTOOL_COMPILE	= @LIB_COMPILE@
110LIBTOOL_CREATE	= @LIB_CREATE@
111LIBTOOL_LINK	= @LIB_LINK@
112LIBTOOL_INSTALL	= @LIB_INSTALL@
113LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
114LIBTOOL_VERSION = @LIBTOOL_VERSION@
115
116INSTALL		= @INSTALL@
117INSTALL_PROGRAM	= $(LIBTOOL_INSTALL) @INSTALL_PROGRAM@
118INSTALL_SCRIPT	= @INSTALL_SCRIPT@
119INSTALL_DATA	= @INSTALL_DATA@
120
121LINK		= $(LIBTOOL_LINK)
122
123# The library is always named for the package, but the program can be further
124# renamed at install time, starting with the package name.
125PACKAGE		= @PACKAGE@
126ACTUAL_PROG	= `echo $(PACKAGE) |sed @program_transform_name@`
127LIB_CONFIG	= $(CFG_ROOTNAME)-config
128
129# The library name $(LIB) is set at configure/make time, since it is used as a
130# makefile target.  Ditto for $(PROG).
131LIB		= @LIB_TARGET@
132PROG		= @PACKAGE@$x
133#
134# Standard .c to .o compile line.
135#
136.SUFFIXES: .c .i $o .1 .man .txt @MAN2HTML_NOTE@ .html @GROFF_NOTE@ .ps .pdf
137.c.i :
138	@RULE_CC@
139	@ECHO_CC@$(CPP) $(CPPFLAGS) -c $< >$@
140.c$o :
141	@RULE_CC@
142	@ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $<
143
144@NROFF_NOTE@.1.txt :
145@NROFF_NOTE@	GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -rHY=0 -Tascii -man | col -bx" >$@
146
147@MAN2HTML_NOTE@.1.html :
148@MAN2HTML_NOTE@	./@MAN2HTML_TEMP@ $* 1 man >$@
149@MAN2HTML_NOTE@
150@GROFF_NOTE@.1.ps :
151@GROFF_NOTE@	$(SHELL) -c "tbl $< | groff -man" >$@
152@GROFF_NOTE@
153@GROFF_NOTE@.ps.pdf :
154@GROFF_NOTE@	ps2pdf $*.ps
155
156EXTRAOBJS = @EXTRAOBJS@
157OBJECTS = $(EXTRAOBJS) \
158	argv$o \
159	arrows$o \
160	buttons$o \
161	checklist$o \
162	columns$o \
163	dlg_keys$o \
164	editbox$o \
165	help$o \
166	inputbox$o \
167	inputstr$o \
168	menubox$o \
169	mouse$o \
170	mousewget$o \
171	msgbox$o \
172	textbox$o \
173	ttysize$o \
174	ui_getc$o \
175	util$o \
176	version$o \
177	yesno$o
178
179LIB_OBJECT = @LIB_OBJECT@
180
181SRCS = $(OBJECTS:$o=.c)
182HDRS = \
183	dialog.h \
184	dlg_colors.h \
185	dlg_config.h \
186	dlg_keys.h
187
188ALL		= $(LIB) $(PROG)
189
190BIN_DIRS	= $(BINDIR) $(MAN1DIR)
191LIB_DIRS	= $(LIBDIR) $(INCLUDEDIR)
192
193PO_DIR		= $(srcdir)/po
194
195all	:: $(ALL)
196
197@LIBTOOL_MAKE@install	:: install-lib
198@LIBTOOL_MAKE@uninstall	:: uninstall-lib
199
200@INTLDIR_MAKE@@INTLLIBS@ :
201@INTLDIR_MAKE@	@echo "Building GNU gettext library..."
202@INTLDIR_MAKE@	@cd intl && $(MAKE) @cf_cv_makeflags@
203
204dialog$o \
205$(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
206
207$(PROG) : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
208	$(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(CFLAGS) $(LDFLAGS) $(LIBS)
209
210clean	\
211distclean \
212install \
213install-full \
214install-strip \
215uninstall ::
216	@echo making $@
217@INTLDIR_MAKE@	@-test -f intl/makefile && cd intl && $(MAKE) @cf_cv_makeflags@ $@
218@MSG_DIR_MAKE@	@-test -f po/makefile && cd po && $(MAKE) @cf_cv_makeflags@ $@
219
220clean	::
221	@- $(RM) -r autom4te.cache
222	- $(RM) *.*cov *.da *.bb *.bbg
223	- $(LIBTOOL_CLEAN) $(RM) *.i *$o $(ALL)
224	- $(RM) headers.sed
225	- $(RM) *.html *.pdf *.png *.ps *.txt dialog_lib.1
226	- $(RM) core *~ tags TAGS
227
228distclean :: clean
229	$(RM) intl/libintl.h intl/po2tbl.sed
230	$(RM) makefile dlg_config.h config.cache config.log config.status
231	$(RM) samples/install/makefile
232	$(RM) headers-sh
233	$(RM) man2html.*
234	$(RM) dialog-config
235
236check :
237	@echo "Verify that create-rc works"
238	$(SHELL) -c "DIALOG=./$(PROG) ./run_test.sh $(srcdir)/samples"
239
240install :: install-bin install-man
241	@echo "made $@"
242
243install-full :: install-lib install-bin install-man
244	@echo "made $@"
245
246install-strip :: $(PROG) $(BINDIR)
247	$(INSTALL_PROGRAM) -s $(PROG) $(BINDIR)
248
249uninstall :: uninstall-bin uninstall-man
250	@echo "made $@"
251
252uninstall-full :: uninstall-bin uninstall-man uninstall-lib
253	@echo "made $@"
254
255install-bin : $(PROG) $(BINDIR)
256	$(INSTALL_PROGRAM) $(PROG) $(BINDIR)/$(ACTUAL_PROG)$x
257
258uninstall-bin :
259	$(RM) $(BINDIR)/$(ACTUAL_PROG)$x
260
261install-man :: $(MAN1DIR)
262	@ echo "** installing $(ACTUAL_PROG).$(manext)"
263	@ $(SHELL) $(srcdir)/rename.sh \
264		$(srcdir)/dialog.1 \
265		$(MAN1DIR)/$(ACTUAL_PROG).$(manext) \
266		$(ACTUAL_PROG) \
267		@PACKAGE@ \
268		$(INSTALL_DATA)
269
270uninstall-man ::
271	$(RM) $(MAN1DIR)/$(ACTUAL_PROG).$(manext)
272
273# most users do not want/need the library, so the install rules are distinct.
274install-lib :: $(BINDIR) dialog-config
275	@ echo "** installing config script in $(BINDIR)"
276	@ $(INSTALL_SCRIPT) dialog-config $(BINDIR)/$(LIB_CONFIG)
277
278install-lib :: $(LIB_DIRS) $(LIB) headers.sed
279	@ echo "** installing library in $(LIBDIR)"
280	@ $(LIBTOOL_INSTALL) $(INSTALL_DATA) $(LIB) $(LIBDIR)
281	@ echo "** installing headers in $(INCLUDEDIR)"
282	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dialog.h
283	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_colors.h
284	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_keys.h
285	@ $(SHELL) headers-sh $(INSTALL_DATA) $(INCLUDEDIR) .         dlg_config.h
286
287uninstall-lib :: $(BINDIR)
288	$(RM) $(BINDIR)/$(LIB_CONFIG)
289
290uninstall-lib :: $(LIB_DIRS)
291	- $(LIBTOOL_UNINSTALL) $(RM) $(LIBDIR)/$(LIB)
292	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dialog.h
293	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_colors.h
294	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) $(srcdir) dlg_keys.h
295	@ $(SHELL) headers-sh $(RM) $(INCLUDEDIR) .         dlg_config.h
296
297install-lib :: $(MAN3DIR)
298	@ echo "** installing @PACKAGE@.$(libext)"
299	@ $(SHELL) $(srcdir)/rename.sh \
300		$(srcdir)/dialog.3 \
301		$(MAN3DIR)/@PACKAGE@.$(libext) \
302		$(ACTUAL_PROG) \
303		@PACKAGE@ \
304		$(INSTALL_DATA)
305
306uninstall-lib ::
307	$(RM) $(MAN3DIR)/@PACKAGE@.$(libext)
308
309headers.sed : headers-sh
310	$(SHELL) headers-sh $(INCLUDEDIR) $(srcdir)
311
312################################################################################
313TOP_DOCS = \
314@NROFF_NOTE@	dialog.txt \
315@MAN2HTML_NOTE@	dialog.html \
316@GROFF_NOTE@	dialog.pdf \
317@GROFF_NOTE@	dialog.ps
318
319dialog.html : dialog.1
320dialog.pdf : dialog.ps
321dialog.ps : dialog.1
322dialog.txt : dialog.1
323################################################################################
324# rename, to use suffix-rules
325dialog_lib.1 : dialog.3
326	-$(RM) $@
327	cp dialog.3 $@
328
329LIB_DOCS = \
330	dialog_lib.1 \
331@NROFF_NOTE@	dialog_lib.txt \
332@MAN2HTML_NOTE@	dialog_lib.html \
333@GROFF_NOTE@	dialog_lib.pdf \
334@GROFF_NOTE@	dialog_lib.ps
335
336dialog_lib.html : dialog_lib.1
337dialog_lib.pdf : dialog_lib.ps
338dialog_lib.ps : dialog_lib.1
339dialog_lib.txt : dialog_lib.1
340################################################################################
341docs: $(TOP_DOCS) $(LIB_DOCS)
342clean-docs:
343	-$(RM) $(TOP_DOCS) $(LIB_DOCS)
344################################################################################
345
346$(MAN1DIR) \
347$(MAN3DIR) \
348$(BINDIR) \
349$(INCLUDEDIR) \
350$(LIBDIR) : ; mkdir -p $@
351
352@MAKE_LOWER_TAGS@tags :
353@MAKE_LOWER_TAGS@	$(CTAGS) $(SRCS) $(HDRS)
354
355@MAKE_LOWER_TAGS@TAGS :
356@MAKE_LOWER_TAGS@	$(ETAGS) $(SRCS) $(HDRS)
357
358update-po:
359	rsync -Lrtvz  translationproject.org::tp/latest/dialog/  $(PO_DIR)
360	test -f $(PO_DIR)/makefile && cd $(PO_DIR) && $(MAKE) $@
361
362lint:
363	$(LINT) $(LINT_OPTS) $(CPPFLAGS) *.c
364