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