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